A resistive sensor changes its electrical resistance in response to physical deformation, such as force, bend, or stretch. To interface it with a microcontroller like an ESP32, you cannot read the sensor directly; you must use a voltage divider circuit to convert its variable resistance into an analog voltage. Once the ADC reads this voltage, you apply inverse-math to calculate the physical unit (like Newtons or degrees of bend). For 90% of DIY force, squeeze, and pressure projects, the Interlink Electronics FSR 402 is the definitive, most reliable part to buy.

The Sensing Principle: How Resistive Transducers Work

Resistive sensors rely on Polymer Thick Film (PTF) technology. They consist of two membrane layers separated by a thin spacer. One layer contains a conductive carbon or silver ink pattern, while the other features a resistive polymer coating. When physical force is applied, the layers compress, increasing the contact area between the conductive traces and the resistive material. This expanded contact area creates more parallel electrical paths, which predictably lowers the overall electrical resistance of the device.

The mechanics differ slightly depending on the physical variable being measured. In Force Sensitive Resistors (FSRs), applied pressure compresses the layers, dropping resistance from >1MΩ (no force) down to ~1kΩ (heavy squeeze). In flex sensors, the conductive carbon trace is embedded in a flexible substrate; bending the sensor stretches the trace, microscopically fracturing the carbon matrix and increasing resistance. Regardless of the direction of change, the microcontroller only sees a variable resistor.

Hardware Interfacing: ESP32 Wiring and Pinout

Callout: What is the actual output?
A resistive sensor outputs variable resistance, not a voltage or digital signal. Microcontroller GPIO pins cannot read resistance directly. You must convert this resistance into an analog voltage (0V to 3.3V) using a passive voltage divider before the ESP32's Analog-to-Digital Converter (ADC) can measure it.

The ESP32 operates at 3.3V logic. Supplying 5V to the voltage divider will fry the ADC pin. We use a 10kΩ pull-down resistor to create the divider, which provides the best dynamic range for the FSR 402's typical 20g to 10kg force curve.

Table 1: ESP32 to Resistive Sensor Wiring Specification
ESP32 Pin Function Connection Target Notes / Supply Range
3V3 Power Supply FSR Pin 1 Strictly 3.3V. Max current draw is <2mA.
GND Ground Reference 10kΩ Resistor (Leg 2) Must share common ground with ESP32.
GPIO 34 Analog Input (ADC) Junction of FSR Pin 2 & 10kΩ Resistor ADC1_CH6. Input only, no internal pull-up.

The Math: Converting Raw ADC to Force (Newtons)

Getting a raw number from analogRead() is useless without conversion. Here is the exact mathematical path from raw ADC bits to physical force, utilizing the modern ESP32 Arduino core features.

Step 1: ADC Reading to Millivolts

Older tutorials map the ESP32's 12-bit ADC (0-4095) directly to 3.3V. Do not do this. The ESP32 ADC is notoriously non-linear. Instead, use the analogReadMilliVolts() function. This function reads the raw ADC value and applies the factory-programmed eFuse calibration data (Vref) to output a highly accurate millivolt reading, bypassing the worst of the hardware non-linearity.

Step 2: Millivolts to Sensor Resistance

Using the standard voltage divider formula, we isolate the sensor's resistance ($R_{fsr}$). With a 3300mV supply ($V_{cc}$) and a 10,000Ω pull-down resistor ($R_{pull}$):

  • $R_{fsr} = R_{pull} \times \left( \frac{V_{cc}}{V_{out}} - 1 \right)$
  • Example: If $V_{out}$ is 1650mV (mid-scale), $R_{fsr} = 10000 \times (3300/1650 - 1) = 10,000\Omega$.

Step 3: Resistance to Conductance and Force

FSR resistance is highly non-linear, but its conductance ($G = 1 / R_{fsr}$) is remarkably linear with respect to applied force in the sensor's rated range. According to the Adafruit FSR Integration Guide, the FSR 402 yields roughly 0.00008 Siemens per Newton in its linear region.

// ESP32 Resistive Sensor Math (Arduino Core 3.x / ESP-IDF 5.x)
const int FSR_PIN = 34;
const float VCC_MV = 3300.0;
const float R_PULL = 10000.0; // 10k Ohm pull-down
const float CONDUCTANCE_SLOPE = 0.00008; // Siemens per Newton (approx for FSR402)

