Introduction: Arduino Wireless Animatronic Hand

About: Hi, my name is Stephane. I am 14 years old and I love making things. Currently I am interested in robotics and programming in Java and Swift.
This is a fun but challenging project. Its is a wireless robotic hand that imitates your hands movement. This project mainly relies on 2 arduinos and 2 xbees.

Step 1: Making the Hand

Materials:
1 arduino
1 sparkfun xbee sheild
1 xbee
5 servos
wire tubing
string or fishing line

1. Cut the wire tubing into five pieces (about the size of each of your fingers)
2. Cut out small circles for the joints.
3. Put a piece of string through each tubing and tape it to the top of the finger.
4. Tape all the fingers together.

Step 2: Wiring the Hand

1. Put the xbee shield on the arduino so that all the pins match up.
2. Then put the xbee on the shield where the outline is. Make sure the xbee is facing the right direction otherwise it could be damaged.
3. Attach the yellow wires from each of the five servos the the digital pins on the arduino.
4. Attach the positive ends of each servo to a five volt battery.
5. Attach black wires from the five servos onto a breadboard in a horizontal line. 
6. Then run a jumper from the negative pin on the xbee shield to the breadboard, and a jumper from the breadboard to the five volt battery.
7. You are done with the robotic hand!

Step 3: Making the Glove

Materials:
5 flex sensors
1 arduino
1 Sparkfun xbee sheild
1 xbee
Ferric chloride
Copper Clad board
5 22k resistors
Glove

Steps:

1. Draw the flex sensor circuit five times on a copper clad board using a sharpie.
Link to circuit: https://www.google.com/search?q=flex+sensor+to+arduino&num=100&newwindow=1&safe=off&espv=2&es_sm=119&tbm=isch&tbo=u&source=univ&sa=X&ei=0VQmU6HOCNCMkgXgkoHQBw&ved=0CCcQsAQ&biw=981&bih=556#facrc=_&imgdii=_&imgrc=pUIcBqmAtUKkhM%253A%3BH6p2mD0Wptbz8M%3Bhttp%253A%252F%252Fwww.sundh.com%252Fblog%252Fwp-content%252Fuploads%252F2011%252F05%252Fflex_sensor1.png%3Bhttp%253A%252F%252Fwww.sundh.com%252Fblog%252F2011%252F05%252Fgetting-values-from-a-flex-sensor%252F%3B680%3B252
2.  Put the copper clad board into a plastic container and pour ferric chloride on it.
3. After about 25 minutes pull the board out and wash it with acetone.
4. Drill holes in the board where the resistor and wires are supposed to go.
5. Solder everything in.

Step 4: Wiring the Glove

1. Attach the xbee sheild on the arduino and the xbee on the xbee sheild.
2. Attach the yellow wires from the circuit board to the Analogue pins on the arduino.
3. Attach the positive and negative wires that are on the same side as the yellow wires to a five volt battery.
4. Solder the positive and negative wires on the opposite side to each flex sensor.
5. Put the flex sensors on each finger of the glove.
6. You are finished!

Step 5: The Code

The code for the Wireless animatronic hand:


Sending Xbee Glove:


int Finger1 = 0;
int Finger2 = 1;
int Finger3 = 2;
int Finger4 = 3;
int Finger5 = 4;

void setup()
{
   Serial.begin(9600);
}

void loop()
{
   byte servoValue1;
   byte servoValue2;
   byte servoValue3;
   byte servoValue4;
   byte servoValue5;
  
   int FingerV1 = analogRead(Finger1);
   int FingerV2 = analogRead(Finger2);
   int FingerV3 = analogRead(Finger3);
   int FingerV4 = analogRead(Finger4);
   int FingerV5 = analogRead(Finger5);
  
   if (FingerV1 < 200) FingerV1 = 200;
   else if (FingerV1 > 460) FingerV1 = 460;
   if (FingerV2 < 200) FingerV2 = 200;
   else if (FingerV2 > 460) FingerV2 = 460;
   if (FingerV3 < 200) FingerV3 = 200;
   else if (FingerV3 > 460) FingerV3 = 460;
   if (FingerV4 < 200) FingerV4 = 200;
   else if (FingerV4 > 460) FingerV4 = 460;
   if (FingerV5 < 200) FingerV5 = 200;
   else if (FingerV5 > 460) FingerV5 = 460;
 
   byte servoVal1 = map(FingerV1,460, 200, 255, 0);
   byte servoVal2 = map(FingerV2,460, 200, 255, 0);
   byte servoVal3 = map(FingerV3,460, 200, 255, 0);
   byte servoVal4 = map(FingerV4,460, 200, 255, 0);
   byte servoVal5 = map(FingerV5,460, 200, 255, 0);

   Serial.print(servoVal1);
   Serial.print(servoVal2);
   Serial.print(servoVal3);
   Serial.print(servoVal4);
   Serial.print(servoVal5);

  
   delay(100);
}

//Joint angle to internal value back to joint angle





Receiving xbee Hand:


#include <Servo.h>

Servo myservo1;  // create servo object to control a servo
Servo myservo2;
Servo myservo3;
Servo myservo4;
Servo myservo5;

void setup()
{
   Serial.begin(9600);
  
   myservo1.attach(2);  // attaches the servo on pin 9 to the servo object
   myservo2.attach(3);
   myservo3.attach(4);
   myservo4.attach(5);
   myservo5.attach(6);
}

void loop()
{
   if(Serial.available() >=5)
   {
    byte servoAng1 = Serial.read();
    byte servoAng2 = Serial.read();
    byte servoAng3 = Serial.read();
    byte servoAng4 = Serial.read();
    byte servoAng5 = Serial.read();


    // Send the servo to the position read... <-- you get to make this happen
    myservo1.write(servoAng1);
    myservo2.write(servoAng2);
    myservo3.write(servoAng3);
    myservo4.write(servoAng4);
    myservo5.write(servoAng5);
   }
}