Components and supplies
XBee shield
XBee S1 (trace antenna)
Robot Shield
47 kOhm resistor
5V servomotor
AAA battery
3xAAA battery holder
LilyPad FTDI Basic Breakout - 5V
Arduino LilyPad Main Board
Xbee Shield for Lilypad
Flex Sensor 2.2"
9V battery (NiMh rechargeable)
Arduino UNO
Tools and machines
Mini drill (generic)
Drill (generic)
Angle grinder (generic)
Welding machine (generic)
Soldering iron (generic)
Apps and platforms
Arduino IDE
Project description
Code
untitled
arduino
1/* 2Flex Glove 3 4Created by Santin Gabriele, 2014 5I.T.S.T. "J. F. Kennedy", cl. 5^A EA 6Thanks to Elias De Lamper for suggestions to improve this program! 7*/ 8 9int ResThumb = A4; // Variables of the analog read form the flex sensors connected to the analog pins of Arduino LilyPad 10int ResIndex = A3; 11int ResMiddle = A2; 12int ResAnnular = A1; 13int ResPinky = A0; 14 15int OpenedThumb =0; // Variables of the values when the hand is completely opened 16int OpenedIndex =0; // This is needed for a continuous calibration 17int OpenedMiddle =0; 18int OpenedAnnular =0; 19int OpenedPinky =0; 20 21int ClosedThumb; // Variables of the values when the hand is completely closed 22int ClosedIndex; // We can't set it to zero since that the minimum value reached 23int ClosedMiddle; // in the analog read never reach zero. We'll assign the value of 24int ClosedAnnular; // a first analog read, then the program in the loop will 25int ClosedPinky; // automatically assing lower values 26 27int thumb =0; // Variables of the values to send 28int index =0; 29int middle =0; 30int annular =0; 31int pinky =0; 32 33 34void setup() 35{ 36 Serial.begin(9600); // Activating serial communication, XBee Series 1 are pre-programmed at 9600 baud/s 37 38 pinMode(ResThumb, INPUT); // The variables of the sensor are set as input 39 pinMode(ResIndex, INPUT); 40 pinMode(ResMiddle, INPUT); 41 pinMode(ResAnnular, INPUT); 42 pinMode(ResPinky, INPUT); 43 44 ClosedThumb = analogRead(ResThumb); 45 ClosedIndex = analogRead(ResIndex); 46 ClosedMiddle = analogRead(ResMiddle); 47 ClosedAnnular = analogRead(ResAnnular); 48 ClosedPinky = analogRead(ResPinky); 49} 50 51void loop() 52{ 53 thumb = analogRead(ResThumb); 54 index = analogRead(ResIndex); 55 middle = analogRead(ResMiddle); 56 annular = analogRead(ResAnnular); 57 pinky = analogRead(ResPinky); 58 59 if(thumb > OpenedThumb) // Calibration reading and setting the maximum values. This needs you to completely open your hand a few times 60 OpenedThumb = thumb; 61 if(index > OpenedIndex) 62 OpenedIndex = index; 63 if(middle > OpenedMiddle) 64 OpenedMiddle = middle; 65 if(annular > OpenedAnnular) 66 OpenedAnnular = annular; 67 if(pinky > OpenedPinky) 68 OpenedPinky = pinky; 69 70 if(thumb < ClosedThumb) // Calibration reading and setting the minimum values. This needs you to completely close your hand a few times 71 ClosedThumb = thumb; 72 if(index < ClosedIndex) 73 ClosedIndex = index; 74 if(middle < ClosedMiddle) 75 ClosedMiddle = middle; 76 if(annular < ClosedAnnular) 77 ClosedAnnular = annular; 78 if(pinky < ClosedPinky) 79 ClosedPinky = pinky; 80 81 thumb = map(thumb ,ClosedThumb ,OpenedThumb ,0,180); // The analog read has to be readapted in values between 0 and 180 to be used by the servomotors. 82 index = map(index ,ClosedIndex ,OpenedIndex ,0,180); // The minimum and maximum values from the calibrations are used to correctly set the analog reads. 83 middle = map(middle ,ClosedMiddle ,OpenedMiddle ,0,180); 84 annular = map(annular,ClosedAnnular,OpenedAnnular,0,180); 85 pinky = map(pinky ,ClosedPinky ,OpenedPinky ,0,180); 86 87 Serial.write("<"); // This character represent the beginning of the package of the five values 88 Serial.write(thumb); // The values are sent via the Tx pin (the digital pin 1) 89 Serial.write(index); 90 Serial.write(middle); 91 Serial.write(annular); 92 Serial.write(pinky); 93 94 delay(30); 95} 96
untitled
arduino
1/* 2Flex Glove 3 4Created by Santin Gabriele, 2014 5I.T.S.T. "J. 6 F. Kennedy", cl. 5^A EA 7Thanks to Elias De Lamper for suggestions to improve 8 this program! 9*/ 10 11int ResThumb = A4; // Variables of the analog read 12 form the flex sensors connected to the analog pins of Arduino LilyPad 13int ResIndex 14 = A3; 15int ResMiddle = A2; 16int ResAnnular = A1; 17int ResPinky = A0; 18 19int 20 OpenedThumb =0; // Variables of the values when the hand is completely opened 21int 22 OpenedIndex =0; // This is needed for a continuous calibration 23int OpenedMiddle 24 =0; 25int OpenedAnnular =0; 26int OpenedPinky =0; 27 28int ClosedThumb; 29 // Variables of the values when the hand is completely closed 30int ClosedIndex; 31 // We can't set it to zero since that the minimum value reached 32int ClosedMiddle; 33 // in the analog read never reach zero. We'll assign the value of 34int ClosedAnnular; 35 // a first analog read, then the program in the loop will 36int ClosedPinky; 37 // automatically assing lower values 38 39int thumb =0; // Variables 40 of the values to send 41int index =0; 42int middle =0; 43int annular =0; 44int 45 pinky =0; 46 47 48void setup() 49{ 50 Serial.begin(9600); // Activating 51 serial communication, XBee Series 1 are pre-programmed at 9600 baud/s 52 53 54 pinMode(ResThumb, INPUT); // The variables of the sensor are set as input 55 56 pinMode(ResIndex, INPUT); 57 pinMode(ResMiddle, INPUT); 58 pinMode(ResAnnular, 59 INPUT); 60 pinMode(ResPinky, INPUT); 61 62 ClosedThumb = analogRead(ResThumb); 63 64 ClosedIndex = analogRead(ResIndex); 65 ClosedMiddle = analogRead(ResMiddle); 66 67 ClosedAnnular = analogRead(ResAnnular); 68 ClosedPinky = analogRead(ResPinky); 69 70} 71 72void loop() 73{ 74 thumb = analogRead(ResThumb); 75 index 76 = analogRead(ResIndex); 77 middle = analogRead(ResMiddle); 78 annular 79 = analogRead(ResAnnular); 80 pinky = analogRead(ResPinky); 81 82 if(thumb 83 > OpenedThumb) // Calibration reading and setting the maximum values. This 84 needs you to completely open your hand a few times 85 OpenedThumb = thumb; 86 87 if(index > OpenedIndex) 88 OpenedIndex = index; 89 if(middle > OpenedMiddle) 90 91 OpenedMiddle = middle; 92 if(annular > OpenedAnnular) 93 OpenedAnnular = 94 annular; 95 if(pinky > OpenedPinky) 96 OpenedPinky = pinky; 97 98 if(thumb 99 < ClosedThumb) // Calibration reading and setting the minimum values. This needs 100 you to completely close your hand a few times 101 ClosedThumb = thumb; 102 if(index 103 < ClosedIndex) 104 ClosedIndex = index; 105 if(middle < ClosedMiddle) 106 107 ClosedMiddle = middle; 108 if(annular < ClosedAnnular) 109 ClosedAnnular = 110 annular; 111 if(pinky < ClosedPinky) 112 ClosedPinky = pinky; 113 114 thumb 115 = map(thumb ,ClosedThumb ,OpenedThumb ,0,180); // The analog read has to 116 be readapted in values between 0 and 180 to be used by the servomotors. 117 index 118 = map(index ,ClosedIndex ,OpenedIndex ,0,180); // The minimum and maximum 119 values from the calibrations are used to correctly set the analog reads. 120 middle 121 = map(middle ,ClosedMiddle ,OpenedMiddle ,0,180); 122 annular = map(annular,ClosedAnnular,OpenedAnnular,0,180); 123 124 pinky = map(pinky ,ClosedPinky ,OpenedPinky ,0,180); 125 126 Serial.write("<"); 127 // This character represent the beginning of the package of the five values 128 129 Serial.write(thumb); // The values are sent via the Tx pin (the digital pin 130 1) 131 Serial.write(index); 132 Serial.write(middle); 133 Serial.write(annular); 134 135 Serial.write(pinky); 136 137 delay(30); 138} 139
untitled
arduino
1/* 2Flex Glove 3 4Created by Santin Gabriele, 2014 5I.T.S.T. "J. F. Kennedy", cl. 5^A EA 6Thanks to Elias De Lamper for suggestions to improve this program! 7*/ 8 9int ResThumb = A4; // Variables of the analog read form the flex sensors connected to the analog pins of Arduino LilyPad 10int ResIndex = A3; 11int ResMiddle = A2; 12int ResAnnular = A1; 13int ResPinky = A0; 14 15int OpenedThumb =0; // Variables of the values when the hand is completely opened 16int OpenedIndex =0; // This is needed for a continuous calibration 17int OpenedMiddle =0; 18int OpenedAnnular =0; 19int OpenedPinky =0; 20 21int ClosedThumb; // Variables of the values when the hand is completely closed 22int ClosedIndex; // We can't set it to zero since that the minimum value reached 23int ClosedMiddle; // in the analog read never reach zero. We'll assign the value of 24int ClosedAnnular; // a first analog read, then the program in the loop will 25int ClosedPinky; // automatically assing lower values 26 27int thumb =0; // Variables of the values to send 28int index =0; 29int middle =0; 30int annular =0; 31int pinky =0; 32 33 34void setup() 35{ 36 Serial.begin(9600); // Activating serial communication, XBee Series 1 are pre-programmed at 9600 baud/s 37 38 pinMode(ResThumb, INPUT); // The variables of the sensor are set as input 39 pinMode(ResIndex, INPUT); 40 pinMode(ResMiddle, INPUT); 41 pinMode(ResAnnular, INPUT); 42 pinMode(ResPinky, INPUT); 43 44 ClosedThumb = analogRead(ResThumb); 45 ClosedIndex = analogRead(ResIndex); 46 ClosedMiddle = analogRead(ResMiddle); 47 ClosedAnnular = analogRead(ResAnnular); 48 ClosedPinky = analogRead(ResPinky); 49} 50 51void loop() 52{ 53 thumb = analogRead(ResThumb); 54 index = analogRead(ResIndex); 55 middle = analogRead(ResMiddle); 56 annular = analogRead(ResAnnular); 57 pinky = analogRead(ResPinky); 58 59 if(thumb > OpenedThumb) // Calibration reading and setting the maximum values. This needs you to completely open your hand a few times 60 OpenedThumb = thumb; 61 if(index > OpenedIndex) 62 OpenedIndex = index; 63 if(middle > OpenedMiddle) 64 OpenedMiddle = middle; 65 if(annular > OpenedAnnular) 66 OpenedAnnular = annular; 67 if(pinky > OpenedPinky) 68 OpenedPinky = pinky; 69 70 if(thumb < ClosedThumb) // Calibration reading and setting the minimum values. This needs you to completely close your hand a few times 71 ClosedThumb = thumb; 72 if(index < ClosedIndex) 73 ClosedIndex = index; 74 if(middle < ClosedMiddle) 75 ClosedMiddle = middle; 76 if(annular < ClosedAnnular) 77 ClosedAnnular = annular; 78 if(pinky < ClosedPinky) 79 ClosedPinky = pinky; 80 81 thumb = map(thumb ,ClosedThumb ,OpenedThumb ,0,180); // The analog read has to be readapted in values between 0 and 180 to be used by the servomotors. 82 index = map(index ,ClosedIndex ,OpenedIndex ,0,180); // The minimum and maximum values from the calibrations are used to correctly set the analog reads. 83 middle = map(middle ,ClosedMiddle ,OpenedMiddle ,0,180); 84 annular = map(annular,ClosedAnnular,OpenedAnnular,0,180); 85 pinky = map(pinky ,ClosedPinky ,OpenedPinky ,0,180); 86 87 Serial.write("<"); // This character represent the beginning of the package of the five values 88 Serial.write(thumb); // The values are sent via the Tx pin (the digital pin 1) 89 Serial.write(index); 90 Serial.write(middle); 91 Serial.write(annular); 92 Serial.write(pinky); 93 94 delay(30); 95} 96
Downloadable files
Robot hand circuit
Circuit to realize for the robot hand
Robot hand circuit
Glove Circuit
Circuit to realize for the sensors glove
Glove Circuit
Robot hand circuit
Circuit to realize for the robot hand
Robot hand circuit
Comments
Only logged in users can leave comments
Gabry295
0 Followers
•0 Projects
Table of contents
Intro
77
0