keepcalculator

06 Numbers and Powers

Flexible Shape Sensors: Detect Bending & Twisting

Card No. 06·50606 · Updated · Standard formula, shown below

Flexible shape sensors measure how much a surface bends or twists by tracking changes in electrical resistance or capacitance. You attach the sensor to a moving part, read the signal with a microcontroller, and convert it into angle or twist values. This guide explains the working principle, the components you need, and how to calibrate and interpret the readings.

What You’ll Need

  • Flexible bend sensor (e.g., SpectraSymbol Flex Sensor or a DIY piezoresistive strip)
  • Microcontroller (Arduino, ESP32, or similar) with analog input
  • Resistor (typically 10 kΩ for a voltage divider)
  • Breadboard and jumper wires
  • Multimeter (for calibration)
  • Protractor or known-angle template (for calibration)
  • Power supply (3.3V or 5V, depending on sensor)
  • Optional: conductive thread or fabric for DIY sensors

Step-by-Step

  1. Understand the sensor type. Most flexible sensors are resistive: their resistance increases when bent. Some capacitive sensors change capacitance. Check the datasheet for your sensor to know which parameter changes and in which direction.
  2. Wire the sensor as a voltage divider. Connect one end of the sensor to power (e.g., 5V) and the other end to a fixed resistor (e.g., 10 kΩ) that goes to ground. The junction between the sensor and resistor connects to an analog input on your microcontroller. This gives a voltage that changes with resistance.
  3. Read the analog value. In your code, read the analog pin (e.g., analogRead(A0)). This returns a number between 0 and 1023 (on 10-bit ADCs). Record the value when the sensor is flat.
  4. Bend the sensor to a known angle. Place the sensor flat on a protractor, then bend it to a specific angle (e.g., 30°, 60°, 90°). Record the analog value at each angle. Do this for both bending directions if your sensor is bidirectional.
  5. Create a calibration curve. Plot the analog values against the angles. Most sensors have a roughly linear response, so you can use a linear equation: angle = (value - flatValue) * scaleFactor. Determine scaleFactor from the slope of your calibration points.
  6. Detect twisting. A single bend sensor only detects bending in one plane. To detect twisting, use two sensors placed perpendicular to each other (e.g., one along the length, one across the width) or use a sensor specifically designed for torsion. The difference in readings indicates twist.
  7. Implement the code. Write a program that reads the sensor, applies the calibration, and outputs the angle. For twisting, compute the difference between the two sensors’ angles.
  8. Test and refine. Move the sensor through its range and compare the output to the actual angle. Adjust the calibration if needed.

Common Mistakes

  • Using the wrong resistor value. If the resistor is too high or low, the voltage range will be compressed, reducing sensitivity. Choose a resistor close to the sensor’s flat resistance.
  • Ignoring the sensor’s bend direction. Some sensors only bend one way. Bending them the wrong way can damage them or give no signal.
  • Not calibrating at the actual operating temperature. Resistance changes with temperature, so calibrate in the environment where the sensor will be used.
  • Forgetting to account for the sensor’s own resistance. The sensor has a baseline resistance even when flat; your voltage divider must be designed to give a readable voltage change.
  • Mounting the sensor too stiffly. If the sensor is glued rigidly, it may not deform properly, leading to inaccurate readings.

Tips

  • Use a stable power supply. Fluctuations in voltage will cause noisy readings.
  • Apply a small amount of smoothing in software (e.g., moving average) to reduce noise without losing responsiveness.
  • If you need to measure twist, consider using a sensor with multiple sensing elements, or arrange two sensors at 45° to the twist axis.
  • For DIY sensors, use conductive fabric or thread and test the resistance change with a multimeter before integrating.
  • Calibrate at several points (at least 3) to check linearity. If it’s not linear, use a lookup table or polynomial fit.

Troubleshooting

  • No change in reading when bending. Check wiring: ensure the sensor is in the voltage divider correctly. Verify the sensor is actually changing resistance with a multimeter.
  • Reading jumps or is noisy. Check for loose connections. Add a capacitor (e.g., 0.1 µF) between the analog pin and ground to filter noise.
  • Reading goes to 0 or max immediately. The resistor value may be too far from the sensor’s resistance. Try a different resistor.
  • Angle calculation is off. Recalibrate, ensuring the sensor is flat when you measure the flat value. Also check that your scale factor is correct.
  • Sensor reads differently after re-powering. This is normal; always calibrate at startup or use a reference reading.

Frequently Asked Questions

Can a single bend sensor detect twisting?

No, a single bend sensor only measures bending in one plane. To detect twisting, you need at least two sensors oriented differently, or a sensor specifically designed to measure torsion.

What is the typical resistance range of a flexible sensor?

It varies by model. Common flex sensors have a flat resistance of 10 kΩ to 30 kΩ, and can increase to 50-100 kΩ when fully bent. Check your datasheet.

Can I use a flexible sensor to detect pressure?

Some flexible sensors (like FSRs) detect pressure, but bend sensors are designed for bending. They may respond to pressure slightly, but it’s not reliable. Use a pressure sensor for that purpose.

How accurate are flexible shape sensors?

Accuracy depends on the sensor quality and calibration. Typically, they can achieve ±5° to ±10° accuracy after proper calibration. For higher accuracy, use more calibration points and a stable setup.

Can I make my own flexible sensor?

Yes, you can create a simple bend sensor using piezoresistive materials like conductive foam or fabric. However, they are less repeatable than commercial sensors and require more calibration.

Do flexible sensors work with any microcontroller?

Yes, as long as the microcontroller has an analog input and can read voltage levels. Most Arduino boards and ESP32 work well.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →