Robot Hand for STEM TECH & MATH

by Fazeel in Circuits > Arduino

30 Views, 0 Favorites, 0 Comments

Robot Hand for STEM TECH & MATH

IMG_6811.jpeg

This project is about a robot hand that me and my group had to work on. My group had mainly built the hand, but I contributed the majority of my efforts into the coding aspect of this assignment. The hand had used its build design and idea from an external source. We used Javantes hand as the model while creating the hand.

Supplies

IMG_6049.jpeg

The supplies that were used in the production of the robotic hand include a large foam block, paperclips, fishing line, sharpie marker, sanding block, pliers, box-cutter knife, needle pin, and rubber bands. To allow the hand to move, you must add components like the Arduino Genuino Uno, 2-5 servos (depending on how many actions you would like the robot to perform), 3-9V battery, and wires.

Gathering Materials

To begin you want to make sure you have all materials on hand as listed above in the supplies. You may then move onto the construction of the hand.

Creating the Fingers

IMG_6793.jpeg
IMG_6791.jpeg

You can begin to place your fingers, hand, and forearm on a blank sheet of paper and trace your or another individuals hand. You trace each section and measure them for future reference. You should then take your hand and place this over the Styrofoam block and cut out and model the fingers. It is recommended that you cut these into blocks and then sand them down into a round finger to provide better accuracy of the hand model.

Creating the Hand & Forearm

IMG_3008.jpeg

As you have already traced the hand and the forearm on a sheet of paper, continue to use your or your partners hand to cut out the hand and forearm together from the foam block. Make sure when you cut the hand and forearm from the block that they are connected when cut. You should keep these parts in a block form to sand them later.

Sanding Down the Fingers, Hand, and Forearm

IMG_6792.jpeg
IMG_6790.jpeg

You must sand down the blocks that you have created previously, such as the fingers, hand, and forearms. You mainly have to sand down the top of the fingers as you are required to make them round so they look aesthetically pleasing and have great functionality. Not to forget you should sand down the whole finger and the sides to make it cylindrical. Sanding down the hand is important so when you attach the fingers the functionality of the whole hand is not compromised. Sanding down the forearm is completely for aesthetics.

Waste Code Component

Before you make your truncated cuts, you should take proper measurements of the cylinder or cylinders, specifically the radius and the height. You then upload these measurements into a word or excel document for future reference. Finally you can use the volume formulas of the prism, cylinder, and the semi-sphere on the cylinder. The semi-sphere uses the radius of the cylinder. Finally insert these formulas into python and begin coding to create the waste between the prism and the cylinder. You simply subtract the volume of the cylinder from the volume of the prism (Prism - Cylinder). Before you begin coding in all the formulas, you are required to enter in a line "import math" so that you can include the value of pi within your code.


Here is an example of my waste code, which calculate the waste for all 5 fingers.

import math

print("THUMB")
#Declare parameters for rectangular prism
L1 = float(input("Enter the length of the prism"))
W1 = float(input("Enter the width of the prism"))
PH1 = float(input("Enter the height of the prism"))
#Calculate volume of the prism
RPV1 = L1 * W1 * PH1
#Declare parameters for cylinder
R1 = float(input("Enter the radius of the cylinder"))
CH1 = float(input("Enter the height of the cylinder"))
#Calculate volume of the cylinder
CV1 = R1**2 * math.pi * CH1
SSV1 = math.pi * (4/3) * R1**3
#Add Cylinder & Semi-sphere
FV1 = CV1 + SSV1
#Calculate Waste
W1 = RPV1 - FV1

print("INDEX")
#Declare parameters for rectangular prism
L2 = float(input("Enter the length of the prism"))
W2 = float(input("Enter the width of the prism"))
PH2 = float(input("Enter the height of the prism"))
#Calculate volume of the prism
RPV2 = L2 * W2 * PH2
#Declare parameters for cylinder
R2 = float(input("Enter the radius of the cylinder"))
CH2= float(input("Enter the height of the cylinder"))
#Calculate volume of the cylinder
CV2 = R2**2 * math.pi * CH2
SSV2 = math.pi * (4/3) * R2**3
#Add Cylinder & Semi-sphere
FV2 = CV2 + SSV2
#Calculate Waste
W2 = RPV2 - FV2

