Blog

Flex Sensor 5.6 cm (Detect Bending Motion)

Flex Sensor 5.6cm

Bend Detection Sensor for Arduino and Wearable Electronics Projects

 

Introduction

The 5.6cm Flex Sensor is a variable resistor that changes resistance when bent. Perfect for detecting finger movements in gloves, robotic joints, or any application requiring bend measurement.

Key Features

🔄 Bend Sensing

10KΩ to 40KΩ resistance range

📏 Compact Size

5.6cm active sensing length

🔌 Simple Interface

Analog voltage output

👋 Wearable

Ideal for glove-based controls

Technical Specifications

Resistance Range 10KΩ (flat) to 40KΩ (90° bend)
Active Length 5.6cm (2.2 inches)
Width 6.4mm (0.25 inches)
Thickness 0.5mm (flat)
Bend Radius 12.7mm minimum
Operating Voltage 3.3V – 5V DC
Lifetime 1 million+ bends
Temperature Range -35°C to +80°C

 

Pin Configuration

Wire Color Description Connection
Black Ground GND
Red Signal Analog Pin (with voltage divider)
Note: Requires a voltage divider circuit (10KΩ resistor recommended)

Basic Wiring with Arduino

 

// Voltage Divider Circuit:
// Flex Sensor → A0
// 10KΩ Resistor between A0 and VCC
// GND → Flex Sensor other terminal

 

Basic Bend Detection

const int flexPin = A0;

void setup() {
  Serial.begin(9600);
}

void loop() {
  int flexValue = analogRead(flexPin);
  Serial.print("Sensor Value: ");
  Serial.println(flexValue);
  
  if(flexValue > 800) {
    Serial.println("Fully Bent");
  } else if(flexValue > 500) {
    Serial.println("Partially Bent");
  } else {
    Serial.println("Flat Position");
  }
  
  delay(500);
}

 

Advanced Calibration

// Calibration values (adjust based on your sensor)
#define FLAT_RESISTANCE 10000  // 10KΩ when flat
#define BEND_RESISTANCE 40000  // 40KΩ when bent 90°
#define R_DIVIDER 10000        // 10KΩ resistor value

void setup() {
  Serial.begin(9600);
}

void loop() {
  int flexADC = analogRead(A0);
  float flexV = flexADC * 5.0 / 1023.0;
  float flexR = R_DIVIDER * (5.0 / flexV - 1.0);
  
  // Map resistance to bend angle (0°-90°)
  float angle = map(flexR, FLAT_RESISTANCE, BEND_RESISTANCE, 0, 90);
  angle = constrain(angle, 0, 90);
  
  Serial.print("Resistance: ");
  Serial.print(flexR/1000, 1);
  Serial.print("KΩ\tAngle: ");
  Serial.print(angle, 0);
  Serial.println("°");
  
  delay(500);
}

 

Calibration Tip: Record sensor values at known bend angles for best accuracy

 

Advanced Applications

Gesture Control

int lastFlexValue = 0;

void detectGesture() {
  int currentFlex = analogRead(A0);
  int delta = currentFlex - lastFlexValue;
  
  if(abs(delta) > 100) { // Threshold
    if(delta > 0) {
      Serial.println("Bending detected");
    } else {
      Serial.println("Straightening detected");
    }
  }
  lastFlexValue = currentFlex;
}

Multiple Sensors

const int numSensors = 5;
const int flexPins[] = {A0, A1, A2, A3, A4};

void readAllSensors() {
  for(int i=0; i<numSensors; i++) {
    int val = analogRead(flexPins[i]);
    Serial.print("Finger ");
    Serial.print(i);
    Serial.print(": ");
    Serial.println(val);
  }
}

Wireless Data

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(7, 8); // CE, CSN pins
const byte address[6] = "00001";

void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}

void loop() {
  int flexData = analogRead(A0);
  radio.write(&flexData, sizeof(flexData));
  delay(20);
}

Troubleshooting

Unstable Readings

  • Ensure secure wiring connections
  • Add 0.1μF capacitor across sensor leads
  • Use shorter wires between sensor and Arduino

No Change in Values

  • Verify voltage divider circuit is properly connected
  • Check for sensor damage (visible cracks)
  • Test with known resistor values

Limited Range

  • Adjust the voltage divider resistor value
  • Recalibrate for your specific bend range
  • Check power supply stability