‘Flex sensors,’ or ‘bend sensors,’ are the ones that change its resistance depending on the amount of bend on the sensor.
They convert the change in bend into electrical resistance – the more the bend, the more the resistance value.
These sensors are widely used in various applications such as – automotive controls, medical devices, fitness products, virtual reality gaming consoles, animatronics, robotics, etc.
This tutorial aims to provide a detailed guide to flex sensor and its interfacing with Arduino.
The flex sensor patented technology is based on resistive carbon elements. As a variable printed resistor, it achieves great form-factor on a thin flexible substrate. When the substrate is bent, the sensor produces a resistance output correlated to the bend radius – the smaller the radius, the higher the resistance value.
This is how a flex sensor looks like:
They are usually in the form of a thin strip from 1”-5” long that vary in resistance range. Change in resistance with increasing bend is depicted in the snapshot below:
In simple words, flex sensors are analog resistors which work as variable analog voltage dividers.
They contain carbon resistive elements within a thin flexible substrate. More carbon means less resistance.
Usually a flex sensor is used in voltage divider configuration. It is shown below:
Interfacing with ArduinoNOTE: Although the active portion of the sensor (the area between the black squares) is quite sturdy, its pin-end is susceptible to kinking and eventual failure. I recommend reinforcing or securing this area (for example, clamping or gluing down the sensor at the black square nearest to the pins) to ensure that it doesn’t flex along with the rest of the sensor.
Make the connections of the flex sensor in voltage divider configuration as shown above. Take your Arduino and connect the divider point to analog Input of the board.
The analogRead () function will provide the sensor values.
flex = analogRead (1);
Serial.print (flex);
This will print values on the serial monitor.
Now we’ll show you the amount of bend through LEDs. Connect the red, green and blue LEDs to the Arduino digital pins 4, 3 and 2, respectively, as shown in the circuit.
With no bend in the flex sensor, only blue LED will glow whereas a small bend will turn on the green LED. On applying large amount of bend, red LED will glow, while the remaining two LEDs will be turned OFF, indicating a large bend.
Comments