A voltage divider is two resistors in series with an output tap between them. You’ve seen the formula a thousand times: Vout = Vin × R2 / (R1 + R2). The problem is what that formula doesn’t tell you.
The tolerance stack
You order 10 kΩ resistors. They arrive as 1% tolerance parts — so anywhere from 9.9 kΩ to 10.1 kΩ. Your divider has two of them, and their errors compound.
Worst case with 1% resistors: R1 = 10.1 kΩ, R2 = 9.9 kΩ. Output ratio: 9.9 / 20.0 = 49.5%. Or R1 = 9.9 kΩ, R2 = 10.1 kΩ. Output ratio: 10.1 / 20.0 = 50.5%. That’s ±1% on the output ratio — which maps directly to ±1% on your ADC reading.
For a 3.3 V ADC measuring 0–5 V through a divider, ±1% is ±33 mV. On a 12-bit ADC with 0.8 mV resolution, that’s 41 LSBs of fixed offset error before you even start.
Use the voltage divider calculator to model the combined tolerance of both resistors before you commit to a design.
Load impedance kills your accuracy
The formula assumes the output drives an infinite impedance load. Nothing has infinite impedance.
An STM32 ADC input has a maximum source impedance requirement of about 10 kΩ (from the datasheet: the internal sample-hold capacitor charges through the source impedance, and you need the charging to complete within the acquisition time). If your divider has a Thevenin impedance of 5 kΩ (two 10 kΩ resistors in parallel) and you want < 1 LSB error on a 12-bit ADC with 10 µs acquisition time, you’re at the edge.
The fix is to use low-value resistors (1 kΩ or less) or buffer the output with a unity-gain op-amp. Low-value resistors draw more current — a 1 kΩ / 1 kΩ divider across 5 V draws 2.5 mA continuously. Fine for a mains-powered design, unacceptable for a battery-powered sensor.
The battery voltage measurement case
Common pattern: measure a LiPo (4.2 V max) with a 3.3 V MCU ADC. Two resistors divide 4.2 V to ~2.8 V. The MCU wakes from sleep every 30 seconds, reads the ADC, then sleeps.
If you use 100 kΩ + 100 kΩ, the divider draws 21 µA continuously. Over a month: 0.021 mA × 720 h = 15 mAh gone just from the resistors. On a 1000 mAh LiPo, that’s 1.5% wasted.
Better: put a GPIO between VCC and the top of the divider. Pull it high only when sampling, leave it floating (or low, with a second resistor to ground) between samples. The measurement window is < 100 µs, so the energy cost is negligible.
Choosing resistor values
The tradeoffs:
- High values (100 kΩ+): low quiescent current, but load error and ADC input impedance become significant
- Low values (1 kΩ–10 kΩ): good accuracy, but constant current draw
- Matched pairs: buying resistors from the same batch or using a resistor network improves the ratio accuracy even with loose absolute tolerance (ratio tracking is often ±0.1% on networks vs ±1% on individual parts)
For most battery-powered ADC applications: 100 kΩ + 47 kΩ (to give ~0.32 ratio) switched via GPIO. For always-on accuracy-critical measurements: 10 kΩ values with a buffer op-amp.
Temperature coefficient
1% resistors have a temperature coefficient (tempco) of typically 100 ppm/°C. Over a 50 °C temperature range, that’s 0.5% drift per resistor. If R1 and R2 track each other (same type, close on the PCB), the drift cancels. If they don’t track — one gets heated by a nearby component — the ratio drifts.
In automotive or industrial designs where temperature swings are large, use 0.1% resistors with 25 ppm/°C tempco, or a matched resistor network where both elements are guaranteed to track.
The voltage divider calculator shows the combined worst-case error from tolerance. For tempco analysis you need the datasheet spec and a spreadsheet, but the tolerance number gives you the starting point.