Force Sensing Resistor (FSR) with Arduino Tutorial

FSR (Force Sensitive Resistor)

FSRs are super robust pressure sensors that are used in all kinds of industries. You will find them in electronic drums, mobile phones, handheld gaming devices and many more portable electronics. These sensors are easy to use and great for sensing pressure, but they aren’t incredibly accurate. You can sense if it’s being squeezed or use it as a touch sensor, but you may not want to use it as a scale.

In this tutorial you will learn how an FSR works and how to use it with Arduino. I have included 3 examples with a wiring diagram and code so you can start experimenting with your sensor.

The technology used in FSRs is patented by Interlink Electronics, which has been in operation since 1985. The most common types of FSR that you will find are the Interlink FSR 402 and 406.

How does an FSR work?

The resistance of an FSR depends on the pressure that is applied to the sensing area. The more pressure you apply, the lower the resistance. The resistance range is actually quite large: > 10 MΩ (no pressure) to ~ 200 Ω (max pressure). Most FSRs can sense force in the range of 100 g to 10 kg.

Basic construction

An FSR consists of two membranes and a spacer adhesive. The conducting membranes are separated by a thin air gap when no pressure is applied. One of the membranes contains two traces running from the tail to the sensing area (the round part). These traces are woven together, but not touching. The other membrane is coated with a conducting ink. When you push on the sensor, the ink shorts the two traces together with a resistance that depends on the pressure.

FSR Construction
FSR Construction

How to read an FSR

This graph displays the resistance vs force curve for the FSR 402 sensor. Note that the data is plotted on logarithmic scales. The response is not linear! As you can see there is a huge drop in resistance when a small amount of pressure is applied. After that, the resistance is inversely proportional to the applied force. At around 10 kg (not shown in the graph) the sensor is saturated and an increase in force yields little to no decrease in resistance. 

FSR-402-Resistance-vs-Force-curve
Resistance vs Force curve

Voltage divider circuit

In order to measure the applied force with an Arduino you will need to build a voltage divider circuit with the FSR and a pull-down resistor. This circuit creates a variable voltage output that can be read by the ADC (analog to digital converter) input of the microcontroller.

Voltage divider circuit Interlink FSR 402
Voltage divider circuit and Vout vs Force curves for different R values. Data represents output for Interlink 402 FSR and V+ equal to 5V. Reference: Interlink integration guide.

Selecting the right size resistor to match your sensor can be a bit tricky and depends on the force range you want to measure. 

The graph above shows the Vout vs Force curves for different values of R (the pull-down resistor). A 10 kΩ resistor works well if you want to use the sensor over its entire force range (100g to 10kg). 

Example

The output voltage (Vout) that we measure with the Arduino is described by the following equation:

Vout = Vcc x R / (R + Rfsr)

So the voltage is inversely proportional to the FSR resistance. Note that the output voltage you measure is the voltage drop across the pull-down resistor, not across the FSR.

When no force is applied, the FSR resistance will be really high, take 10MΩ as an example. I used a 10kΩ pull-down resistor and a Vcc of 5V for this tutorial, which results in the following output when no force is applied:

Vout = 5V x 10kΩ/ (10kΩ + 10MΩ) = 0.005V

So almost 0 V. If you press really hard on the FSR, the resistance will go down to roughly 200 Ω. This results in the following output voltage:

Vout = 5V x 10kΩ/ (10k‎Ω + 200Ω) = 4.9V

As you can see, you should be able to measure an output voltage between 0 and 4.9V depending on the amount of force you apply to the sensor.

Specifications

This are the specifications of the round 402 sensor that I used in this tutorial. 

FSR 402 Specifications

FSR 402Specifications
Actuation Force~0.1N minimum
Force Sensitivity Range~0.1N – 100N
Resistance Range>10 MΩ (open circuit) – ~200Ω
Force ResolutionContinuous (analog)
Force Repeatability± 2%
Active AreaØ 14.68 mm
Nominal Thickness0.46 mm
Switch Travel0.15 mm
Lifetime> 10 million actuations
Weight0.26g
Power SupplyAny! Uses less than 1mA of current, depending on resistor used in voltage divider.

For more information you can check out the datasheet here. It also includes data for the other sensors of the 400 Series.

Connecting to an FSR

The easiest way to connect to an FSR is to use a breadboard. This works great for prototyping and testing. If you need a more permanent solution, I highly recommend the Amphenol FCI Clincher Connector. You can just clamp these connectors around the silver traces of the connector and easily attach jumper or dupont cables.

Amphenol clincher connector
Amphenol FCI Clincher Connector

