Arduino Nano 33 IoT - Force Sensor
The force sensor is also known as the force sensitive resistor or FSR. This tutorial explains how to use the Arduino Nano 33 IoT with the force sensor. We will learn the following steps:
- How a force sensor works.
- How to hook up the force sensor to an Arduino Nano 33 IoT.
- How to write a program for the Arduino Nano 33 IoT to read data from the force sensor.

Hardware Preparation
Or you can buy the following sensor kits:
1 | × | DIYables Sensor Kit (30 sensors/displays) | |
1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of Force Sensor
A force sensor is a resistor that changes its resistance when force is applied. The harder you press it, the lower its resistance becomes. Force sensors work well for detecting squeezes or pressure, but they are not suitable for measuring weight.
Force Sensor Pinout
A force sensor has two pins. Like a resistor, you don't need to worry about which pin is which.

Wiring Diagram between Force Sensor and Arduino Nano 33 IoT

This image is created using Fritzing. Click to enlarge image
※ NOTE THAT:
Please note that the Arduino Nano 33 IoT pins A4 and A5 have built-in pull-up resistors for I2C communication. This can affect analog readings, so it is recommended to avoid using these pins with any devices/sensors that relies on ADC.
How To Program Force Sensor
The resistance changes along with the voltage. We can use the Arduino Nano 33 IoT’s analog input pin to check the voltage.
Connect one of the force sensor's wires to an analog input pin. This lets you measure a reading that turns into voltage, then resistance, and finally force. Keep in mind, these values are relative.
Arduino Nano 33 IoT Code
Detailed Instructions
If you are new to the Arduino Nano 33 IoT, be sure to check out our Getting Started with Arduino Nano 33 IoT tutorial. Then, follow these steps:
- Connect the components to the Arduino Nano 33 IoT board as depicted in the diagram.
- Use a USB cable to connect the Arduino Nano 33 IoT board to your computer.
- Launch the Arduino IDE on your computer.
- Select the Arduino Nano 33 IoT board and choose its corresponding COM port.
- Copy the code above and paste it into the Arduino IDE.
- Click the Upload button to compile and load the code onto your Arduino Nano 33 IoT board.
- Press the force sensor.
- Look at the Serial Monitor to see the result, which will look like the example shown below.