Tool 10 · Electronics
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.
3S LiPo full = 12.6 V · 4S = 16.8 V · 2S = 8.4 V
Input voltage must be above the ADC reference.
Divider spec
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.
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.
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.
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.
Links may be affiliate links (see footer disclosure).