Warning

Do NOT solder directly to the exposed silver traces of the sensor. The substrate will melt during soldering and the solder joint won’t hold. Do not kink or crease the tail of the FSR if you are bending it; this can cause breaks in the printed silver traces. Interlink suggests a minimum bending radius of 2.5 mm.

Tools and Materials

You can find the tools and materials that I used or mentioned in this tutorial in the links below. Or click the markers in the image for more info and prices on Amazon.

*Note: the above links are affiliated which means – at no additional cost to you – if you purchase anything using them you’re helping to support my work on this site. My humble thanks (I really appreciate it)! 

Other sensors in the 400 Series, like the FSR 400 and 408 are available at digikey

Testing an FSR

The easiest way to see if your FSR is working correctly is to connect it to a multimeter. I used alligator test leads to connect the multimeter to the exposed leads of the sensor. Put your sensor in resistance (Ω) measuring mode and you should see the resistance value change when you press on the sensor.

Testing an FSR Force Sensitive Resistor
Measuring the resistance change when applying a load.

Because the resistance range is so big (200 kΩ to 200 Ω) it’s best to use a multimeter with autorange function. If you don’t have one of those, just play around with the range settings. 200 kΩ should enable you to see most of the range.

Wiring – Connecting an FSR to Arduino UNO

Now that you know the sensor is working correctly, it is time to connect it to the Arduino. We will be using a breadboard and jumper wires, as this is the easiest way to prototype a circuit.

As mentioned in the introduction, you need to create a circuit with a 10 kΩ pulldown resistor.

The wiring diagram below shows you how to connect the FSR sensor to the Arduino. Note that an FSR is non-polarized, just like normal resistors. There is no positive or negative side, just connect them in the orientation you want.

FSR with Arduino wiring diagram
FSR with Arduino UNO wiring diagram

Connect one of the leads of the FSR to power (5 V, but 3.3 V works just fine too) and the other lead to the analog in of the Arduino (A0). The 10 kΩ pulldown resistor gets connected between GND and A0

Example 1 Connecting an FSR to Arduino UNO

FSR with Arduino example code – Analog voltage reading

Now that you have wired up the sensor, you can upload the following example code using the Arduino IDE.

This sketch will read out the sensor from the analog input of the Arduino and display the output in the serial monitor. 

As mentioned earlier, the output voltage of the sensor will be between 0 V (no pressure applied) and roughly 5 V (maximum pressure applied). The Arduino boards contain a multichannel, 10-bit analog to digital converter. This means that it will map the input voltage between 0 and 5 V into integer values between 0 and 1023. So you should see a value between 0 and 1023 in the serial monitor, depending on how hard you squeeze the sensor.

/* FSR simple example code. More info: https://www.makerguides.com */

//Define FSR pin
#define fsrpin A0 //The FSR and 10K pulldown resistor are connected to A0.

//Define variables
int fsrreading; //Variable to store FSR value
 
void setup()
{
//Begin serial communication
Serial.begin(9600); //Starts serial communication at a baudrate of 9600
}
 
void loop()
{
fsrreading = analogRead(fsrpin);  //Reads the FSR pin and stores the output as fsrreading

//Prints the fsrreading in the serial monitor.
Serial.print("Analog reading = ");  //Print the string "Analog reading = ".
Serial.print(fsrreading);           //Prints the fsrreading.
 
 //We can set some threshholds to display how much pressure is roughly applied.
  if (fsrreading < 10) {
    Serial.println(" - No pressure");
  } else if (fsrreading < 200) {
    Serial.println(" - Light touch");
  } else if (fsrreading < 500) {
    Serial.println(" - Light squeeze");
  } else if (fsrreading < 800) {
    Serial.println(" - Medium squeeze");
  } else {
    Serial.println(" - Big squeeze");
  }
  delay(500); //Delay 500 ms.
}

You should see the following output in the serial monitor:

Make sure the serial monitor is also set to a baudrate of 9600. 

Using a Force Sensing Resistor as a toggle switch

In this example you will be using the FSR sensor as a toggle switch. You can use this program to control all kinds of other functions, in this case to switch on and off an LED.

You will have to add a LED with a resistor to the circuit, which is shown in the diagram below.

FSR with Arduino and LED wiring diagram

The negative lead of the LED (the short lead) gets connected to GND via a resistor and the positive lead to digital pin 2. The value of the resistor depends on the color LED you are using. You can use the following values as a guide:

Blue, Green, White or UV: 68 Ω
Red, Yellow or Yellow-Green: 150 Ω 

