controlling linear servo

hi, does anyone here know about controlling servo dc linear from flex sensor as input signal? i just want to know whether i can read the servo stroke length as the result of bending the flex. or can i read the output value?

Please give full details of the hardware you are talking about - without this there is nothing to do on.

i'm using firgelli L12R and arduino mega2560..

Flex sensor not hardware then? Please post a link to the datasheet or product page, don't expect us
to all slog through that boring stuff.

Sorry :frowning:

this is product page of 2.2" flex sensor

and this is for firgelli L12R
http://www.actuonix.com/L12-R-Linear-Servo-For-Radio-Control-p/l12-r.htm

actualy i have made the code, but it seems like the code only read the input from flex sensor
here it is

Coding_Astero_1.ino (4.1 KB)

So that flex sensor has about 10k when straight upto a max of about 20k when fully bent,
it seems.

I'd use a 10k resistor with it in a resistor divider, and use map() to map the values appropriately
to the range 0 to 180 for a call to servo.write () to control the linear actuator. It takes standard
RC servo signalling which makes things very simple.

Do you actually need a sensor - that thing is a servoactuator and will go to where you tell it and
hold position. It must have an internal sensor to do that already.

yes. actually the code i made already control the servo position. i use firgelli L12 with stroke length 5cm, but the code will make the stroke length 2.5cm
i am a bit confused about the voltage output. so, the voltage output from flex will be transfer to actuator, is that right? so is it also right if the actuator voltage input = voltage output from flex?

You have some code? Post it please if you want help with it!

i already uploaded it above

agnessilivas:
i already uploaded it above

Did it compile for you?
var1 not declared,

var1 = map(flex_Thumb, 0, 511, 0, 90); // scale the value between 0-90 to use it in servo

Also servo is 0 to 180, not 0 to 90, that is why you are only getting 2.5cm from a 5cm throw.

Same for var2
Tom... :slight_smile: