Introduction: How to Connect Flex Sensor to Arduino
Flex sensor is an type of sensor which gives an analog values based on the bending of the sensor. The Flex Sensor is a unique component that changes resistance when bent. An unflexed sensor has a nominal resistance of 10,000 ohms (10 K). As the flex sensor is bent the resistance gradually increases.
In this tutorial you will understand how to connect an flex sensor and based on the flex sensor value we can control the output device, here we are using Flex sensor as an input device which means we are taking an flex sensor value as input value and by using that we will be controlling an output device ie led, so in this tutorial we gonna control led using flex sensor
Step 1: Components Required
Hardware Components Required
1.Flex Sensor 2.2inch.
5.WiresBread Board (Optional).
Step 2: Connecting Flex and Led to Arduino
Make the connection as per the circuit diagram
Step 3: Code
Const int flex1 = A0;
Const int led = 8;
Serial.begin (9600); // Begin Function
pinMode (A0,INPUT); // Initializing Flex sensor as input
pinMode(8,OUTPUT); // Initializing LED as output
int temp1 = analogRead (A0); // Reading sensor values
Serial.print ("Flex1 value = ");
Serial.println (temp1); // Printing Sensor value on Serial monitor
if(temp1 > 850)
Step 4: Result
Click on the link for video demonstration
Step 5: Follow Us on
Facebook : https://m.facebook.com/Projects12345/
We have a be nice policy.
Please be positive and constructive.