If you don’t have any of these resistor values, try to find one that is close. You can also put multiple resistors in series, to get the correct value.

The sketch below will toggle the LED on and off when you press on the FSR. It looks at the value of the analog input pin and changes the state of the LED when the value exceeds 500. This means that a really light press won’t be detected.

This example also debounces the input and is based on the Arduino Switch tutorial.

/*FSR as toggle switch for LED example code. More info: https://www.makerguides.com */

//Define pins
#define fsrpin A0      // The FSR and 10K pulldown are connected to A0.
#define ledpin 2       // LED is connected to digital pin 2.

//Define variables
int fsrreading;        // the current reading from the FSR
int state = HIGH;      // the current state of the output pin
int previous = 0;      // the previous reading from the FSR

// the follow variables are long's because the time, measured in miliseconds, will quickly become a bigger number than can be stored in an int.

long time = 0;         // the last time the output pin was toggled
long debounce = 40;    // the debounce time, increase if the output flickers

void setup()
{
//Begin serial communication
Serial.begin(9600); //Starts serial communication at a baudrate of 9600

pinMode(ledpin,OUTPUT); //Set ledpin as an output.
}
 
void loop()
{
fsrreading = analogRead(fsrpin); //Reads the FSR pin and stores the output as fsrreading
Serial.println(fsrreading);

// if the input just went from below 500 to above 500 and we've waited long enough to ignore any noise on the circuit, toggle the output pin and remember the time
 if (fsrreading > 500 && previous < 500 && millis() - time > debounce) {
    if (state == HIGH)
      state = LOW;
    else
      state = HIGH;
    time = millis();    
  }

 digitalWrite(ledpin, state);

  previous = fsrreading;
}

Control multiple LEDs with an FSR as pressure sensor

The example below makes it easy to see how much pressure you apply to the FSR. The more pressure you apply, the more LEDs will turn on. 

You can wire up the LEDs in the same way as before, see the wiring diagram below. The LEDs are connected to digital pin 2 to 7. The FSR is also connected in the same way as before.

FSR-with-many-LEDS-and-Arduino-wiring-diagram-schematic-pinout
FSR with multiple LEDs and Arduino wiring diagram

Because the output voltage of the FSR is non-linear I set up a custom range for each LED to turn on. You might need to tweak this slightly for your own sensor.

/*Control multiple LEDs with FSR as pressure sensor example code. More info: https://www.makerguides.com */

//Define pins
#define fsrpin A0 //The FSR and 10K pulldown resistor are connected to A0.
#define led1 2
#define led2 3
#define led3 4
#define led4 5
#define led5 6
#define led6 7

//Define variables
int fsrreading; //Variable to store FSR value
 
void setup()
{
//Begin serial communication
Serial.begin(9600); //Starts serial communication at a baudrate of 9600
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
pinMode(led5,OUTPUT);
pinMode(led6,OUTPUT);
}
 
void loop()
{
fsrreading = analogRead(fsrpin);  //Reads the FSR pin and stores the output as fsrreading

//Prints the fsrreading in the serial monitor.

Serial.println(fsrreading);           //Prints the fsrreading.
 
//control the LEDs

  if (fsrreading > 200) {
    digitalWrite(led1,HIGH);
  }
  else digitalWrite(led1,LOW);
  if (fsrreading > 450) {
    digitalWrite(led2,HIGH);
  }
  else digitalWrite(led2,LOW);
  if (fsrreading > 550) {
    digitalWrite(led3,HIGH);
  }
  else digitalWrite(led3,LOW);
  if (fsrreading > 650) {
    digitalWrite(led4,HIGH);
  }
  else digitalWrite(led4,LOW);
  if (fsrreading > 800) {
    digitalWrite(led5,HIGH);
  }
  else digitalWrite(led5,LOW);
  if (fsrreading > 900) {
    digitalWrite(led6,HIGH);
  }
  else digitalWrite(led6,LOW);
} 

CAD files

Below you can find all the CAD files for sensors of the interlink 400 Series.

Conclusion

In this article I have shown you how an FSR works and how you can use it with Arduino. I hope you found it useful and informative. If you did, please share it with a friend that also likes electronics!

I would love to know what projects you plan on building (or have already built) with an FSR. Please leave a comment down below and share your ideas.

Share on facebook
Share on twitter
Share on linkedin
Share on pinterest
Share on email
Share on whatsapp

Beginner

Creative Commons License

If you have any questions, suggestions or if you think that things are missing in this tutorial, please leave a comment down below. Note that comments are held for moderation in order to prevent spam.

Leave a Reply

Your email address will not be published. Required fields are marked *