void setup() {
  Serial.begin(115200);
  analogSetAttenuation(ADC_11db); // Required for full 0-3.3V range on ESP32
}

void loop() {
  // Step 1: Get calibrated millivolts (uses internal eFuse Vref)
  int vOut_mv = analogReadMilliVolts(FSR_PIN);
  
  if (vOut_mv < 50) { 
    Serial.println("Force: 0.00 N (No touch)"); 
    delay(100); return; 
  }

  // Step 2: Calculate Sensor Resistance
  float rFsr = R_PULL * ((VCC_MV / vOut_mv) - 1.0);
  
  // Step 3: Convert to Conductance (Siemens) then to Force (Newtons)
  float conductance = 1.0 / rFsr;
  float forceNewtons = conductance / CONDUCTANCE_SLOPE;
  
  Serial.printf("V: %dmV | R: %.0f Ohms | Force: %.2f N\n", vOut_mv, rFsr, forceNewtons);
  delay(50);
}

Signal Integrity: Calibration and Interference Sources

Even with perfect math, real-world bench conditions introduce errors. Here is how to handle the three most common interference sources when working with resistive sensors on the ESP32.

1. ESP32 ADC Edge Non-Linearity

The ESP32 ADC struggles to resolve voltages below 100mV and above 3100mV accurately. If your voltage divider pushes $V_{out}$ into these zones, your force readings will plateau or jump erratically. The fix: Size your pull-down resistor so that the expected middle of your force range outputs ~1.65V. If you are measuring very heavy forces (low FSR resistance), drop the pull-down to 1kΩ. For very light touches, increase it to 33kΩ.

2. Thermal Drift and Hysteresis

The conductive polymer in FSRs exhibits a temperature coefficient of roughly -0.5% per °C. Furthermore, FSRs suffer from mechanical hysteresis; the resistance reading during a force release will be slightly lower than during force application. If your project requires medical-grade or industrial-scale precision, you must implement a software tare function that zeroes out the baseline resistance on boot, and avoid using bare FSRs for continuous static load measurement (creep will occur over hours).

3. Electromagnetic Interference (EMI) and Lead Resistance

Because the sensor outputs a high-impedance analog signal, the wires act as antennas for 50/60Hz mains hum and switching noise from nearby DC motors. Keep the wire run between the sensor and the ESP32 under 12 inches. If you must run longer cables, use shielded twisted-pair wire and add a 0.1µF ceramic capacitor in parallel with the 10kΩ pull-down resistor to form a low-pass hardware filter.

Decision Tree: Which Resistive Sensor Should You Buy?

Not all resistive sensors measure the same physical property. Use this decision matrix to select the exact part number for your embedded project. Do not waste time trying to force a flex sensor to measure squeeze, or an FSR to measure bend angle.

Table 2: Resistive Sensor Selection Decision Path
If your application requires... And the physical action is... Buy this exact part number Approx. Cost (2026)
Measuring joint angles, glove fingers, or hinge deflection. Bending / Flexing (Resistance increases with bend) Spectra Symbol Flex Sensor 2.2" $12.50
Detecting liquid levels or moisture presence. Capacitive/Resistive bridging via water DIY Copper Tape + Foam (or DFRobot SEN0114) $3.00
Measuring ambient light levels. Photon absorption (Resistance drops with light) Advanced Photonix PDV-P9002 (CdS LDR) $1.50
Measuring squeeze, button presses, weight, or impact force (0.2N to 20N). Compression / Pressure (Resistance drops with force) Interlink Electronics FSR 402 (Default Pick) $8.95

The Verdict: If you are building a MIDI controller, a smart insole, a robotics gripper, or any project requiring you to measure how hard something is being pressed, terminate your search and buy the Interlink Electronics FSR 402. It offers the best balance of linear conductance response, mechanical durability (rated for >1 million actuations), and extensive documentation compared to cheaper, unbranded clone films found on marketplace sites, which suffer from severe batch-to-batch resistance variance.

For deeper technical specifications on the ESP32's ADC hardware architecture and calibration routines, refer to the official Espressif ADC Oneshot Driver Documentation.