print("MIDDLE")
#Declare parameters for rectangular prism
L3 = float(input("Enter the length of the prism"))
W3 = float(input("Enter the width of the prism"))
PH3 = float(input("Enter the height of the prism"))
#Calculate volume of the prism
RPV3 = L3 * W3 * PH3
#Declare parameters for cylinder
R3 = float(input("Enter the radius of the cylinder"))
CH3= float(input("Enter the height of the cylinder"))
#Calculate volume of the cylinder
CV3 = R3**2 * math.pi * CH3
SSV3 = math.pi * (4/3) * R3**3
#Add Cylinder & Semi-sphere
FV3 = CV3 + SSV3
#Calculate Waste
W3 = RPV3 - FV3

print("Ring")
#Declare parameters for rectangular prism
L4 = float(input("Enter the length of the prism"))
W4 = float(input("Enter the width of the prism"))
PH4 = float(input("Enter the height of the prism"))
#Calculate volume of the prism
RPV4 = L4 * W4 * PH4
#Declare parameters for cylinder
R4 = float(input("Enter the radius of the cylinder"))
CH4= float(input("Enter the height of the cylinder"))
#Calculate volume of the cylinder
CV4 = R4**2 * math.pi * CH4
SSV4 = math.pi * (4/3) * R4**3
#Add Cylinder & Semi-sphere
FV4 = CV4 + SSV4
#Calculate Waste
W4 = RPV4 - FV4

print("PINKY")
#Declare parameters for rectangular prism
L5 = float(input("Enter the length of the prism"))
W5 = float(input("Enter the width of the prism"))
PH5 = float(input("Enter the height of the prism"))
#Calculate volume of the prism
RPV5 = L5 * W5 * PH5
#Declare parameters for cylinder
R5 = float(input("Enter the radius of the cylinder"))
CH5= float(input("Enter the height of the cylinder"))
#Calculate volume of the cylinder
CV5 = R5**2 * math.pi * CH5
SSV5 = math.pi * (4/3) * R5**3
#Add Cylinder & Semi-sphere
FV5 = CV5 + SSV5
#Calculate Waste
W5 = RPV5 - FV5

#TOTALWASTE
TW = W1 + W2 + W3 + W4 + W5

print("The waste for the thumb is: {0:.3}".format(W1))
print("The waste for the index is: {0:.3}".format(W2))
print("The waste for the middle is: {0:.3}".format(W3))
print("The waste for the ring is: {0:.3}".format(W4))
print("The waste for the pinky is: {0:.3}".format(W5))
print("The total waste for all the fingers is: {0:.3}".format(TW))

Making the Truncated Cuts

IMG_6789.jpeg

This is where you begin to make cuts on the finger on a 45 degree angle, refer to the diagram of the finger below to see how to make these cuts. Once you've made these cuts you should measure the height 1, height 2, and radius of each separate section of the finger.

Truncate Finger Section Code

This component of the project requires you to find the volume of each section of the finger, and then add them up and create the volume of the whole finger. To begin you need to start with the first section, at the bottom which consists of 1 truncated cylinder. The second section, the middle, has two truncated cylinders. These cylinders are 1 cylinder in real life. The code separates them to provide an accurate volume measurement as the cut is in a rounded trapezoid like shape when viewed in a 2 dimensional perspective. Finally, the final section, the top of the finger, consists of a truncated cylinder and a semi-sphere. You then run a print command to display all the values.

You again need to make sure to include the value of pi using "import math" at the very top of your code


Here is an example of my sections volume code that calculates the volumes for all 5 fingers.

import math
#REFERENCE
#The code that has F# (1,2,3,4,5) Indicate the fingers (These are placed before every variable that concerns that finger)


print("THUMB")
#Section 1 
#Input the Heights for Section 1 
F1S1H1 = float(input("Enter Height 1 Section 1"))
F1S1H2 = float(input("Enter Height 2 Section 1"))
#Input the Radius for Section 1 
F1S1R = float(input("Enter Radius Section 1"))


