The Physics of Bending: How Flex Sensors Actually Work

Flex sensors, such as the industry-standard Spectra Symbol FS01 or Flexpoint Bend Sensor, rely on a proprietary carbon-polymer ink printed onto a flexible polyester or polyimide substrate. When the substrate is bent, the conductive carbon particles are physically pulled apart. This lengthens the electron pathway and narrows the cross-sectional area of the conductive trace, which predictably increases the electrical resistance. It is essentially a strain-actuated variable resistor.

Unlike digital MEMS accelerometers or I2C rotary encoders, a flex sensor is a purely passive, analog component. At 0° (perfectly flat), a standard 2.2-inch sensor sits around 25kΩ. Bend it to 90°, and the resistance climbs to roughly 125kΩ. Because the sensor outputs a varying resistance rather than a voltage or a digital data stream, you cannot connect it directly to a microcontroller pin. You must use a voltage divider circuit to convert the physical bend into a measurable analog voltage, which your microcontroller’s Analog-to-Digital Converter (ADC) then translates into a digital value.

Where Are Flex Sensors Used? Application Matrix & Specs

If you are wondering where are flex sensors used, the answer lies in applications requiring continuous, non-rigid joint tracking where bulky optical encoders or rigid potentiometers will not fit. They are heavily utilized in wearable rehabilitation tech, soft robotics, and animatronics because they are incredibly thin (typically 0.43mm), lightweight, and can be embedded directly into fabrics or silicone molds.

Below is a data-dense specification and application matrix detailing exactly how different sensor sizes are deployed in the field, along with real-world 2026 pricing and electrical characteristics.

Application Domain Specific Use Case Recommended Model / Size Nominal Flat R Max Bend R Typical Price
Wearable Rehab Finger joint tracking (gloves) Spectra Symbol 2.2" (FS01) 25 kΩ 125 kΩ $12.50
Soft Robotics Gripper feedback / tactile grasp Flexpoint 4.5" Bidirectional 35 kΩ 150 kΩ (both dirs) $38.00
Animatronics / VR Puppet jaw / elbow hinge tracking Spectra Symbol 4.5" (FS02) 50 kΩ 250 kΩ $24.00
Automotive / Marine Steering column stalk / rudder angle Custom 10" Polyimide 10 kΩ 80 kΩ $85.00+

While they excel in low-profile integration, flex sensors lose to rotary encoders when absolute precision and zero-drift are required. They are a compromise: you trade perfect repeatability for extreme mechanical flexibility.

Hardware Interfacing: Wiring the Voltage Divider to ESP32

To read the resistance change, we use a voltage divider. The ESP32 operates at 3.3V logic and features a 12-bit ADC (0-4095). We will use a 47kΩ fixed pull-down resistor, which sits nicely in the middle of the flex sensor’s operating range, maximizing our voltage swing.

ESP32 Pin Component Flex Sensor Pin Notes
3V3 (Supply Range: 3.0-3.6V) Wire Pin 1 (Top Trace) Polarity does not matter for the sensor itself.
GPIO 34 (ADC1_CH6) 47kΩ Resistor (Leg 1) Pin 2 (Bottom Trace) ADC1 pins are required if using WiFi. ADC2 conflicts with WiFi.
GND 47kΩ Resistor (Leg 2) N/A Completes the voltage divider to ground.

Wiring Steps

  1. Prepare the Sensor: Strip the flex sensor wires or attach the provided crimp housing. Do not apply a soldering iron directly to the silver traces; the heat will melt the polyester substrate and destroy the sensor. Use conductive epoxy or crimp terminals.
  2. Build the Divider: Insert one leg of the 47kΩ resistor into the same breadboard row as the flex sensor’s Pin 2. Connect the other leg of the resistor to the ESP32 GND rail.
  3. Route the Signal: Run a jumper wire from the shared Flex Pin 2 / Resistor node directly to GPIO 34 on the ESP32.
  4. Power the Circuit: Connect Flex Pin 1 to the ESP32 3V3 pin. Ensure your USB cable or external supply can provide a clean 3.3V without high-frequency switching noise.
Callout Tip: Pin Selection Matters
Always use ADC1 pins (GPIO 32, 33, 34, 35, 36, 39) for analog sensors on the ESP32. If you use an ADC2 pin (like GPIO 25 or 26) and later enable the WiFi radio in your code, the WiFi driver will hijack ADC2, and your sensor readings will drop to zero or return garbage data.

