Flex sensors offer a simple and intuitive way to detect bending and human motion using basic electronic principles. This article explains how flex sensors work, how to connect them to Arduino, and how to design reliable circuits around them. From construction details to calibration and actual projects, it also provides a practical basis for everyone.

What Is a Flex Sensor?
A flex sensor is an inexpensive resistive sensing device that measures bending or flexing. Its electrical resistance is lowest when the sensor is straight and increases progressively as it is bent, with the highest resistance typically occurring near a 90° bend, depending on the sensor’s design and length.
Pinout of Flex Sensor

A standard flex sensor has two terminals, commonly labeled P1 and P2. Electrically, the sensor behaves like a basic resistor and has no polarity, meaning the two pins are interchangeable.
Either terminal can be connected to 5V or GND, as long as the voltage divider is wired correctly. This non-polarized design makes flex sensors especially accessible and easy to integrate into microcontroller circuits.
Flex Sensor Working Principle
A flex sensor operates electrically as a variable resistor whose resistance changes in response to bending. When the sensor is flat, electrical current flows through the conductive layer with minimal resistance. As the sensor bends, the effective resistance increases in a predictable but non-linear manner.
Typical flex sensors are available in lengths such as 2.2″ and 4.5″, with resistance values that vary by manufacturer. A common behavior pattern is:
• Flat position: low resistance (often around 10 kΩ)
• Bent position: higher resistance (commonly 20 kΩ or more, depending on bend angle)
Microcontrollers such as Arduino cannot measure resistance directly. Instead, the flex sensor is used as part of a voltage divider circuit, where its changing resistance produces a corresponding change in voltage. This voltage is then read by the Arduino’s analog-to-digital converter (ADC), which converts the analog signal into a digital value (0–1023 for a 10-bit ADC at 5 V). By monitoring this voltage change, the microcontroller can detect bending intensity and translate it into usable data for control logic, visualization, or interaction.
Flex Sensor Construction

Flex sensors are constructed using a thin, flexible substrate coated with a specially formulated conductive ink that forms the sensing element. This conductive layer is designed to deform safely under bending while maintaining electrical continuity. A protective outer layer is added to improve durability and shield the sensor from moisture, abrasion, and repeated mechanical stress.
When the sensor bends, the conductive ink layer experiences mechanical strain. This strain causes microscopic changes in the conductive paths, increasing resistance as the bend becomes tighter. In general:
• Larger bend radius (gentle curve): smaller resistance change
• Smaller bend radius (tighter curve): larger resistance change
Because the sensing mechanism depends on physical deformation, flex sensors are sensitive to how and where they are bent. Uniform bending along the sensor’s length produces more consistent results than sharp creases or localized stress points, which can permanently damage the conductive layer and alter sensor behavior.
Arduino Flex Sensor Circuit

To read a flex sensor with an Arduino, the sensor is typically placed in a voltage divider circuit. Since Arduino cannot measure resistance directly, this circuit converts resistance changes into a proportional voltage that can be read by an analog input pin.
In this configuration:
• The flex sensor acts as a variable resistor
• A fixed resistor (commonly 10 kΩ or 15 kΩ) sets the measurement range
• The voltage at the divider midpoint changes as the sensor bends
As the flex sensor’s resistance increases with bending, the divider output voltage also changes in a predictable manner. The Arduino’s analog-to-digital converter (ADC) samples this voltage and converts it into a digital value between 0 and 1023 (for a 10-bit ADC with a 5 V reference).
This circuit forms the electrical foundation for all Arduino-based flex sensor applications and is referenced in the hands-on implementation described in Section 7.
Projects You Can Build with a Flex Sensor
Once bending can be measured reliably, flex sensors open the door to a wide range of creative and practical projects. Their simple analog output makes them easy to integrate into both beginner and advanced designs.

• Game inputs: Flex sensors can act as analog triggers, sliders, or gesture-based controls, adding natural, pressure-free interaction to custom game controllers.

• Music controllers: In digital music systems, flex sensors can modulate pitch, filters, volume, or effects, creating expressive, performance-oriented controllers.

• Data gloves: By placing sensors along the fingers, you can track finger bending and basic hand motions for virtual reality, animation control, or sign-language experiments.

• Servo control: Flex sensors are commonly used to drive servos smoothly, allowing robotic arms, grippers, or animatronics to imitate human hand movements in real time.

• Raspberry Pi systems: Although the Raspberry Pi lacks native analog inputs, flex sensors can still be used with external ADCs for motion-based control and monitoring projects.
Interfacing a Flex Sensor with Arduino

