Force Sensor

The Force Sensor project utilizes an Arduino Nano to measure and monitor the output of a force sensor. This project is valuable in applications where the measurement of physical force or pressure is required, such as in robotics, biomechanics, or industrial automation.

How It Works

A force-sensitive resistor (FSR) is a polymer film whose resistance drops as pressure squeezes its conductive particles closer together. Unloaded it measures in the megohms; under firm finger pressure it falls to a few hundred ohms. That is a usefully wide range, but the relationship is logarithmic and quite imprecise — FSRs sense force, they do not measure it accurately.

Because a microcontroller reads voltage rather than resistance, the FSR is wired as one half of a voltage divider with a fixed resistor. The choice of that resistor sets which part of the force range gets the most resolution: 10 kΩ is a sensible general-purpose starting point, while a larger value favours light touches and a smaller one favours heavy pressure.

The Arduino Nano samples with a 10-bit ADC, so analogRead() returns 0–1023 across 5 V. Expect repeatability of roughly ±10% between presses on the same sensor, and considerably more between different sensors. Anything needing real accuracy — a scale, for instance — calls for a load cell and an HX711 amplifier instead.

Components Needed

  • Arduino Nano
  • Force Sensitive Resistor module
  • Arduino Nano
  • USB cable for programming and power
  • Arduino Nano

Wiring to the Arduino Nano

Wire one FSR leg to the 5 V rail and the other to A0, then connect the 10 kΩ resistor from A0 to GND. As force increases, FSR resistance falls, so the midpoint voltage — and the ADC reading — rises.

FSRs are unpolarised, so the two legs are interchangeable. Their tails are delicate: solder quickly or, better, use a crimp connector, because excessive heat delaminates the film permanently.

Press through a small rigid pad rather than directly with a fingertip. Spreading load across the whole active area makes readings far more consistent, which is how commercial FSR buttons are built.

ConnectionArduino Nano pinFunction
FSR leg 15VSupply
FSR leg 2A0Divider midpoint — the measured node
10 kΩ resistorA0 to GNDFixed half of the divider

Build and Upload

Connect the Arduino Nano to your computer using a USB cable.

Open the Arduino IDE and paste the provided code.

Select the appropriate board (Arduino Nano) and port from the Tools menu.

Upload the code to the Arduino Nano.

Once the code is uploaded, open the serial monitor.

Observe the force sensor values displayed on the serial monitor as force is applied to the sensor.

Example Code

Reading an FSR and classifying pressure into usable bands. Upload it with the board set to Arduino Nano and open the Serial Monitor at 9600 baud.

Reading an FSR and classifying pressure into usable bands
const int FSR_PIN = A0;
const long SERIES_OHMS = 10000;
const float VREF = 5.0;
const int   ADC_MAX = 1023;

void setup() { Serial.begin(9600); }

void loop() {
  int raw = analogRead(FSR_PIN);

  if (raw < 10) {
    Serial.println("no pressure");
  } else {
    // Recover the FSR resistance from the divider
    float volts = raw * VREF / ADC_MAX;
    float fsrOhms = SERIES_OHMS * (VREF - volts) / volts;

    Serial.print("raw=");
    Serial.print(raw);
    Serial.print("  R=");
    Serial.print(fsrOhms, 0);
    Serial.print(" ohm  ");

    if      (raw < 205) Serial.println("light touch");
    else if (raw < 614) Serial.println("medium press");
    else                                          Serial.println("firm press");
  }
  delay(200);
}

Applications

A force sensitive resistor turns up in a wide range of projects. These are the uses where it is the right choice rather than a compromise:

  • Pressure-sensitive buttons and musical interfaces with velocity response
  • Occupancy detection in seats, beds and mats
  • Grip-strength feedback on robotic hands and prosthetics
  • Detecting whether an object is present and roughly how heavy it is
  • Touch-sensitive panels behind a flexible surface

Working with the Arduino Nano

The Arduino Nano is built around the ATmega328P and runs on 5 V logic with 2 KB of SRAM and 32 KB of program flash. These details change how this circuit is wired and what the sketch can do, so they are worth stating plainly before you build.

The Nano shares the Uno’s ATmega328P but adds A6 and A7, which are analog-input only and cannot be used as digital pins.

Its DIP footprint drops straight into a breadboard, which suits permanent sensor builds.

Older clones use the CH340 USB bridge and may need that driver plus the "ATmega328P (Old Bootloader)" processor option.

Arduino Nano characteristicValueWhy it matters here
Logic voltage5 VMatches most hobby modules directly
ADC resolution10-bit (0–1023)Sets how finely an analog reading can be resolved
Analog inputsA0–A7 (eight channels, two more than the Uno)Determines how many analog sensors can share the board
PWM outputsD3, D5, D6, D9, D10 and D11Needed for brightness, speed and tone control
I²C pinsA4 (SDA) and A5 (SCL)Fixed by hardware — wiring copied from another board may not match
Interrupt pinsD2 and D3 onlyRequired for counting fast or asynchronous events
Seriala single hardware UART shared with USBMonitor runs at 9600 baud by default

Troubleshooting

Most problems with this module fall into a handful of categories. Work through these before suspecting the part itself:

  • The reading never returns to zero after a press — the film is slow to relax, which is normal. Allow a settling period or subtract a drifting baseline.
  • Light touches barely register — increase the series resistor to 47 kΩ or 100 kΩ to favour the low-force end.
  • Readings differ between two identical sensors — unit-to-unit variation is large. Calibrate each one individually.
  • The sensor stopped working after soldering — the tail has delaminated from heat; use connectors in future.
  • Code written for an ESP board gives odd analog values — the Arduino Nano uses a 10-bit ADC returning 0–1023; rescale any constant taken from a 12-bit example.
  • An I²C sensor is not found after copying wiring from another Arduino — on the Arduino Nano I²C is on A4 (SDA) and A5 (SCL).

Taking It Further on the Arduino Nano

Once the basic reading works, where you go next depends very much on which board you are using. These are the directions that suit the Arduino Nano specifically:

The Nano’s DIP footprint makes it the natural choice once a breadboard prototype becomes a soldered build. Mount it on female headers rather than soldering it down, so the board can be recovered if the project is retired.

With A6 and A7 available in addition to A0–A5, the Nano can read two more analog sensors than an Uno. Remember that those two pins are analog-input only — they cannot be used with digitalWrite or as digital inputs.

For battery-powered builds, the Nano’s regulator and USB bridge dominate idle current. Powering the 5V pin directly from a regulated supply and removing the power LED substantially extends runtime.

Notes and Practical Limits

Think of an FSR as a qualitative input. "Something is pressing, and roughly this hard" is reliable; "this object weighs 212 grams" is not.

For weight measurement use a load cell with an HX711 24-bit amplifier. That combination resolves single grams and holds calibration, which an FSR cannot approach.