Animatronic hand

I am conducting a research project in year 12. I have decided to construct an animatronic hand. I have been following from the schematic on garage lab, http://garagelab.com/profiles/blogs/project-flex-sensor-servo-motor-arduino ,(only the code and ‘sketch’ of hardware with Arduino and breadboard etc, is important, i have already constructed the hand).
This schematic has two servos and sensors but i only have one of each (am not required to have a whole hand, one finger is fine and will be explained in the ‘research’) Am using modified (attempted to fix) code,

#include <Servo.h>

int flexpin=A0;
int pos=90;
Servo myservo
int flex[20];
int flexsum=0;

void setup()
{
myservo.attach(7);
Serial.begin(9600);
}

void loop()
{
for(int x=0; x<20; x++)
{
flex[x]=analogRead(flexpin);
sumflex=sumflex+analogRead(flexpin);

delayMicroseconds(14);
}
flexsum=flexsum/20;
if(Serial.available())
{
Serial.println(flexsum);
Serial.println(flexsum1); 
delay(100);
}
pos=map(flexsum,870,800,0,180);
myservo.write(pos);

delay(200);
}

This project really demands me to have primary resources, i am almost confident to fix myself but need some sort of proof of primary input (primary input is just advice or suggestions from a person who has greater knowledge of this than me, any replies i will be able to note and give reference to in the research). Please! Email at joppy.999@gmail.com, even if you have no idea about the code some secondary references would be great. Thank you very much.

o_Jordan_o: This schematic has two servos and sensors but i only have one of each!

I don't understand what you're asking for, but if you only have one input sensor and one actuator then you're really only animating one joint. (A convincing hand would require several of these for each digit.)

If 'proof of primary input' means proof that this is your own work then (a) we can't give you proof that this is your own work and (b) you've already told us this is based on somebody else's project so it [u]isn't[/u] all your own work.

As far as the the code goes, you have got various vestiges of the second servo in there and you can get rid of flexsum1, flex[] and myservo1 - in fact you would need to get rid of references to these before your code would compile. Next time you post code, please use code tags.

Yes, sorry was not clear, first timer. I know this is not my own work, a mere reconstruction (the assignment is all about research, not originality), but in order to do so i need show that i have learnt knew things from those who know more than me in the area.

One of the go-to-guys on servos here, is member DuaneB. Go and have a look at these pages of his, which will provide useful info on servos. Of particular interest might be what he says about power supply, ignorance of which remains one of the most common causes of servo problem threads in this forum!

DuaneB 1
DuaneB 2

Then you might also like to do some simple research yourself… secure your servo to a table with a weight on a string attached to the horn, horn clear of the edge. Devise a weight that you can vary somehow, perhaps a plastic container that you can put nuts and bolts and stuff in. Or tins of cat food.

Then hook up the power supply so that you have an ammeter in series, and measure the current drawn under various loads. By tying the string to a horn hole near to or far from the axis, you can verify the whole torque = force x distance thing. You can also verify the maker’s torque figure. If you don’t have an ammeter, that’s no biggy, but verifying the torque available is important.

For what it’s worth, below is a pic of a very simple finger I made out of plastic hose. Might not be clear, but the “joints” are just V-notches cut into the hose to let it bend. A string goes from the servo horn up the inside of the hose and is tied to the far end… servo turns, pulls string, finger bends. There is no “reverse” string attached to straighten it: when the servo releases, the hoses’ own elastcity returns it to straight. Whole things just mounted on an upside down wooden box for stability. Fyi, that hobby servo drew almost 500mA to bend that hose, even with those big notches.

HTH?

Jim

Thank you, much appreciated.