Introduction: Interfacing Force Sensitive Resistor to Arduino
An FSR(Force Sensitive Resistor) is a sensor that allows you to measure physical pressure, weight and squeezing. They are pretty much used in DIY electronics as they are available at low cost.
In this Instructable, I'll show you how to Interface an FSR to Arduino and change the brightness of an LED depending on the pressure applied on the FSR.
Step 1: Components Required
For this project, you will need:
- Arduino Uno.
- FSR (Force Sensitive Resistor).
- 10K Resistor.
- Hook-up Wires.
- LED
- BreadBoard.
Step 2: About the FSR
The FSR is made of 2 layers separated by a spacer. The more one presses, the more of those Active Element dots touch the semiconductor and that makes the resistance go down.
FSRs are basically a resistor that changes its resistive value (in ohms Ω) depending on how much it is pressed. These sensors are fairly low cost, and easy to use but they're rarely accurate. They also vary some from sensor to sensor perhaps 10%. So basically when you use FSRs you should only expect to get ranges of response. While FSRs can detect weight, they're a bad choice for detecting exactly how many pounds of weight are on them.
Step 3: Connections
The connections are pretty easy and straight forward. Make the circuit by referring the images.
- The FSR has two pins, one will be connected to 5V pin.
- The other to A0 directly and to Gnd pin via a resistor.
If you need to connect the LED and control it's brightness, then connect it across pin 13 and Gnd of the Arduino.
Step 4: The Code
/* FSR simple testing sketch. <br>Connect one end of FSR to power, the other end to Analog 0. Then connect one end of a 10K resistor from Analog 0 to ground */ int fsrPin = 0; // the FSR and 10K pulldown are connected to a0 int fsrReading; // the analog reading from the FSR resistor divider void setup(void) { Serial.begin(9600); } void loop(void) { fsrReading = analogRead(fsrPin); Serial.print("Analog reading = "); Serial.print(fsrReading); // the raw analog reading if (fsrReading == 0) { Serial.println(" - No pressure"); } else if (fsrReading < 10) { Serial.println(" - Light touch"); } else if (fsrReading < 50) { Serial.println(" - Light squeeze"); } else if (fsrReading < 150) { Serial.println(" - Medium squeeze"); } else { Serial.println(" - Big squeeze"); } delay(1000); }
The above code is for simply reading the values. The below code can be used to change the brightness when you connect an LED across the Digital Pin 13 of the Arduino.
/* FSR testing sketch. Connect one end of FSR to 5V, the other end to Analog 0. Then connect one end of a 10K resistor from Analog 0 to ground Connect LED from pin 13 through a resistor to ground int fsrAnalogPin = 0; // FSR is connected to analog 0 int LEDpin = 11; // connect Red LED to pin 11 (PWM pin) int fsrReading; // the analog reading from the FSR resistor divider int LEDbrightness; void setup(void) { Serial.begin(9600); // We'll send debugging information via the Serial monitor pinMode(LEDpin, OUTPUT); } void loop(void) { fsrReading = analogRead(fsrAnalogPin); Serial.print("Analog reading = "); Serial.println(fsrReading); // we'll need to change the range from the analog reading (0-1023) down to the range // used by analogWrite (0-255) with map! LEDbrightness = map(fsrReading, 0, 1023, 0, 255); // LED gets brighter the harder you press analogWrite(LEDpin, LEDbrightness); delay(100); }
Step 5: The Result
Once you have uploaded the code, open up the serial monitor. You will see it display the values from the FSR. You can use these values to run different applications based on your projects. Like if you want to control an LEDs brightness upload the second code on to the Arduino.
That's All Folks !!! Stay Tuned For More !!

Participated in the
Makerspace Contest 2017
6 Comments
3 years ago
Hi,I need help from you..can u suggest me a simulation software for interfacing arduino with force sensor.Since i have a project based on it.
4 years ago
You have no current limiting resistor in your LED. They havent been fitted on an Arduino since at least 2006. The resistor on the sensor is going to the wrong place, it should go to 5V not ground. It will never work the way you have drawn it.
Question 4 years ago
Can someone sell me a setup with good more accurate sensors, longer wires, a complete setup to measure force impact? Thanks in advance
Question 4 years ago on Introduction
Hi, how long can the cables connecting the FSR to the Arduino be? Does it alter the resistance? What if I need almost 10m cables connecting the sensor to the device? does it work still?
5 years ago
can anyone tell me what is the unit here?
5 years ago
Hi!
This looks interesting. I want to mesure the needed force generates by the buoyancy force of an submerge object. The buoyancy force must be higher that 80 N (as a example), how can I write my code for newton units? sorry but I' dont't know much coding