Hardware Assembly
Step 1: Gather components
Prepare an Arduino Uno (or compatible board), a flex sensor, a 10 kΩ or 15 kΩ resistor, a breadboard, jumper wires, and a USB cable.
Step 2: Mount the sensor
Insert the flex sensor terminals into separate breadboard rows to avoid short circuits. Keep the sensor flat and free from mechanical stress during testing.
Step 3: Build the voltage divider
Using the circuit explained in Section 5, wire the components as follows:
• Flex sensor terminal 1 → 5V
• Flex sensor terminal 2 → A0 and one end of the fixed resistor
• Other end of the resistor → GND
This arrangement converts resistance changes into a measurable voltage at A0.
Step 4: Verify connections
Ensure all jumper wires are secure. Loose wiring is a common source of noisy or unstable readings.
Software Setup
Step 5: Configure the Arduino IDE
Connect the Arduino, select the correct board and COM port, and open the Serial Monitor at 9600 baud.
Step 6: Read raw ADC values
Use analogRead(A0) to confirm the sensor responds smoothly as it bends. Values should change consistently before further processing.
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
Step 7: Convert voltage to resistance
For improved calibration and consistency, calculate the flex sensor resistance using the voltage divider equation:
Rflex=Rdiv×(VCC/Vflex-1)
图片
If an approximate bend angle is required, map the measured resistance range to degrees:
float angle = map(rFlex, 25000, 125000, 0, 90);
Replace these values with your own calibrated minimum and maximum resistance measurements for accuracy.
Limitations of Flex Sensors
• Not precision angle sensors; intended for relative bending detection rather than exact angle measurement
• Non-linear resistance response, making direct angle calculation less accurate
• Unit-to-unit variation, even among sensors of the same model
• Resistance drift over time due to material fatigue and repeated bending
• Hysteresis effects, where resistance differs between bending and unbending motions
• Limited long-term stability in applications with constant or heavy mechanical stress
• Best suited for intuitive control and gesture sensing, not high-accuracy measurement tasks
• Applications requiring precise or stable readings may need alternative sensors such as encoders or IMUs
Flex Sensor vs. Alternative Bend Detection Methods
| Sensor Type | Principle | Accuracy & Stability | Flexibility | Complexity | Typical Use Cases |
|---|---|---|---|---|---|
| Flex Sensor | Resistance changes with bending | Low to moderate accuracy; non-linear and may drift over time | Highly flexible | Very low; simple analog read | Wearables, data gloves, gesture control, intuitive human interfaces |
| Potentiometer | Variable resistance via rotation | High precision and good repeatability | Inflexible; requires mechanical linkage | Low to moderate | Rotary joints, knobs, mechanical angle measurement |
| IMU (Accelerometer + Gyro) | Measures acceleration and angular rate | Moderate to high with processing; may drift without filtering | Inflexible module | High; requires sensor fusion and calibration | Motion tracking, robotics, orientation sensing |
| Optical Encoder | Light-based position detection | Very high accuracy and long-term stability | Inflexible | Moderate | Motor position feedback, industrial automation |
| Magnetic Encoder | Magnetic field sensing for position | Very high accuracy and robust to wear | Inflexible | Moderate | Motor control, precise rotational measurement |
Conclusion
Flex sensors are best suited for intuitive, human-driven input rather than high-precision measurement. By understanding their construction, electrical behavior, and limitations, you can integrate them effectively into Arduino and embedded projects. With proper mounting, resistor selection, and calibration, flex sensors enable responsive wearable devices, creative controllers, and interactive systems with minimal hardware complexity.
Frequently Asked Questions [FAQ]
How long do flex sensors last with repeated bending?
Flex sensor lifespan depends on bend radius, frequency, and mounting quality. When bent within recommended limits and mounted properly, most flex sensors can withstand tens of thousands of cycles. Sharp creases, over-bending, or poor strain relief significantly reduce durability.
Can a flex sensor be used with 3.3V microcontrollers instead of Arduino?
Yes. Flex sensors work with 3.3V systems such as ESP32, ESP8266, and STM32. You may need to adjust the fixed resistor value and recalibrate readings to account for the lower reference voltage and ADC characteristics.
Do flex sensors need signal filtering for stable readings?
In many cases, yes. Simple software techniques like moving averages or low-pass filters help reduce noise caused by mechanical vibration or small hand movements. Filtering improves stability, especially in wearable or gesture-based applications.
Can multiple flex sensors be used at the same time on one Arduino?
Absolutely. Each flex sensor requires its own voltage divider and analog input pin. As long as sufficient analog pins are available and proper calibration is performed per sensor, multiple flex sensors can be read simultaneously without issue.
Are flex sensors safe for wearable and biomedical projects?
Flex sensors are generally safe for prototyping and non-invasive wearable projects. However, they are not medical-grade components. For clinical or safety-critical biomedical applications, certified sensors designed for regulated environments should be used instead.