Tool 10 · Electronics

Voltage Divider Calculator

Your battery speaks 12 volts; your ADC pin listens up to 3.3. A voltage divider is the two-resistor translator between them. This tool picks real resistor values you can actually buy, and writes the code constant for you.

What you're measuring

3S LiPo full = 12.6 V · 4S = 16.8 V · 2S = 8.4 V

Input voltage must be above the ADC reference.

Divider spec

R1 (top, to input)
R2 (bottom, to ground)
Output at max input
Current drain
Measurement resolution
Code constant (V per ADC count)

How this calculator works

Vout = Vin × R2 ÷ (R1 + R2)
Target ratio = (V_ref × margin) ÷ V_in_max
R1, R2 snapped to the E24 standard series
Battery voltage in code = ADC reading × constant above

The tool works backwards from what you can buy: it searches the E24 standard resistor series for the pair whose ratio lands closest to your target while keeping the output safely below the ADC reference. That's why the output voltage shown is the actual voltage with those real resistors, not the ideal — the difference goes straight into your code constant so the reading comes out right anyway.

Resistors have tolerance. Two 5% resistors can shift the ratio by several percent, which on a 12.6 V pack is a third of a volt of reading error — the difference between "half full" and "land now" on a LiPo. Use 1% metal-film resistors for battery monitors, or calibrate once against a multimeter and adjust the constant.

The current-drain figure matters for always-connected monitors: a 10 kΩ-range divider across a 3S pack leaks about 0.4 mA forever — enough to murder a small pack left plugged in for weeks. The 100 kΩ range cuts that tenfold at the cost of a noisier reading (fix: 100 nF from the ADC pin to ground, and average a few samples in code).

Knowing the pack voltage is step one of power monitoring; step two is knowing whether the pack can deliver the current — that's the Battery C-Rating Checker — and the Power Budget Calculator tells you what the rest of the robot is asking of it.

Common questions

Which resistor is R1 and which is R2?

R1 connects the input voltage to the ADC pin; R2 connects the ADC pin to ground. Swap them and the output roughly inverts — a 12.6 V input suddenly presents 9+ volts to a 3.3 V pin, which is how magic smoke gets released. Double-check before power-up.

Why not just use a ready-made voltage sensor module?

Those modules are this divider (usually 30 kΩ / 7.5 kΩ, ratio 5:1) on a breakout board. Fine to buy — but now you know what's on it, and you can check whether its ratio actually suits your pack and your ADC reference.

Parts this calculation leads to

Links may be affiliate links (see footer disclosure).

Resistor Kits

1% metal-film assortments covering the full E24 series.

Browse resistor kits →

Multimeters

Calibrate your divider once and trust it forever.

Browse multimeters →

Level Shifters

Bidirectional 3.3 ↔ 5 V modules for logic signals.

Browse level shifters →

ADC Modules

ADS1115 16-bit ADCs when the onboard ADC isn't enough.

Browse ADC modules →