Robotic Hand

by afeta4835 in Circuits > Arduino

44 Views, 0 Favorites, 0 Comments

Robotic Hand

processed-BA0D8222-FC92-4B2D-8692-279AE47D5CD4.jpeg

I was given a task within my grade 9 STEM math and tech class, the task was creating a robotic hand which could do various movements such as giving a thumbs up. In this project we had to utilize various materials in creating the actual hand, afterwards we had to create different codes for the robotic hand.

Supplies

thumbnail_IMG_9111.jpg

Styrofoam

Glue Gun

Rubber bands

Sharpie

Sanding Block

Pliers

Fishing line

Paper Clips

Knife

Sample of how to make finger

Skewer

Assign Group Members Into Jobs

When my group and I first received the assignment the first thing I did was assign people jobs and I ended up taking the coding job along with another group member, Ethan Young, Ethan and I did two separate codes. Afterwards, I assigned Abhinav, Kayaan, and Zane, building jobs. The person who we voted to keep our materials and be group leader was Ethan Young.

Measurements and Cutting Parts

When we first acquired our materials we got to work getting our measurements with a ruler. Firstly, we measured out the entire Styrofoam hand and afterwards we began cutting out the hand. The way we cut out the hand involved us in getting our hand model and putting his hand onto the foam, after his hand was secured we began tracing his hand with a pencil and began to cut it out while following the pencil markings. Secondly, we began to sand the fingers so we can get the exact measurements and those came out to

Thumb – 2.6/6cm

Index – 3/8cm

Middle – 2.4/8.5cm

Ring – 2.4/8.5cm

Pinky – 2.1/6.5cm


In summary

  • Acquire materials
  • Measure entire Styrofoam
  • Trace hand onto Styrofoam
  • Cut out Styrofoam while following tracing
  • sand fingers
  • Get exact measurements

Mathematics Code

When we learned that we had to code for the hand me and my partner began working on it together, the code presented some challenges due to us having to put a truncated cylinder inside the code. Afterwards, we had our finished code:



import math

Lrp = float(input("enter Length of Rectangular Prism: "))

Hrp = float(input("enter Height of Rectangular Prism: "))

Wrp = float(input("enter the Width of Rectangular Prism: "))

R = float(input("enter the Radius of the Truncated cylinder: "))

S1H1 = float(input("enter the first height of the first truncated cylinder: "))

S1H2 = float(input("enter the second height of the first truncated cylinder: "))

S2H1 = float(input("enter the first height of the second truncated cylinder: "))

S2H2 = float(input("enter the second height of the second truncated cylinder: "))

S3H1 = float(input("enter the first height of the third truncated cylinder: "))

S3H2 = float(input("enter the second height of the third truncated cylinder: "))

Rh = float(input("enter the radius of the hemisphere: "))

Vrp = Lrp * Hrp * Wrp

Vh = (math.pi * (4/3) * Rh**3)/2

Vs1 = R**2 * math.pi * (S1H1 + S1H2)/2

Vs2 = R**2 * math.pi * (S2H1 + S2H2)/2

Vs3 = R**2 * math.pi * (S3H1 + S3H2)/2

TV = Vs1 + Vs2 + Vs3 + Vh

Vwm = Vrp - TV

VC = math.pi * R**2 * Hrp

HS = (math.pi * (4/3) * Rh**3) /2

CwH = VC + HS

print("volume of Rectangular Prism is %.2f"%Vrp)

print("volume of Hemisphere is %.2f"%Vh)

print("volume of section 1 truncated cylinder is %.2f"%Vs1)

print("volume of section 2 truncated cylinder is %.2f"%Vs2)

print("volume of section 3 truncated cylinder is %.2f"%Vs3)

print("Total volume of truncated cylinders and hemisphere is %.2f"%TV)

print("volume of wasted material is %.2f"%Vwm)

print("volume of cylinder is %.2f"%VC)

print("volume of cylinder with hemisphere is%.2f"%CwH)


At the beginning of this code we have to import the math library to get the code to recognize pi.

Secondly, we had to get the float function to identify the numbers we needed

After we had all our floats completed we began to work on the actual equations which included of multiple multiplication(*), adding(+), and dividing(/) we got the equations to work and calculate what we wanted by saying something = (insert equation) for example "Vrp = Lrp * Hrp * Wrp," Vrp stands for Volume of rectangular prism so in this we are saying to get the volume of the rectangular prism it is equal to the Length of the rectangular prism times or * the height of the rectangular prism times the Width of the rectangular prism


At the end we added our print function which would tell us our answers and at the end where it says for example "%.2f"%" this is telling the code that we need to get our number to the next two decimal places


In summary

  • Import math
  • Define variables
  • Create equations
  • Add Print function

Tech Code

When me and my partner got news that we had to create a separate code in our technology class we created it within Tinkercad.com and this is the completed code:


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


Servo thumb; //create a servo for the thumb

Servo index; //create a servo for the index

Servo middle; //create a servo for the Middle

Servo ring; //create a servo for the Ring

Servo pinky; //create a servo for the Pinky




void setup()

{

 thumb.attach(3); //plugged into pin 3

 index.attach(5); //plugged into pin 5

 middle.attach(9); //plugged into pin 9

 ring.attach(10); //plugged into pin 10

 pinky.attach(11); //plugged into pin 11

 

}


void loop()

{

}






void Peace()

{

 thumb.write(180); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(0); //turn servo to 180º

 ring.write(180);//turn servo to 180º

 pinky.write(180); //turn servo to 0º

 

}






void shaka()