#Section 1 Volume calculation
F1S1V = F1S1R**2 * math.pi * (F1S1H1 + F1S1H2)/2


#Section 2
#Input the Heights for Section 2
F1S2H1 = float(input("Enter Height 1 Section 2"))
F1S2H2 = float(input("Enter Height 2 Section 2"))
#Input the Radius for Section 3
F1S2R = float(input("Enter Radius Section 2"))


#Section 2 Volume calculation + Semi-sphere
F1S2CV = F1S2R**2 * math.pi * (F1S2H1 + F1S2H2)/2
F1S2SSV = math.pi * (4/3) * F1S2R**3 /2
#Section 2 Total Volume calculation
F1TS2V = F1S2CV + F1S2SSV


#Total Finger Volume
F1TFV = F1S1V + F1TS2V + F1TS2V


print("INDEX")
#Section 1 
#Input the Heights for Section 1 
F2S1H1 = float(input("Enter Height 1 Section 1"))
F2S1H2 = float(input("Enter Height 2 Section 1"))
#Input the Radius for Section 1 
F2S1R = float(input("Enter Radius Section 1"))


#Section 1 Volume calculation
F2S1V = F2S1R**2 * math.pi * (F2S1H1 + F2S1H2)/2


#Section 2 
#Input the Heights for Section 2 (middle)
F2S2C1H1 = float(input("Enter Height 1 for Cylinder 1 Section 2"))
F2S2C1H2 = float(input("Enter Height 2 for Cylinder 1 Section 2"))
F2S2C2H1 = float(input("Enter Height 1 for Cylinder 2 Section 2"))
F2S2C2H2 = float(input("Enter Height 2 for Cylinder 2 Section 2"))
#Input the Radius for Section 2
F2S2R = float(input("Enter Radius Section 2"))


#Section 2 (Cylinder 1) Volume calculation
F2S2C1V = F2S2R**2 * math.pi * (F2S2C1H1 + F2S2C1H2)/2
#Section 2 (Cylinder 2) Volume Calculation
F2S2C2V = F2S2R**2 * math.pi * (F2S2C2H1 + F2S2C2H2)/2
#Section 2 Total Volume Calculation 
F2TS2V = F2S2C1V + F2S2C2V


#Section 3
#Input the Heights for Section 3
F2S3H1 = float(input("Enter Height 1 Section 3"))
F2S3H2 = float(input("Enter Height 2 Section 3"))
#Input the Radius for Section 3
F2S3R = float(input("Enter Radius Section 3"))


#Section 3 Volume calculation + Semi-sphere
F2S3CV = F2S3R**2 * math.pi * (F2S3H1 + F2S3H2)/2
F2S3SSV = math.pi * (4/3) * F2S3R**3 /2
#Section 3 Total Volume calculation
F2TS3V = F2S3CV + F2S3SSV


#Total Finger Volume
F2TFV = F2S1V + F2TS2V + F2TS3V


print("MIDDLE")
#Section 1 
#Input the Heights for Section 1 
F3S1H1 = float(input("Enter Height 1 Section 1"))
F3S1H2 = float(input("Enter Height 2 Section 1"))
#Input the Radius for Section 1 
F3S1R = float(input("Enter Radius Section 1"))


#Section 1 Volume calculation
F3S1V = F3S1R**2 * math.pi * (F3S1H1 + F3S1H2)/2


#Section 2 
#Input the Heights for Section 2 (middle)
F3S2C1H1 = float(input("Enter Height 1 for Cylinder 1 Section 2"))
F3S2C1H2 = float(input("Enter Height 2 for Cylinder 1 Section 2"))
F3S2C2H1 = float(input("Enter Height 1 for Cylinder 2 Section 2"))
F3S2C2H2 = float(input("Enter Height 2 for Cylinder 2 Section 2"))
#Input the Radius for Section 2
F3S2R = float(input("Enter Radius Section 2"))


