Arduino Flex Sensor or bend sensor circuit and programming

Arduino Flex Sensor

Description:

Arduino Flex Sensor-Learn how to use a Flex sensor or Bend Sensor with the Arduino in this tutorial. This is a venture at the beginner stage and I will try my best to illustrate the basic extremes. The electrical and electronics engineering students are becoming very famous with a flex sensor. The Flex Sensor or bend Sensor can be used in biomedical projects, it can be used with doors for the security purposes, it can be used for the angle finding, this sensor is also ideal for monitoring the Dents in sheet metals and so on.

In this post, I will cover,

  • What is a flex or bend  sensor
  • How a Flex or bend sensor works
  • How to use a Flex  or bend Sensor with the Arduino
  • A basic program to control an led
  • How to choose the right resistor to use with the flex or bend sensor.



The Amazon Purchase links are given below:

flex or bend sensor: https://amzn.to/37klWwM
Arduino Uno: https://amzn.to/39aq6ZT
Mega 2560: https://amzn.to/2SszMsI
lm7805 Voltage Regulator: https://amzn.to/2ERYoTJ
330-ohm resistors pack: https://amzn.to/2Qj1Igg
female DC power jack socket: https://amzn.to/377Pg9M
470uf capacitors: https://amzn.to/2MrN3xR
5×7 cm Vero board: https://amzn.to/37b7KWO
female headers: https://amzn.to/350w6RE
connection wires: https://amzn.to/2MvOJXd
Super Starter kit for Beginners: https://amzn.to/398dliF
Jumper Wires: https://amzn.to/2SrnBwo
Bread Board: https://amzn.to/2MxV5FM
12v Adaptor: https://amzn.to/2MuOlZk
PCB plate: https://amzn.to/2MuwNMB
Variable Supply: https://amzn.to/39d0KdP
Digital Multimeter: https://amzn.to/34WbVoa
Vero Board / stripboard: https://amzn.to/39nL9Zg
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2PVwexF
Solder wire: https://amzn.to/2QlOvTS
Wire Stripper: https://amzn.to/353tYJa
wirecutter: https://amzn.to/2tV2lFj
PCB small portable drill machine: https://amzn.to/2MvQqnx

DISCLAIMER:

Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!

Flex Sensor or Bend Sensor:

A flex sensor known as the bend sensor is a device measuring the amount of bending or deflection. This is a type of resistor in the nonlinear resistor class. A Flex Sensor or Bend Sensor can be seen clearly in the image below. You may monitor how the resistance changes as the sensor is bent using a multimeter.

Arduino Flex Sensor

Through placing this sensor on any material’s surface, the bending can be tracked, as the quality of the resistance varies with the amount of bent added to the sensor. The Flex Sensor or Bend Sensor quality is commensurate with the amount of bent. So, that’s why this sensor is used to measure precisely the angle. Using Flex Sensor is like the standard resistor parameter.

Arduino Flex Sensor

As you can see in the image above, the Flex Sensor or Bend sensor has two contacts or legs that make it easy to use with the Breadboard, but personally suggest soldering jumper wires with these two contacts as it can easily be interfaced with the Arduino Uno or Mega.

It’s working theory, as said, is just like the usual variable resistor or potentiometer, with the only difference; that is, the resistance of the flex sensor varies with the twist, while the resistor of the variable or potentiometer adjusts the resistor when we turn the knob. There are also some other Flex sensor or Bend sensor types, but the Conductive Ink-based Flex Sensor is the one you can see on the screen.


Flex Sensor Interfacing with Arduino:

It is really easy to interface the Flex Sensor with Arduino. All you need is to attach the Flex sensor to a 10k resistor in sequence. Take a wire from the middle and connect it to the analog pin A0, attaching the other two ends to the 5v and floor of the Arduino. It’s just like a loop of the voltage divider. It is important to attach the flex sensor and the 10k resistor in series.

Programming:


Program Explanation:

began by setting Flex sensor lock. The Flex Sensor or Bend Sensor is attached to the analog pin A0 of Arduino.

int flexs = A0;

Then set pin to store the Flex Sensor value. specified the form integer variable information.

int data = 0;

Then gave the led pin. I’m going to use the Arduino onboard led on pin number 13.

int led = 13;

You know that each Arduino Uno or Mega program has two atleast functions that are the functions of void setup and void loop. The feature of void setup is performed only once. I enabled the Serial communication within the void setup feature and selected 9600 as the baud rate. Set the input and led flex sensor as the output.

void setup()

{

Serial.begin(9600);

pinMode(flexs, INPUT);

pinMode(led, OUTPUT);

}

The feature of the void loop is running infinite times. There is no return form for this function and it does not take any argument as the output.

void loop()

{

We read the Flex sensor first and store the value in the information of the factor. The value is then sent to the Serial monitor using Serial.println) (where we can analyze the sensor’s actions. Then use the LED switched ON or turned OFF if necessary.

data = analogRead(flexs);

Serial.println(data);

if( data <= 200)

{

digitalWrite(led, HIGH);

}

if( data > 200)

{

digitalWrite(led, LOW);

}

delay(1000);

}

hope this article will help you. Let me know in comment if you have any problems.

Watch Video Tutorial

Recommended For You

About the Author: Fawad

My name is Shahzada Fawad and I am a Programmer. Currently, I am running my own YouTube channel "Expertstech", and managing this Website. My Hobbies are * Watching Movies * Music * Photography * Travelling * gaming and so on...

Leave a Reply

%d bloggers like this: