Resistive sensors translate physical phenomena—like temperature, force, light, or flex—into a proportional change in electrical resistance. Unlike active sensors that output a direct voltage or digital signal, these passive components require an external excitation voltage to function. The microcontroller never measures the resistance directly; instead, it measures the voltage drop across the sensor when it is paired with a fixed resistor in a voltage divider network.
Because the output is strictly an analog voltage ranging from 0V to your supply voltage (VCC), you must route the signal to an Analog-to-Digital Converter (ADC) pin. Conflating analog and digital outputs is a common beginner mistake; plugging a raw resistive sensor into a digital GPIO pin will only yield a floating HIGH or LOW, completely destroying the analog granularity you need to calculate the physical measurement.
Hardware Interfacing and Wiring Specifications
To read a resistive sensor, you must build a voltage divider. The sensor acts as one half of the divider, and a fixed pull-up or pull-down resistor acts as the other. The junction between them feeds the ADC pin. For the math and tables below, we assume the sensor is connected to GND (pull-down configuration) and the fixed resistor is connected to VCC. This means as the sensor's resistance decreases, the output voltage also decreases.
| Sensor Type | VCC Connection | GND Connection | Signal Pin | Safe Supply Range |
|---|---|---|---|---|
| NTC Thermistor | Fixed Resistor to VCC | Sensor to GND | Analog In (ADC) | 2.5V - 5.5V |
| FSR (Force Sensitive) | Fixed Resistor to VCC | Sensor to GND | Analog In (ADC) | 3.0V - 5.0V |
| LDR (Photoresistor) | Fixed Resistor to VCC | Sensor to GND | Analog In (ADC) | 2.0V - 5.5V |
| Flex Sensor | Fixed Resistor to VCC | Sensor to GND | Analog In (ADC) | 3.3V - 5.0V |
Selecting the correct fixed resistor is critical. The general rule of thumb is to choose a fixed resistor value equal to the sensor's resistance at the midpoint of your expected measurement range. This maximizes the voltage swing and ADC resolution. Below is a data-dense reference for common hobbyist and industrial prototyping resistive sensors.
| Model / Type | Base Resistance | Stimulus Range | V_out @ Midpoint (3.3V VCC) | Typical Cost (2026) |
|---|---|---|---|---|
| 10K NTC (B3950) | 10kΩ @ 25°C | -40°C to +125°C | ~1.65V (at 25°C) | $0.50 |
| Interlink FSR402 | >1MΩ (unloaded) | 0.2N to 20N | ~1.65V (at ~6N load) | $7.50 |
| GL5528 LDR | 10-20kΩ @ 10lux | 1 to 10,000 lux | ~1.65V (at ~50 lux) | $0.20 |
| Spectra 2.2" Flex | 2.5kΩ (flat) | 0° to 90° bend | ~2.10V (at 45° bend) | $12.00 |
From Raw ADC to Physical Units: The Math
Getting a raw ADC reading is only the first step. You must convert that integer into a voltage, then into a resistance, and finally into a physical unit. Let's walk through the exact math using an ESP32 (12-bit ADC, 4095 max value, 3.3V reference) and a 10K NTC thermistor with a 10K fixed pull-up resistor.
Step 1: Raw ADC to Voltage
The ESP32's 12-bit ADC maps 0-3.3V to 0-4095. Note that on standard ESP32 DevKits, the ADC is notoriously non-linear near 0V and 3.3V. For best accuracy, design your divider so the expected readings stay between 0.5V and 2.8V.
V_out = ADC_raw * (V_ref / Resolution)
Example: If ADC_raw = 2048, V_out = 2048 * (3.3 / 4095) = 1.65V.
Step 2: Voltage to Sensor Resistance
Using the voltage divider formula, we solve for the sensor's resistance ($R_{sensor}$). Assuming the fixed resistor ($R_{fixed}$) is tied to VCC and the sensor is tied to GND:
R_sensor = R_fixed * (V_out / (V_cc - V_out))
Example: R_sensor = 10000 * (1.65 / (3.3 - 1.65)) = 10,000 Ω.
Step 3: Resistance to Physical Unit
This step depends entirely on the sensor type. For photoresistors and flex sensors, manufacturers provide a rough logarithmic curve that you can approximate with a polynomial or a lookup table. For Force Sensitive Resistors (FSRs), the conductance (1/R) is roughly proportional to force, allowing for linear interpolation in the mid-range. For NTC thermistors, you must use the Steinhart-Hart equation:
1 / T = A + B * ln(R) + C * (ln(R))^3
Where T is temperature in Kelvin, R is the calculated resistance, and A, B, C are coefficients provided in the thermistor's datasheet. For a standard B3950 10K NTC, a simplified Beta parameter equation is often sufficient for hobbyist tolerances (±1°C):
T = 1 / ((1 / T_0) + (1 / Beta) * ln(R / R_0)) - 273.15
Where $T_0$ is 298.15K (25°C), $R_0$ is 10,000Ω, and Beta is typically 3950.
Calibration and Scaling Strategies
Out-of-the-box resistive sensors rarely yield perfect physical readings without calibration. Manufacturing tolerances on the sensor (often ±5% to ±10%), the tolerance of your fixed resistor (±1% to ±5%), and the internal voltage reference drift of the microcontroller all compound to create measurement errors.
If your microcontroller's ADC uses the main VCC rail as its voltage reference (common on basic Arduino Nanos and some ESP32 configurations), fluctuations in the USB power supply will ruin your readings. Because the voltage divider is also powered by that same VCC, the ratio remains constant even if VCC sags. In your code, calculate the resistance directly from the raw ADC value without converting to voltage first:
R_sensor = R_fixed * (ADC_raw / (Max_ADC - ADC_raw)). This eliminates VCC ripple from your math entirely.
For sensors like the FSR402, where the resistance-to-force curve is non-linear and varies by batch, a multi-point calibration is mandatory for precision work. Place known weights (e.g., 1kg, 5kg, 10kg) on the sensor, record the raw ADC values, and use linear interpolation between those known anchor points in your firmware. Do not rely solely on the generic datasheet curve for load-cell applications.
Interference Sources and Real-World Failure Modes
When your serial monitor shows jittery, bouncing values, the issue is rarely the sensor itself. Resistive sensors output high-impedance analog signals that act as magnets for electrical noise. Here are the primary interference sources and how to engineer them out of your design.
- Electromagnetic Interference (EMI): Long, unshielded wires between the sensor and the microcontroller act as antennas, picking up 50/60Hz mains hum and RF noise from nearby WiFi antennas. Fix: Use twisted-pair wire for the sensor leads. Add a hardware RC low-pass filter at the microcontroller pin (e.g., a 100Ω series resistor and a 100nF ceramic capacitor to GND) to physically roll off high-frequency noise before it hits the ADC sample-and-hold circuit.
- Self-Heating (Thermistors): Passing too much current through an NTC thermistor causes it to heat itself, resulting in a temperature reading that is artificially high. Fix: Keep the excitation current below 50µA. With a 10K fixed resistor and a 3.3V supply, the maximum current is roughly 165µA, which is acceptable for glass-encapsulated beads but may cause a 0.5°C error in tiny epoxy-coated beads. Increase the fixed resistor to 100K if high precision is required at low temperatures.
- Lead Resistance: For low-resistance sensors (like RTDs or thick-film linear potentiometers), the resistance of the copper hookup wires (often 0.5Ω to 2Ω) adds directly to the sensor reading. Fix: For sub-100Ω sensors, abandon the simple 2-wire voltage divider and use a 3-wire or 4-wire Kelvin connection with an instrumentation amplifier.
- ADC Input Impedance Loading: Microcontroller ADC pins have an internal sampling capacitor that must charge during the conversion window. If your voltage divider uses very high-value resistors (e.g., >100kΩ) to save power, the ADC pin's internal impedance will drag the voltage down, causing non-linear readings. Fix: Keep the Thevenin equivalent resistance of your voltage divider below 10kΩ, or place a unity-gain op-amp buffer between the divider and the ADC pin.
By combining proper hardware filtering, ratiometric math, and targeted calibration, you can extract highly reliable, lab-grade data from even the cheapest resistive sensors. For deeper integration specifics on force sensors, refer to the Interlink Electronics FSR Integration Guide for mechanical mounting best practices, which heavily influence the electrical output consistency.






