Battery ADC measurement and divider sizing
Inputs
Outputs
Enter battery and ADC settings to evaluate divider safety and resolution.
Calculate battery divider ratio, ADC pin voltage, raw ADC code, battery-side LSB, divider current, and safety margin for MCU battery monitoring.
Enter battery and ADC settings to evaluate divider safety and resolution.
Most microcontroller ADC pins cannot accept full battery voltage directly. A resistor divider scales battery voltage into the ADC input range.
The divider ratio is Rbottom / (Rtop + Rbottom). ADC pin voltage equals battery voltage multiplied by this ratio.
Battery-side LSB estimates how much battery voltage one ADC code step represents after divider scaling.
Lower resistor values increase divider current and power loss. Very high resistor values reduce current draw but can increase ADC sampling error depending on ADC input impedance and sampling time.
| Battery | Max voltage | Divider example | ADC voltage | Notes |
|---|---|---|---|---|
| 1S Li-ion | 4.2 V | 100k + 100k | 2.10 V | Safe for 3.3V ADC |
| 2S Li-ion | 8.4 V | 200k + 100k | 2.80 V | Common 3:1 divider |
| 3S Li-ion | 12.6 V | 300k + 100k | 3.15 V | Near 3.3V full scale |
| 12V Lead-acid | 14.4 V | 390k + 100k | 2.94 V | Charging voltage example |
This calculator uses an ideal ADC model. Real devices, especially ESP32 ADC channels with attenuation and calibration effects, can show nonlinear behavior and offset.
Use a resistor divider so the ADC pin stays below Vref, then convert ADC code back to battery voltage using the divider ratio.
For 1S Li-ion with 3.3V ADC, 100k/100k is a common starting point. For higher-cell packs, use a larger top resistor ratio to keep ADC pin voltage under Vref.
Divider current flows continuously and can impact battery life in low-power designs. Higher resistances reduce current but may require ADC sampling adjustments.
ESP32 ADC readings depend on attenuation, calibration, channel characteristics, and analog front-end behavior. This tool gives an ideal first-order estimate.
Many low-power designs gate the divider with a MOSFET or enable it only during measurement to reduce standby current.