#Section 2 (Cylinder 1) Volume calculation
F3S2C1V = F3S2R**2 * math.pi * (F3S2C1H1 + F3S2C1H2)/2
#Section 2 (Cylinder 2) Volume Calculation
F3S2C2V = F3S2R**2 * math.pi * (F3S2C2H1 + F3S2C2H2)/2
#Section 2 Total Volume Calculation 
F3TS2V = F3S2C1V + F3S2C2V


#Section 3
#Input the Heights for Section 3
F3S3H1 = float(input("Enter Height 1 Section 3"))
F3S3H2 = float(input("Enter Height 2 Section 3"))
#Input the Radius for Section 3
F3S3R = float(input("Enter Radius Section 3"))


#Section 3 Volume calculation + Semi-sphere
F3S3CV = F3S3R**2 * math.pi * (F3S3H1 + F3S3H2)/2
F3S3SSV = math.pi * (4/3) * F3S3R**3 /2
#Section 3 Total Volume calculation
F3TS3V = F3S3CV + F3S3SSV


#Total Finger Volume
F3TFV = F3S1V + F3TS2V + F3TS3V


print("Ring")
#Section 1 
#Input the Heights for Section 1 
F4S1H1 = float(input("Enter Height 1 Section 1"))
F4S1H2 = float(input("Enter Height 2 Section 1"))
#Input the Radius for Section 1 
F4S1R = float(input("Enter Radius Section 1"))


#Section 1 Volume calculation
F4S1V = F4S1R**2 * math.pi * (F4S1H1 + F4S1H2)/2


#Section 2 
#Input the Heights for Section 2 (middle)
F4S2C1H1 = float(input("Enter Height 1 for Cylinder 1 Section 2"))
F4S2C1H2 = float(input("Enter Height 2 for Cylinder 1 Section 2"))
F4S2C2H1 = float(input("Enter Height 1 for Cylinder 2 Section 2"))
F4S2C2H2 = float(input("Enter Height 2 for Cylinder 2 Section 2"))
#Input the Radius for Section 2
F4S2R = float(input("Enter Radius Section 2"))


#Section 2 (Cylinder 1) Volume calculation
F4S2C1V = F4S2R**2 * math.pi * (F4S2C1H1 + F4S2C1H2)/2
#Section 2 (Cylinder 2) Volume Calculation
F4S2C2V = F4S2R**2 * math.pi * (F4S2C2H1 + F4S2C2H2)/2
#Section 2 Total Volume Calculation 
F4TS2V = F4S2C1V + F4S2C2V


#Section 3
#Input the Heights for Section 3
F4S3H1 = float(input("Enter Height 1 Section 3"))
F4S3H2 = float(input("Enter Height 2 Section 3"))
#Input the Radius for Section 3
F4S3R = float(input("Enter Radius Section 3"))


#Section 3 Volume calculation + Semi-sphere
F4S3CV = F4S3R**2 * math.pi * (F4S3H1 + F4S3H2)/2
F4S3SSV = math.pi * (4/3) * F4S3R**3 /2
#Section 3 Total Volume calculation
F4TS3V = F4S3CV + F4S3SSV


#Total Finger Volume
F4TFV = F4S1V + F4TS2V + F4TS3V


print("PINKY")
#Section 1 
#Input the Heights for Section 1 
F5S1H1 = float(input("Enter Height 1 Section 1"))
F5S1H2 = float(input("Enter Height 2 Section 1"))
#Input the Radius for Section 1 
F5S1R = float(input("Enter Radius Section 1"))


#Section 1 Volume calculation
F5S1V = F5S1R**2 * math.pi * (F5S1H1 + F5S1H2)/2


#Section 2 
#Input the Heights for Section 2 (middle)
F5S2C1H1 = float(input("Enter Height 1 for Cylinder 1 Section 2"))
F5S2C1H2 = float(input("Enter Height 2 for Cylinder 1 Section 2"))
F5S2C2H1 = float(input("Enter Height 1 for Cylinder 2 Section 2"))
F5S2C2H2 = float(input("Enter Height 2 for Cylinder 2 Section 2"))
#Input the Radius for Section 2
F5S2R = float(input("Enter Radius Section 2"))


