If you’ve ever wanted to detect pressure or measure how hard something is pressed using Arduino, this project is perfect for you. In this tutorial, we’ll show you how to measure force or pressure using an FSR406 Force Sensing Resistor (FSR) with an Arduino UNO and display the measured force in real time on a 0.96” OLED SSD1306 display.
What is an FSR406 Force Sensing Resistor?
An FSR (Force Sensing Resistor) changes its resistance depending on the pressure applied to its surface.
- Higher pressure → lower resistance
- Lower pressure → higher resistance
This change in resistance can easily be read using Arduino’s analog input pins. By processing this analog signal, we can calculate and display the corresponding force or pressure value on an OLED screen.
Project Overview
This simple Arduino project will help you:
- Understand how analog sensors work
- Learn about variable resistance and voltage dividers
- Build your own pressure-sensing or weight-detection system
PCBWay offers high-quality PCB prototyping and assembly at an affordable price, starting at just $5 for 5 PCBs. With fast turnaround, great customer support, and easy online ordering, it’s a top choice for hobbyists and professionals alike.
Components Required
| Component | Quantity | Description |
|---|---|---|
| Arduino UNO | 1 | Main microcontroller board |
| FSR406 Force Sensing Resistor | 1 | Detects pressure/force |
| OLED Display (SSD1306, 0.96”, I²C) | 1 | 128×64 pixel display module |
| 10kΩ Resistor | 1 | Used in voltage divider circuit |
| Breadboard | 1 | For prototyping connections |
| Jumper Wires | — | For circuit connections |
Circuit Diagram and Connections
FSR406 → Arduino UNO
| FSR Pin | Arduino Pin |
|---|---|
| One side of FSR | 5V |
| Other side of FSR | A0 (connected via 10kΩ resistor to GND) |
This setup forms a voltage divider circuit, where the analog pin (A0) measures the voltage that varies with the applied force.
OLED (SSD1306 I²C) → Arduino UNO
| OLED Pin | Arduino Pin |
|---|---|
| VCC | 5V |
| GND | GND |
| SCL | A5 |
| SDA | A4 |
How It Works
- The FSR acts as a variable resistor whose resistance decreases when pressure is applied.
- Arduino reads the resulting voltage change on its analog input pin (A0).
- The analog value (0–1023) is converted into a force estimate (e.g., in Newtons).
- The force value is displayed on the OLED display and printed to the Serial Monitor.
When no pressure is applied, the resistance can be greater than 1MΩ. Under force, it drops drastically, resulting in a higher voltage reading.
Arduino Code
Below is the complete Arduino sketch to read FSR data and display the force on the OLED screen:
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
#define FSR_PIN A0 // FSR connected to analog pin A0
float smoothForce = 0;
float smoothingFactor = 0.15;
void setup() {
Serial.begin(9600);
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println(F("SSD1306 allocation failed"));
for (;;);
}
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(10, 25);
display.println("FSR406 Force Sensor");
display.display();
delay(2000);
}
void loop() {
int fsrReading = analogRead(FSR_PIN); // 0–1023
Serial.print("Raw: "); Serial.println(fsrReading);
float mappedForce = pow((float)fsrReading / 1023.0, 2.5) * 100.0;
smoothForce = (smoothingFactor * mappedForce) + ((1 - smoothingFactor) * smoothForce);
display.clearDisplay();
display.setTextSize(1);
display.setCursor(0, 0);
display.println("FSR406 Pressure Test");
display.setTextSize(2);
display.setCursor(10, 25);
display.print(smoothForce, 1);
display.println(" N");
display.setTextSize(1);
display.setCursor(0, 55);
display.println("Press sensor surface...");
display.display();
delay(100);
}
Output and Results
When you press the FSR406 sensor:
- The OLED display shows the real-time force value increasing.
- The Serial Monitor displays the corresponding analog readings.
- Once released, both readings gradually return to zero.
Experiment Ideas
- Measure grip strength or button press force
- Integrate into a robotic gripper to detect object weight
- Combine multiple FSRs to create a pressure-sensing mat or glove
Calibration Tips
FSR sensors are non-linear — readings depend on factors like resistor value, surface contact, and temperature.
For accurate force measurement:
- Use known weights (e.g., 100g, 200g, 500g) to record analog values.
- Plot a calibration curve in Excel or Python.
- Apply a custom mapping in your Arduino code for more precise results.
Conclusion
This project demonstrates how simple and powerful it is to measure and visualize physical force using an FSR406 Force Sensing Resistor, Arduino UNO, and OLED display.
With a bit of calibration, you can integrate this system into robotics, wearables, or pressure-sensitive devices.
Stay tuned to Circuits-DIY.com for more hands-on tutorials on Arduino, sensors, and IoT projects!