Signal Math: Converting Raw ADC to Bend Angle

The output of our circuit is an analog voltage. The ESP32 reads this voltage and outputs a digital integer. Here is the exact math governing the conversion.

1. Resistance to Voltage:
Using the standard voltage divider formula: V_out = V_in × (R_fixed / (R_flex + R_fixed))
If the sensor is flat (R_flex = 25kΩ): V_out = 3.3 × (47 / (25 + 47)) = 2.16V
If the sensor is bent 90° (R_flex = 125kΩ): V_out = 3.3 × (47 / (125 + 47)) = 0.90V

2. Voltage to Digital (ADC):
A 12-bit ADC maps 0-3.3V to 0-4095. Therefore, 2.16V yields an ADC reading of ~2680, and 0.90V yields ~1118.

Note: The ESP32’s ADC is notoriously non-linear at the extreme top and bottom of its voltage range. Always use the analogReadMilliVolts() function in the ESP32 Arduino core, which applies Espressif’s factory calibration lookup tables to return a highly accurate millivolt reading, bypassing the raw ADC non-linearity.

#include <Arduino.h>

const int FLEX_PIN = 34; // GPIO 34 (ADC1_CH6)
const int R_FIXED = 47000; // 47kΩ pull-down resistor

// Calibrated millivolt values for your specific sensor
const int MV_FLAT = 2160;  // ~2.16V at 0 degrees
const int MV_BENT = 900;   // ~0.90V at 90 degrees

void setup() {
  Serial.begin(115200);
  analogReadResolution(12); // Ensure 12-bit resolution
}

void loop() {
  // Read calibrated millivolts directly
  int mV = analogReadMilliVolts(FLEX_PIN);

  // Map millivolts to degrees (Note: higher mV = flatter)
  float angle = map(mV, MV_FLAT, MV_BENT, 0, 90);
  angle = constrain(angle, 0, 90);

  Serial.printf("Voltage: %d mV | Angle: %.1f deg\n", mV, angle);
  delay(50);
}

Calibration, Drift, and Interference Mitigation

A common mistake is assuming the datasheet resistance values are absolute. Calibration and scaling are strictly required for every individual sensor. The carbon ink thickness varies slightly during manufacturing. You must physically measure the MV_FLAT and MV_BENT values of your exact unit and hardcode them into the mapping function above.

When deploying flex sensors, you must also engineer around three common interference sources:

  1. Hysteresis and Mechanical Creep: The polymer substrate does not snap back instantly. If you bend the sensor to 90° and hold it for 60 seconds, the resistance will slowly “creep” upward. When released, it will undershoot the 0° baseline before recovering. Fix: Implement a software deadband and avoid using flex sensors for applications requiring rapid, high-frequency oscillation tracking.
  2. Temperature Drift: Carbon ink has a negative temperature coefficient. As ambient temperature rises, baseline resistance drops. A 10°C increase can shift your zero-point by up to 5%. Fix: If operating in varying environments, include a thermistor in your circuit and apply a software temperature compensation curve.
  3. Electromagnetic Interference (EMI): Because the sensor operates at high impedances (up to 250kΩ), the analog trace acts as an antenna, picking up 50/60Hz mains hum and RF noise from the ESP32’s WiFi antenna. Fix: Keep the wires between the sensor and the ESP32 under 10cm. Solder a 0.1µF ceramic capacitor in parallel with the 47kΩ fixed resistor to create a low-pass hardware filter, and apply a software moving-average filter.
Parameter Flex Sensor Foil Strain Gauge Rotary Encoder
Installation Profile Ultra-thin (0.43mm) Microscopic (requires adhesive bonding) Bulky (requires rigid shaft mounting)
Signal Conditioning Simple Voltage Divider Wheatstone Bridge + Op-Amp Digital Pull-ups (None)
Repeatability Low (Prone to creep) High Absolute / Very High
Best Suited For Wearables, Soft Robotics Load cells, Material stress testing Motor shafts, rigid hinges

For deeper integration details on the ESP32 ADC subsystem, refer to the official Espressif ADC Oneshot Driver Documentation. For physical mounting techniques and substrate limits, the SparkFun Flex Sensor Hookup Guide remains an excellent bench reference.