Voltage Divider Calculator — With ESP32 ADC Reality Checks
Who this is for: For measuring voltages your microcontroller can't take directly — a 12 V battery rail or a 4.2 V LiPo into a 3.3 V ADC pin — and for splitting rails for sensors.
Two-resistor voltage divider: output voltage, divider current and dissipation — plus the R2 value that hits a target voltage, and the ESP32 ADC limits that decide whether your reading will actually be stable.
Quick answer: Vout = Vin × R2 ÷ (R1 + R2). For 12 V measured through 100 kΩ (R1) and 33 kΩ (R2): Vout = 12 × 33 ÷ 133 ≈ 2.98 V — inside a 3.3 V ADC's range. The divider current is Vin ÷ (R1 + R2) ≈ 0.09 mA and the pair dissipates about 1.1 mW. Two checks matter more than the math: keep the divider current between roughly 0.1 and 1 mA so the ADC reads stably, and never exceed 3.3 V on an ESP32 pin, no matter what the ratio says.
Signal being divided (battery, sensor output, rail)
Used by the R2 solver below
| Solve for R2 | Value |
|---|---|
| Exact R2 for 2.5 V with R1 = 10 kΩ | 31.25 kΩ |
| Voltage across R1 / R2 | 2.48 V / 0.82 V |
| ESP32 ADC reality check | Number |
|---|---|
| Safe analog input range | 0 – 3.3 V |
| Practical full-scale (11 dB attenuation) | ≈ 3.1–3.3 V |
| Recommended divider current | 0.1 – 1 mA |
| Formula | Vout = Vin × R2 ÷ (R1 + R2) |
|---|---|
| Solver | gives exact R2 for a target Vout |
| Recommended current | 0.1–1 mA through the divider |
| ESP32 ADC | 0–3.3 V · ADC1 only while Wi-Fi is on |
| Stabilizer | 100 nF capacitor from tap to GND |
How a voltage divider works (and where it lies to you)
A voltage divider is two resistors in series: the input voltage splits across them in proportion to their resistance, and you tap the middle. That's the whole circuit — and it's the most-used (and most-misused) trick for getting a bigger voltage into a smaller ADC.
The classic use on an ESP32: measure a battery. A 4.2 V LiPo can't touch a 3.3 V pin, so R1 = 100 kΩ and R2 = 100 kΩ halves it to 2.1 V at full charge — or 47 kΩ/100 kΩ maps 4.2 V to a full-scale 2.85 V for better resolution. The calculator's second mode solves this backwards: enter Vin, R1 and your target Vout, get the exact R2 and then pick sensible standard values nearby.
Where dividers mislead: they assume nothing is connected to the tap. An ADC input (or anything else) loads the divider and drags Vout down — the ESP32's ADC samples through a small capacitor, so high-impedance dividers (say 1 MΩ) read low and jumpy. Keeping the total resistance in the 1 kΩ–100 kΩ range, adding a 100 nF capacitor from the tap to ground, and staying on ADC1 pins during Wi-Fi use are the three habits that turn a divider from a flaky toy into an instrument.
Common uses
- Monitoring a 12 V or 24 V battery rail from a 3.3 V ADC
- Reading a 4.2 V LiPo's charge level on an ADC1 pin
- Level-shifting a 5 V sensor's analog output into range
- Creating a 1.65 V midpoint reference for a single-supply circuit
- Biasing a microphone or electret module around mid-rail
Choosing resistor values that survive contact with reality
Higher total resistance = less wasted current = more noise and slower settling into the ADC's sampling capacitor. Lower total = stable reading, more drain (0.1–1 mA is the sweet spot for battery projects, which is why you don't use 100 Ω values for a battery gauge). The compromise values people actually use: 100 kΩ/100 kΩ for 2:1, 47 kΩ/100 kΩ for 4.2 V→2.85 V, 100 kΩ/33 kΩ for 12 V→2.98 V, 100 kΩ/10 kΩ for 24 V→2.18 V. Every one of those keeps divider current under 0.3 mA.
The ESP32-specific limits
The ADC reads 0–3.3 V (practically ≈3.1 V with 11 dB attenuation, and readings compress near the top). ADC2 pins stop working while Wi-Fi is active — analog battery monitoring on a Wi-Fi device must use ADC1. And the ADC is not a precision instrument: it's noisy, non-linear near the rails, and ±2% is a realistic expectation before calibration; if you need better, calibrate against a known voltage in software.
Frequently Asked Questions
How do I pick R1 and R2 to measure a 12 V battery with an ESP32?
Why does my voltage divider reading jump around?
Can I measure 5 V with a voltage divider into an ESP32?
Is a voltage divider the same as a level shifter for digital signals?
Why does the divider current matter if I'm measuring a battery?
What is the best resistor pair for a mid-rail reference?
More guides
The AI hardware builds everyone is making: voice assistants, desktop AI boxes, smart displays and AI toys — with the parts list, the wiring, and what each one actually teaches.
The honest answer: data pins drive unlimited addressable LEDs, GPIO pins safely drive one 10 mA indicator — here's the wiring that makes big strips work.
More Electronics calculators
Battery runtime for microcontroller projects: enter capacity, active current, duty cycle and sleep current to get real-world battery life in hours and days — the way it actually behaves on an ESP32-class board.
Series resistor for one or more LEDs: enter supply, forward voltage and target current to get the exact resistance, the nearest E24 value to buy, actual current and the power rating you need.
IPC-2221 trace width for your current, temperature rise and copper weight — external or internal layer — plus resistance and voltage drop when you enter the trace length.
Power supply sizing for LED strips: enter length and W/m to get total watts, total amps, the PSU wattage to buy with headroom, and how many power injection points the strip needs.