#Section 2 (Cylinder 1) Volume calculation
F5S2C1V = F5S2R**2 * math.pi * (F5S2C1H1 + F5S2C1H2)/2
#Section 2 (Cylinder 2) Volume Calculation
F5S2C2V = F5S2R**2 * math.pi * (F5S2C2H1 + F5S2C2H2)/2
#Section 2 Total Volume Calculation 
F5TS2V = F5S2C1V + F5S2C2V


#Section 3
#Input the Heights for Section 3
F5S3H1 = float(input("Enter Height 1 Section 3"))
F5S3H2 = float(input("Enter Height 2 Section 3"))
#Input the Radius for Section 3
F5S3R = float(input("Enter Radius Section 3"))


#Section 3 Volume calculation + Semi-sphere
F5S3CV = F5S3R**2 * math.pi * (F5S3H1 + F5S3H2)/2
F5S3SSV = math.pi * (4/3) * F5S3R**3 /2
#Section 3 Total Volume calculation
F5TS3V = F5S3CV + F5S3SSV


#Total Finger Volume
F5TFV = F5S1V + F5TS2V + F5TS3V


#Total Volume of all FINGERS (TFCV = Total Fingers combined volume)
TFCV = F1TFV + F2TFV + F3TFV + F4TFV + F5TFV


#print values ALL 5 FINGERS IN ORDER


#FINGER 1 Values
print("Thumb Finger Values")


print("Volume of Section 1 is: {0:.3f}".format(F1S1V))
print("Volume of Section 2 Cylinder is: {0:.3f}".format(F1S2CV))
print("Volume of Section 2 Semi Sphere is: {0:.3f}".format(F1S2SSV))
print("Total Volume of Section 2 is: {0:.3f}".format(F1TS2V))
print("Total Volume of the finger is: {0:.3f}".format(F1TFV))


#FINGER 2 Values
print("Index Finger Values")


print("Volume of Section 1 is: {0:.3f}".format(F2S1V))
print("Volume of Cylinder 1 Section 2 is: {0:.3f}".format(F2S2C1V))
print("Volume of Cylinder 2 Section 2 is: {0:.3f}".format(F2S2C2V))
print("Total Volume of Section 2 is: {0:.3f}".format(F2TS2V))
print("Volume of Section 3 Cylinder is: {0:.3f}".format(F2S3CV))
print("Volume of Section 3 Semi Sphere is: {0:.3f}".format(F2S3SSV))
print("Total Volume of Section 3 is: {0:.3f}".format(F2TS3V))
print("Total Volume of the finger is: {0:.3f}".format(F2TFV))


#FINGER 3 Values
print("Middle Finger Values")


print("Volume of Section 1 is: {0:.3f}".format(F3S1V))
print("Volume of Cylinder 1 Section 2 is: {0:.3f}".format(F3S2C1V))
print("Volume of Cylinder 2 Section 2 is: {0:.3f}".format(F3S2C2V))
print("Total Volume of Section 2 is: {0:.3f}".format(F3TS2V))
print("Volume of Section 3 Cylinder is: {0:.3f}".format(F3S3CV))
print("Volume of Section 3 Semi Sphere is: {0:.3f}".format(F3S3SSV))
print("Total Volume of Section 3 is: {0:.3f}".format(F3TS3V))
print("Total Volume of the finger is: {0:.3f}".format(F3TFV))


#FINGER 4 Values
print("Ring Finger Values")


print("Volume of Section 1 is: {0:.3f}".format(F4S1V))
print("Volume of Cylinder 1 Section 2 is: {0:.3f}".format(F4S2C1V))
print("Volume of Cylinder 2 Section 2 is: {0:.3f}".format(F4S2C2V))
print("Total Volume of Section 2 is: {0:.3f}".format(F4TS2V))
print("Volume of Section 3 Cylinder is: {0:.3f}".format(F4S3CV))
print("Volume of Section 3 Semi Sphere is: {0:.3f}".format(F4S3SSV))
print("Total Volume of Section 3 is: {0:.3f}".format(F4TS3V))
print("Total Volume of the finger is: {0:.3f}".format(F4TFV))


