شحن مجاني للأوردرات فوق
1000 ج
رمضان كريم
Bend Detection Sensor for Arduino and Wearable Electronics Projects
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.
10KΩ to 40KΩ resistance range
5.6cm active sensing length
Analog voltage output
Ideal for glove-based controls
| 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 |
| Wire Color | Description | Connection |
|---|---|---|
| Black | Ground | GND |
| Red | Signal | Analog Pin (with voltage divider) |

// Voltage Divider Circuit: // Flex Sensor → A0 // 10KΩ Resistor between A0 and VCC // GND → Flex Sensor other terminal
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);
}
// 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);
}
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;
}
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);
}
}
#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);
}
No account yet?
Create an Account
Recent Comments