5V Analog Sensor to 3.3V ESP32 / STM32 ADC Voltage Divider Calculator

Scale 0–5 V industrial pressure, Hall-effect or MQ analog sensors down to 0–3.0 V for 3.3 V ESP32 and STM32 microcontrollers using E24/E96 pairs.

Jump to results

Inputs

Voltage scaling targets
Leave ~10% headroom below Vref for transients.
MCU ADC constraints
STM32/AVR SAR ADCs typically require R_th ≤ 10 kΩ.
Models leakage / parallel load on R2.

Results

Estimates
Best E24 resistor pairR1 = 10 kΩ · R2 = 15 kΩ
Actual Vout at Vin,max
2.998 V (error -0.06%)
Source impedance (R_th)
5.996 kΩ (Within ADC source limit)
Input resolution
1.34 mV/LSB (0.806 mV/LSB at pin)
ADC code at Vin,max
3,720 / 4,095 (FS = 5.5 V)
Tolerance worst-case
±0.8% (at ±1% R)
Divider quiescent draw
200.2 µA (1 mW)
ADC resistor divider schematic (E24 pair)
Vin,max = 5 VR1 = 10 kΩVout = 2.998 VRth = 5.996 kΩ12-bit ADCVref = 3.3 VR2 = 15 kΩ
Top E24 candidate pairs
R1R2Vout (V)Error %R_thDraw (µA)
10 kΩ15 kΩ2.998-0.06%5.996 kΩ200.2
12 kΩ18 kΩ2.998-0.07%7.195 kΩ166.8
2.4 kΩ3.6 kΩ3-0.01%1.44 kΩ833.5
2.2 kΩ3.3 kΩ3-0.01%1.32 kΩ909.3
16 kΩ24 kΩ2.997-0.1%9.591 kΩ125.2

Add a 10 nF–100 nF ceramic capacitor in parallel with R2 to supply the SAR ADC sample-and-hold charge impulse and filter high-frequency noise.

Interface 5 V ratiometric sensors safely to 3.3 V MCU ADCs

Automotive pressure transducers, ACS712 Hall current sensors and analog ultrasonic rangers commonly output 0.5–4.5 V or 0–5 V signals that exceed 3.3 V microcontroller absolute maximum ratings. A precision 5:3 divider (e.g., 10 kΩ + 15 kΩ) translates 5.0 V cleanly to 3.00 V with R_th = 6.0 kΩ.

For classic ESP32 boards whose ADC saturates above ~2.5 V, load the 2.4 V preset to keep full 0–5 V sensor swings inside the ESP32’s cleanest measurement window.

Formulas

  • Ratio = 3.0 ÷ 5.0 = 0.600 (R1 = 10 kΩ, R2 = 15 kΩ exact in E24!)
  • R_th = 10 kΩ ∥ 15 kΩ = 6.00 kΩ
  • 12-bit input resolution = 5.5 V ÷ 4096 = 1.34 mV/LSB

Worked example

E24 pair R1 = 10 kΩ and R2 = 15 kΩ delivers 2.998 V at 5.0 V (−0.06% loaded error), R_th = 5.99 kΩ, 200 µA sensor load and 1.34 mV/LSB resolution.

Frequently asked questions

Does a 25 kΩ total divider load down a 5 V analog sensor output?

Most active 5 V sensors (like ACS712 or pressure transducers) tolerate ≥4.7 kΩ–10 kΩ loads cleanly; 25 kΩ draws just 200 µA, well within typical output drive limits.

Why not scale 5.0 V all the way to 3.30 V?

If the 5 V USB rail actually sits at 5.15 V or resistor tolerances add +1%, a 3.30 V target clips the ADC top rail; aiming for 3.0 V leaves clean headroom.

Can I use this same 10 kΩ / 15 kΩ divider to level-shift a 5 V SPI or UART signal?

Only at very low speeds (<50 kbps) because 6 kΩ × stray pin capacitance slows rise times; use a dedicated logic level shifter or 74LVC1T45 for digital buses.