Arduino 5 Minute Tutorials: Lesson 6 - Force, Bend, Stretch Sensors

Lessons Menu:

Lesson 6 Hardware:

  1. Computer / Laptop or Netbook
  2. Arduino Microcontroller
  3. USB to Serial Adapter (if your microcontroller does not have a USB port)
  4. Appropriate USB cable (Arduino boards draw power from the USB port – no batteries yet)
  5. Standard servo motor (current consumption <50mA)
  6. Pin headers / cables
  7. Bend /stretch sensor and/ or Force sensor
Force “sensors” are actually “force sensing resistors” (FSRs). Similarly, bend “sensors” are actually products whose resistance changes with flexing. These can all be categorized as “variable resistors”. To interface a product whose resistance changes with a microcontroller, you need a voltage divider circuit. This “circuit” is nothing complex – aside from wires, the only part you are missing is a resistor.

To create the circuit, add the variable resistor in series with a similar (standard) resistor of roughly the same resistance (in ohms). Connect a wire between the two - this wire goes to the analog input of the board. There should only be two wires left - one end of the standard resistor, and one end from the variable resistor - these ends are connected to +5V and GND respectively. You can now use it as a regular sensor with analog output.

Arduino 5 Minute Tutorials

If you want a pre-made circuit, consider the Phidgets voltage divider:

Arduino 5 Minute Tutorials

The output of this “mini circuit” is a signal between 0 to 5V (this is referred to as an analog signal), which is connected to an analog pin of the microcontroller. The microcontroller's on-board analog to digital converter (ADC) interprets this voltage and assigns it a number which you can use in your code. For 10 bit ADC (210), you will get a number between 0 and 1024 representing 0V to 5V. You would need an equation in your code to use this number to send the appropriate signal to a motor controller. As you might have suspected, the code is now identical to that used to get an analog input.

To get sample code, open the Arduino software and go to File -> Examples -> Analog -> AnalogInOutSerial

The video above shows a bend sensor connected to an Arduino, and the Arduino is connected to a small servo motor. The analog value associated with the flex sensor is read by the Arduino, and that value is converted to a rough position. You would merge the Analog example code with the servo code, and add a single line to convert the 0 to 1024 value to 0 to 180 degrees. It is easy to see how, with many of these sensors, you can create a data glove which controls a robotic hand.

 
This is a companion discussion topic for the original entry at https://community.robotshop.com/tutorials/show/arduino-5-minute-tutorials-lesson-6-force-bend-stretch-sensors

You need a microcontroller. Sensors -> Microcontroller -> LCD

Is there any link providing the complete reference to the coding you people are using.

thanks a million, good idea which have opened my mind far to a project am working on.

Hi if I want to 3D render the bending of the flex sensor in an app for andriod how should I go about this?

@MDC We are not aware of any 3D CAD programs as “apps”, so you will need to search online. Alternatively you can create a GIF to show the sensor bending.

how to control speed of servo while maintaining a constant possible torque while using microseconds (i dont want to use delay syntax)?

@neha singh For normal R/C servos, this is not really possible (or easy), but you might try it with smart servos as they often provide current feedback (which relates to torque). As such, you can create a program to ensure (roughly) the same applied torque, though the speed may need to vary (if there is no resistance, the servo cannot simply “apply torque”)

I am very new to arudino and am exploring FSR, I want to do quite similar as shown in the video, What did you attach to the board on which pressure is applied,is this just a thin metal piece or a short flex bend sensor?

My previous comment got posted incomplete, as mentioned in the post how to get sample code from File -> Examples -> Analog -> AnalogInOutSerial. I might sound asking a dumb thing but just started this …

hi, i want to make a stand that can be able to measure the traction of a rc motor + propeller on 3 axis. I want to mount the motor in the stand and power it and i want to know the traction force for each axle. In is possible it using 2.2" 10K flexible sensor? Thank you

@Shilpa: The video is not from us, but the sensor used in it is similar to this bend sensor. In such a setup the Arduino usually reads a voltage from a voltage divider composed of a fixed resistor and a varying resistor (bend sensor). The varying voltage is used as an indication of bending and therefore use to calculate the desired position of the servo motor.

@Marius You indicate “traction” which normally means a wheel against a solid surface, though you write “propeller”. Do you want to measure the thrust of a propeller + motor? If so, you can use a force sensor or load cell.

hi,i want to get a value from user and according to that i want control the motor ON state .how to do this

@dhina What kind of input would you get from a user? Perhaps turning a knob? In any case, you will need a motor controller: https://www.robotshop.com/en/motor-controllers.html

I would like to pull a string (wire, whatever) to a Skelton jaw exerting forces similar to chewing and measure the force also being able to alter the force we needed for various muscle actions

@Richard morgan You’ll need to calculate the force needed, then convert that to a torque. An RC servo would likely work best.

Hello Sir,
I’m on an Drone/ UVA project, please tell me how to connect the ESC, DC motors, radio transmitter to an Arduino to make it complet circuit or else is there another way to connect the all sensors, ESC, motors, radio transmitter

@Paul Biswajit If you are unsure, you will need to read up on the MultiWii project and understand it in detail before making any connections.

I am a physical therapist with zero electronics knowledge but willing to learn. I want to measure joint range of motion using stretch sensors. Any advice on what I need to buy and if there is a good guide/book to get going? Or do you think I’ve got no hope and should look for someone who knows what they are doing?