Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Flex Sensor & Arduino Interfacing – Measure Bend/Resistance
Arduino Projects

Flex Sensor & Arduino Interfacing – Measure Bend/Resistance

Mamtaz AlamBy Mamtaz AlamUpdated:May 27, 20233 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Flex Sensor Arduino Interfacing
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Overview

In this tutorial we will learn about flex sensor and its interfacing with Arduino. We will also learn how does a flex sensor works and also its applications.

A Flex Sensor or Bend Sensor is a device that measures the amount of bend or angular deflection by resistance change. A Flex Sensor is made up of a variable resistive surface. The sensor resistance is varied by bending the sensor. The resistance is directly proportional to the amount of bending. So it is sometimes called as Flexible Potentiometer. The real-life application of Flex sensor can be seen in the determination of joint movement & sometimes used as a door sensor and most powerful application in robotics to make Robotic Arm.

We will then go through few examples and learn the applications of flex sensor with Arduino. The examples include:
1. Interfacing of Flex Sensor with Arduino, i.e Calculating Resistance.
2. Calculating bend angle using Flex Sensor.
3. Controlling Servo Motor using Flex Sensor.




Bill of Materials

Following are the components required for making this project. All the components can be eaily purchased from Amazon. The components purchase link is given below.

S.N.Components NameQuantityPurchase Links
1Arduino UNO Board1Amazon | AliExpress
2Flex Sensor 2.2" or 4.5"1Amazon | AliExpress
3Servo Motor SG901Amazon | AliExpress
4Resistor 10K1Amazon | AliExpress
5Resistor 330-ohm1Amazon | AliExpress
6LED 5mm Any Color1Amazon | AliExpress
7Connecting Jumper Wires5Amazon | AliExpress
8Breadboard1Amazon | AliExpress

Flex Sensor

Flex Sensor

Overview

A flex sensor or bend sensor is a sensor that measures the amount of deflection or bending. Usually, the sensor is stuck to the surface, and the resistance of the sensor element is varied by bending the surface. Since the resistance is directly proportional to the amount of bend it is used as a goniometer, and often called a flexible potentiometer.

Flex sensors are available in two different sizes: one with 2.2″ (5.588cm) length and other with is 4.5″ (11.43cm) length. The width of the sensor is generally 0.6cm.

Construction of Flex Sensor

The flex Sensor construction diagram is given below.

Flex Sensor Construction

A flex sensor is constructed by depositing conductive ink on a phenolic resin substrate. A segmented conductor is placed on the top section.

Handling Flex Sensor

Flex sensors are designed to bend in a single direction as shown in the figure below. Bending it in another direction may damage it.

Flex Sensor Working

An unflexed flex sensor, i.e a flat flex sensor has resistance around 25K to 30K. When the sensor is bent to 45 degrees the resistance increase and goes nearly 65K. Similarly, when it is bent to 90 degrees, the resistance becomes almost 100K. It is to note that, this value of resistance is not fixed and may change in your case.


Types of Flex Sensor

Depending on the type of resistive material used on the surface of the Flex Sensor, they are classified as:
1. Conductive ink-based flex sensor
2. Fiber optic flex sensor
3. Capacitive flex sensor
4. Velostat flex sensor (popular among hobbyists)


Basic Flex Sensor Circuit

Flex Sensor Circuit

As Flex sensor is a variable resistor, it can be read by connecting it with a fixed value resistor 10kΩ. This forms a voltage divider network. One end of the flex sensor is connected to GND while the other end is connected to Analog Input A0 of Arduino. A 10KΩ resistor is connected between A0 and +5V.


Interfacing Flex Sensor with Arduino

Now let us interface the Flex Sensor with Arduuino & calculate the raw value after bending.

Flex Sensor Arduino Interfacing

Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const int flexPin = A0;
 
void setup()
{
  Serial.begin(9600);
}
 
void loop()
{
  int flexValue;
  flexValue = analogRead(flexPin);
  Serial.print("sensor: ");
  Serial.println(flexValue);
  
  delay(20);
}

After uploading code, you can check the raw value of the flex sensor by bending it. The raw value changes on the basis of bending of the sensor.



Controlling Servo Motor with Flex Sensor & Arduino

Now let us control Servo Motor by bending the Flex Sensor with Arduino. The circuit diagram is given below.

Flex Sensor Servo Motor Arduino

Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <Servo.h>
 
Servo myServo;
 
const int flexPin = A0;
 
void setup()
{
  myServo.attach(11);
}
 
void loop()
{
  int flexValue;
  int servoPosition;
  
  flexValue = analogRead(flexPin);
  
  servoPosition = map(flexValue, 800, 900, 0, 180);
  servoPosition = constrain(servoPosition, 0, 180);
 
  myServo.write(servoPosition);
  
  delay(20);
}

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleMicroPython on ESP32 using uPyCraft IDE – Getting Started
Next Article MicroPython: Interfacing 0.96″ OLED Display with ESP32

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
Add A Comment

CommentsCancel reply

Latest Posts
ESP32 Fingerprint Attendance System with Live Web Dashboard

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 21, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • ESP32 Fingerprint Attendance System with Live Web Dashboard
    ESP32 Fingerprint Attendance System with Live Web Dashboard
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
    ESP32 CAN Bus Tutorial | Interfacing MCP2515 CAN Module with ESP32
  • IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
    IoT Based ECG Monitoring with AD8232 ECG Sensor & ESP32
  • How to use Modbus RTU with ESP32 to read Sensor Data
    How to use Modbus RTU with ESP32 to read Sensor Data
  • Half Wave Rectifier Basics, Circuit, Working & Applications
    Half Wave Rectifier Basics, Circuit, Working & Applications
  • How to use INA226 DC Current Sensor with Arduino
    How to use INA226 DC Current Sensor with Arduino
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.