#FINGER 5 Values
print("Pinky Finger Values")


print("Volume of Section 1 is: {0:.3f}".format(F5S1V))
print("Volume of Cylinder 1 Section 2 is: {0:.3f}".format(F5S2C1V))
print("Volume of Cylinder 2 Section 2 is: {0:.3f}".format(F5S2C2V))
print("Total Volume of Section 2 is: {0:.3f}".format(F5TS2V))
print("Volume of Section 3 Cylinder is: {0:.3f}".format(F5S3CV))
print("Volume of Section 3 Semi Sphere is: {0:.3f}".format(F5S3SSV))
print("Total Volume of Section 3 is: {0:.3f}".format(F5TS3V))
print("Total Volume of the finger is: {0:.3f}".format(F5TFV))


print("Total Volume of all fingers is: {0:.3f}".format(TFCV))
 

Sewing the Fishing Line

IMG_3064 - Copy.png

To start sewing you must first begin to get a needle, and then put the fishing line through the needle. Before sewing, make sure to measure out your fishing line so that it is long enough to reach the servo later on. You then stick the needle through the middle of each section of the finger until you reach the top. You then cut the fishing line off and then hot glue the top finger segment so the fishing line is not loose and does not pull out of the finger. Finally, stick a few paper clips in a line for each finger. You then must grab the fishing line and stick it through the paperclips that have been inserted in the hand. This is to keep the fishing line with the correct finger that it is controlling. You should also hot glue each finger to the hand so that it does not shake everywhere. You can see this in the image below.

Attaching Elastics

IMG_6788.jpeg

This is the simplest part of the project. It is recommended you have a partner with you in this component. You or your partner begin to slightly pull the elastic (to create tension). The other individual should carefully apply hot glue onto the back of the fingers, while they are perfectly aligned. The individual with the elastic may now place the elastic onto the hot glue, while the other hold the finger to make sure it does not misalign. It is recommended that you hold the elastic on the hot glue for a few seconds, to hold the tension.

Servo Code

Now that everything on the hand has been attached you can begin with the servo coding. You begin with first including the servo library on the first line of the code. Afterwards you can begin to then create a servo, by giving it a name such as "Thumb", the code for this would look like: Servo Thumb. You can then continue to the setup, where you attach the servos to a signal pin in the Arduino. You finally set variables using "voids" like: void pinch(). In each of the variables you set, include the targeted servos that you are moving and the amount of rotation you want in them. At minimum have two variables, pinch and reset. Pinch is the action of the pointer and thumb, while the reset simply resets the rotation of the fingers. These variables are then put into the main loop to run the code and cause rotation of the servos, make sure to add delays in between the reset command and actions, as the actions will become incredibly fast, and possibly cause the servo to stop functioning.

My example of this code is shown below, this provides more detail to my instructions.

Declaring the servos for the specific fingers are outside the code, plugging the servos into the assigned pin is in the setup, and finally all the rotation variables into the loop.

#include <Servo.h> //include the servo library


Servo thumb; //create a servo for the thumb
Servo pointer; //create a servo for the pointer finger


void setup()
{
  thumb.attach(9); //plugged into pin 9
  pointer.attach(8);//plugged into pin 8
}


void loop()
{
  resetFinger();
  delay(1000);
  pinch();
  delay(1000);
}


void pinch()
{
 thumb.write(0); 
 pointer.write(45);
}


void resetFinger()
{
  thumb.write(0); 
  pointer.write(0);
}

Arduino and Servo Attachment

IMG_3064.png

Finally, you can attach the servos and Arduino to the hand. To begin, you must upload your code to the Arduino. After uploading your code, wire up the servos to the correct pins and test it to make sure that it functions correctly. After you have tested the code, you can finally hot glue your servos to the very ends of your hand and the Arduino to the back, you can then tie the fishing line into one of the holes of the servo rotor, you can cut the fishing line accordingly to make sure that the servos rotation provides enough tension to bend the finger. Finally make sure all of your wires are connected, and test your hand. The fingers should bend when the servos rotate, and should spring back up when the servos rotation resets.