{

 thumb.write(0); //turn servo to 0º

 index.write(180);//turn servo to 0º

 middle.write(180); //turn servo to 180º

 ring.write(180);//turn servo to 180º

 pinky.write(0); //turn servo to 0º

}




void rocknroll()

{

 thumb.write(0); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(180); //turn servo to 180º

 ring.write(180);//turn servo to 180º

 pinky.write(0); //turn servo to 0º

}



void Fingergun()

{

 thumb.write(0); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(180); //turn servo to 180º

 ring.write(180);//turn servo to 180º

 pinky.write(180); //turn servo to 180


}



void one()

{


 thumb.write(180); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(180); //turn servo to 180º

 ring.write(180);//turn servo to 180º

 pinky.write(180); //turn servo to 0º


}


void two()

{

 thumb.write(180); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(0); //turn servo to 180º

 ring.write(180);//turn servo to 180º

 pinky.write(180); //turn servo to 0º


}



void three()

{

 thumb.write(180); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(0); //turn servo to 180º

 ring.write(0);//turn servo to 180º

 pinky.write(180); //turn servo to 0º


}




void four()

{

 thumb.write(180); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(0); //turn servo to 180º

 ring.write(0);//turn servo to 180º

 pinky.write(0); //turn servo to 0º


}



void five()

{

 thumb.write(0); //turn servo to 0º

 index.write(0);//turn servo to 0º

 middle.write(0); //turn servo to 180º

 ring.write(0);//turn servo to 180º

 pinky.write(0); //turn servo to 0º

 

}




void reset()

{

 thumb.write(180); //turn servo to 180

 delay(1000); // wait one second

 thumb.write(0); //turn servo to 0

 delay(1000);//wait one second

 index.write(180); //turn servo to 180

 delay(1000); // wait one second

 index.write(0); //turn servo to 0

 delay(1000);//wait one second

 middle.write(180); //turn servo to 180

 delay(1000); // wait one second

 middle.write(0); //turn servo to 0

 delay(1000);//wait one second

 ring.write(180); //turn servo to 180

 delay(1000); // wait one second

 ring.write(0); //turn servo to 0

 delay(1000);//wait one second

 pinky.write(180); //turn servo to 180

 delay(1000); // wait one second

 pinky.write(0); //turn servo to 0

 delay(1000);//wait one second

  

}

  


void pinch()

{

  thumb.write(0); //turn servo to 0º

 index.write(180);//turn servo to 0º

 middle.write(0); //turn servo to 180º

 ring.write(0);//turn servo to 180º

 pinky.write(0); //turn servo to 0º

}




This code makes us include the servo library which in turn allows Arduino to access and control the servo motors. The next line of code is us identifying the separate fingers which allows for us to actually turn the fingers. The thing we did afterwards is void setup this makes it to where we can tell the Arduino what pin each of the fingers will be connected to and the reason we did .attach is because we needed Arduino to attach the servo to a pin. Afterwards, we began creating the entire code using .write which makes data responding to a request and then we did (180) to turn the servos to 180 degrees with 0 being not folded or resting and 180 meaning fully closed. In this code we experienced one problem and that was that we needed a loop as without we would experience errors.


In summary

  • Add servo library
  • Identify separate fingers
  • add void setup
  • add void loop
  • create names and angles


Elastics and Strings

processed-919CA01A-18AA-4ED5-9991-8D379554F41E.jpeg

In this step the elastics and fishing wire come into play and the reasoning why is because with the fishing wire we would make holes within the fingers and put staples onto the hand so when we pull on the wire the fingers would either go up or down. The reasoning for the elastics is because you need to attach elastics between the joints on your fingers and palm to allow the fingers to bend and the way you would attach the elastics would be via a hot glue gun and the reasoning for this device is because we need to ensure that the elastics are able to hold onto the hand and fingers, so once we got our hot glue gun we plugged it in and waited for the glue to heat up while waiting we began to cut our elastics so they we short and a line so we could attach between the fingers, once the glue gun finally was hot enough we glued the elastics onto the Styrofoam hand.


In summary

  • Create holes within joints
  • Put fishing wire into joints and interlink them
  • add staples onto hand
  • put fishing wire within the finger into the staples
  • Get elastics
  • cut elastics into short thin strands
  • Get hot glue gun heated
  • Glue elastics onto the joints

Adding Servos and Arduino Onto Hand

processed-BF90C10F-C1BF-4463-86BC-13B7F3DD3D0F.jpeg

On this step you need your

  • Servos
  • Hand
  • Styrofoam
  • Glue Gun
  • Utility Knife
  • Arduino


Firstly get your utility knife and make two square cutouts into the hands forearm for your servos to fit inside once you create the cutouts of the Styrofoam ensure that the servo can fit in comfortably and then hot glue the bottom of the cut out area and then stick the servo in and repeat this onto the other cut out area, once finished make sure the servo doesn't move around or is too stiff. Secondly get your glue gun ready once again and on the bottom of the forearm put on the glue and then put and extra cutout of Styrofoam onto the and line it up with the hot glue and attach it after that attach your Arduino onto the cutout and put all your wires into your pins.


In summary

  • Make 2 square cutouts big enough for servos
  • Hot glue the bottom of the cutout
  • Put in servos on top of hot glue
  • Hot glue front of hand
  • Attach extra Styrofoam onto glued area
  • Attach Arduino onto your extra Styrofoam
  • Connect Wires

Double Check and Test

This is the last step and the most critical one in this step with your completed hand double check that everything is connected properly and cutout properly if not reflect on previous steps afterwards connect Arduino and run code to the Arduino and try your codes movement if this doesn't work check for anything that could be missing or disrupting your code if everything works correctly you have just completed creating a robotic hand