Professional Documents
Culture Documents
A flex sensor is basically a variable resistor, whose resistance varies when bent. Because the resistance is
directly proportional to the amount of bending, it is often referred to as a Flexible Potentiometer.
Flex sensors are typically available in two sizes: 2.2′′ (5.588cm) long and 4.5′′ (11.43cm) long.
The simplest way to read the flex sensor is to combine it with a static resistor to form a voltage divider,
which produces a variable voltage that can be read by the analog-to-digital converter of a microcontroller.
It is important to note that the output voltage you measure is the voltage drop across the pull-down
resistor, not the voltage drop across the flex sensor.
Code
void setup() {
Serial.begin(9600);
pinMode(flexPin, INPUT);
void loop() {
Serial.println();
delay(500);
}