Digitact - the Touch-responsive Finger.
by noortiel in Circuits > Arduino
64 Views, 1 Favorites, 0 Comments
Digitact - the Touch-responsive Finger.
For a school project at HKU, I had to create an Arduino build that had some sort of input and output. After this was explained I initially wanted to make a (3D-printed) hand that would shake your hand once you held it. This idea would create an interaction between human and machine that I was interested in, because I myself was curious what that experience would be like.
This however appeared to be a slightly ambitious concept and I decided to scale it down to a finger that would move when triggered by touch. This way, it would be possible for me to hand in a build that would hopefully fit within the assignment's criteria, while simultaneously creating a proof-of-concept in case I ever wanted to finish the complete hand.
This Instructable is intended to show the process of creating this moving finger; the Digitact.
Supplies
- Arduino UNO R3
- USB-A to USB-B cable
- Bread board
- PCB
- Male-female jumper cables
- Male-male jumper cables
- SG90 Servo - 360 Degree Continuous Rotation - 1.3 kg/cm - 9g
- Touch Sensor TTP223B
- PC with 3D-modeling software (Maya, Blender etc.), 3D-printing software (e.g. Ultimaker Cura), and Arduino IDE
- 3D-printer
- PLA filament
- Soldering iron
- Soldering tin
- Drill
- Dremel
- String
- 4 Elastic bands
- 2 mm crochet hook
- 3 Paperclips
- Old tobacco tin
- Nail (+/- 2 cm)
- Servo arm
- Empty sewing reel
- Thread
- Washers of various sizes
- Washers of amigurumi plastic safety eye
- Anti-slip mat
- Plastic plates
- Plastic screw box
- Piece of wood (1.6 x 1.0 x 6.0 cm)
- Small cable clip
- Bison Tix Gel contact glue
- Powerbank
- Marker/pen
Concept / Prototyping
At the start of this project, I had no experience with Arduino or animatronics.
After extensively searching for any existing projects that resembled my concept, I came to the conclusion that I could achieve the wanted effect by using a servo, a touch sensor, and a string/elastic band pulling mechanism. I made several prototypes with bubble tea straws and eventually learned enough that I was confident in my ability to create a moving finger.
Creating the Finger
The final version of the finger, I decided, would be 3D-printed. I had been wanting to learn how to use a 3D-printer, and used this opportunity to do just that.
This meant that I had to make a 3D-model first, which proved to be somewhat of a challenge due to my inexperience using Maya 2024. I made sure to pay attention to the scale of the model (the hinges and holes in particular), so that it would fit with the parts that I was planning to use.
After I finished the model, I printed it using two different 3D-printers due to scheduling difficulties. Once printed, I had to remove the supports, which proved to be harder than I had anticipated (I probably selected the wrong settings in Ultimaker Cura). I was forced to use a drill, various screwdrivers and a jigsaw to remove the supports from the holes.
Assembling the Pull System
Once the 3D-printed parts were ready for use, it was time to build the moving finger.
Since I had wanted to use an old tobacco tin as the case, I decided to drill a hole into it's lid first. This hole had the diameter of the finger. I also made a square hole where the touch sensor was supposed to go with a dremel. That way I could feed the lower part of the 3D-printed finger (with the platform attached) through the bottom of the circular hole. This would not be possible after the assembly of finger, so it was important to complete this step first. Similarly, I cut a hole in the side of the tin for the USB-cable.
After that it was time to attach the string. I started by tying a piece of string to the top phalanx. Then I fed the string downwards through the hole in that phalanx to the one below that using a thin crochet hook, and continued downwards until all the parts of the finger were strung onto the string.
Once that was done, I tied the first elastic band to the other side of the top phalanx and fed it downwards through its respective hole in that phalanx using the crochet hook. Then I tied the second elastic band to the end of the first, and fed that through the second phalanx and so on. I made sure the knots resided on top of the hinges. I also temporarily secured the final elastic band to the bottom of the construction by tying the end to a pen. This way, it was not possible for the elastic band to be pulled back into the finger.
As the pulling system was easier to assemble without the phalanges being attached to each other, the hinges were not functional yet at this point. To resolve that issue, I straightened three paperclips and used them as pins in the hinges. To secure them, I bent the sides to make them resemble a 'U'-shape.
Now, once you pulled the string, the finger would bend.
Building the Circuit
Now that a manual pulling system had been realised, it was time to automate it. To do this, I used an Arduino Uno R3 with a continuous servo and a touch sensor attached to it. I gently hammered a nail into the spinning part of the servo to act as a reel for the string. I tested this circuit on a bread board first, and started writing my code in Arduino IDE.
My intention was to make a pulling/releasing system for the string based on time. When the touch sensor was touched, I wanted the servo to pull the string for a certain time interval and then release it in the same manner. The length of the time interval was dependent on how much time the servo needed to pull the string far enough to bend the finger.
I used the example code for Servo Sweep and continued adding my own lines. I asked a friend for help when I could not figure out how to do it myself.
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
https://www.arduino.cc/en/Tutorial/LibraryExamples/Sweep
*/
//By Noortje Goedhart; published on 28 June 2024
#include <Servo.h>
Servo myservo;
int pushButton = 7; // pin 7 has a touch sensor attached
bool touched = false;
bool touchedPrevious = false;
int currentTime = 0;
int prevTime = 0;
int upTimer = 0;
int downTimer = 0;
//PLEASE NOTE THAT THE downTargetTime IS SLIGHTLY LONGER THAN THE upTargetTime IN PRACTICE; SO IT SHOULD ALWAYS BE A SMALLER NUMBER IN THE CODE!! e.g. 490 < 600
//These two values are dependent on the circumference of the reel used to pull in the string.
int upTargetTime = 600;
int downTargetTime = 490;
int counter;
void setup() {
myservo.attach(9); // pin 9 has a servo attached
Serial.begin(9600); // start serial communication at 9600 bits/second
pinMode(pushButton, INPUT); // make the touch sensor's pin an input
}
void loop() {
//SERVO
counter = counter + 1;
//Timer
currentTime = millis();
int deltaTime = currentTime - prevTime;
prevTime = currentTime;
if (upTimer > 0)
upTimer = upTimer - deltaTime;
if (downTimer > 0)
downTimer = downTimer - deltaTime;
myservo.write(90);
if (upTimer > 0) {
Serial.print("up");
myservo.write(0); //pull string in
} else if (downTimer > 0) {
Serial.print("down");
myservo.write(180); //release string
} else {
Serial.print("stop");
myservo.write(90); //stop the servo
}
// TOUCH SENSOR
int buttonState = digitalRead(pushButton); // read the input of the pin
delay(50); // delay inbetween reads for stability
if (buttonState == 0) {
touched = false;
}
if (buttonState == 1) {
touched = true;
}
//FINGER DOWN
if (touched == true && touchedPrevious == false && upTimer <= 0 && counter > 20) {
if (downTimer > 0) {
upTimer = upTargetTime - downTimer;
} else {
upTimer = upTargetTime;
}
myservo.write(180); // servo pulls string
}
// FINGER UP
if (touched == false && touchedPrevious == true && downTimer <= 0) {
if (upTimer > 0) {
downTimer = downTargetTime + upTimer;
} else {
downTimer = downTargetTime;
}
myservo.write(0); // servo releases string
counter = 0;
}
//INACTIVE
if (touched == false && touchedPrevious == false) {
myservo.write(90); // servo is not moving
}
touchedPrevious = touched;
Serial.print('\n'); // vertical printing in serial monitor
Once I was confident that my circuit worked as intended, I soldered the jumper cables attached to the bread board to a PCB instead.
Later, it turned out that the nail did not sufficiently reel in the string without unraveling it. To solve this issue I made a new construction comprised of a nail, a servo arm, an empty sewing reel, some thread, and several tiny parts I found around the house. This way the string did not escape the reel.
Assembling the Case
The next step was to assemble everything and make a construction within the old tobacco tin that could hold all of the components needed. The first thing I did was to cut out a piece of anti-slip mat to put on the floor of the tin. By doing this, I made sure that the parts on top of it would not slide around on the inside. Next, I placed my Arduino Uno R3 inside, with the USB-B port outside the tin through the hole I cut in the side earlier. I secured it to the side by wedging some perfectly sized plastic between the opposite side of the tin and the Arduino. On top of this plastic, I placed another piece of anti-slip mat and topped that off with the PCB.
After that it was time to finish the construction attached to the lid. This was arguably the most tedious part of the job, as it required a bit of precision, the right type of glue, and an extra pair of hands.
To allow the reel to rotate, I had to find a way to create enough distance between the reel and the lid. I found a small plastic screw box that had the right dimensions. I removed the stickers and drilled a hole in the side of the box. After that I pulled the elastic band (that had been secured by the pen) through the hole and secured it on the inside of the box by tying it to a washer. Now the box both created the needed height and held the elastic band secure.
Once I held the servo on top of it to gauge what it needed to function, I realised that it would be good to put another structure on the opposite side of reel to hold it up. This way I could be more confident that the reel would not be torn apart because of the tension on the string. Again, I needed to create height to be able to support the inverted cable clip I was planning to use to achieve this effect. I sawed a tiny piece of scrap wood and pushed the cable clip into the top.
Now that all of the separate parts were ready, I could finally glue them all together. For this I mostly used Bison Tix Gel contact glue. I also asked someone to help me hold the parts while we applied glue. I started by gluing the 3D-printed finger base to the lid. After that I glued the piece of wood with the cable clip to the base, carefully adjusting its position until it was correct. Then I attached the plastic box to the base, and wrapped the string around the reel. While doing this, I had to be careful to wrap the string in the correct direction and to create a perfect tension to keep the finger straightened, but the string taut. After removing the servo's stickers, I attached the servo to the plastic box. I made sure that the reel lined up with the hole containing the string, and that the end of the reel construction clicked into the cable clip. Lastly, I clicked the touch sensor into its respective hole, and the case was done.
All the finger needed to function at this point was a power source, so I plugged the USB-cable into the Arduino on the outside of the tin, and connected it to a powerbank. Now, when the touch sensor was pressed, the finger bent.
Conclusion
Looking back on this project, I realise that I really enjoyed it. I learned to work with various new programs and machines that I had no experience with before. I also really liked cracking my brain to think of that one right material that might be lying around the house somewhere that I could use to fix my current issue. In the end, I am happy that I got to work on a project as physical as this one, as I greatly enjoy tinkering in general. While there were several difficulties, I was able to overcome them and develop my skills and mindset in the process to create the Digitact. In the future, I might use the knowledge I have gained from working on this project to create an entire interactive hand to further challenge myself.