All articles

    The Voltage Divider: When It Works and When It Fools You

    The two-resistor voltage divider explained: the formula, practical examples (measuring a battery with an ADC and turning a 5 V signal into 3.3 V), how to choose the resistors step by step, why you can't power a load from it, and what to use instead.

    Updated 7 min read

    Two resistors in series, and you take the voltage from the point between them. It's one of the simplest and most widely used circuits in electronics. It's also one of the most misused, and the classic mistake is using it to produce a voltage to power something.

    In this article we'll go through the formula, how to design a divider to measure a battery with an Arduino or ESP32 without damaging the input, the mistakes that make readings wrong, and when to drop the divider and use a regulator instead.

    The formula

    R1 sits on top (towards the input), R2 at the bottom (towards ground), and the output is the point between them:

    Vout = Vin × R2 ÷ (R1 + R2)

    So the output is a fixed fraction of the input, and the two resistors set that fraction. If both resistors are equal, the output is exactly half the input.

    Example: 5 V input, R1 = 10 kΩ, R2 = 20 kΩ:

    • Vout = 5 × 20 ÷ 30 ≈ 3.33 V.

    Why does it work? The same current flows through both resistors (they're in series), so the voltage splits between them in proportion to their values, just as Ohm's law says: the bigger resistor takes the bigger share. And if you want to know why the two voltages always add up to exactly the input, that's Kirchhoff's voltage law.

    Uses that work well

    Measuring a battery with a microcontroller

    The ESP32's ADC inputs, for example, top out at 3.3 V. To measure a 12 V battery you have to bring the voltage down first.

    A 12 V lead-acid battery can reach about 14.4 V while charging, so the ratio has to handle that:

    • R1 = 39 kΩ, R2 = 10 kΩ.
    • At 14.4 V: Vout = 14.4 × 10 ÷ 49 ≈ 2.94 V (safe).
    • At 12 V: Vout ≈ 2.45 V.
    A 12 V battery measured with a 39k/10k divider and a 100 nF capacitor before the ESP32's ADC pin
    A 12 V battery measured with a 39k/10k divider and a 100 nF capacitor before the ESP32's ADC pin

    In code you multiply the reading by 4.9 to get back the real battery voltage. The divider draws only about a quarter of a milliamp here, so it won't drain the battery. If the project has to run for months on that battery, even that quarter milliamp can matter; then you switch the divider with a transistor and connect it only while measuring. The full details are in the article on measuring battery voltage.

    Turning a 5 V signal into 3.3 V

    If a 5 V module (like an Arduino Uno) sends data to a 3.3 V ESP32, a 1 kΩ resistor with 2 kΩ below it brings the 5 V down to about 3.33 V. This works well for slow, one-way signals such as UART. For high speeds or two-way lines, use a level shifter. All the options are covered in the level shifting article.

    Sensors whose resistance changes

    An LDR (light sensor) and an NTC thermistor change their resistance, but a microcontroller doesn't read resistance, it reads voltage. The trick: put the sensor in place of R1 or R2 and a fixed resistor in the other spot, and the change in resistance becomes a change in voltage. See the light and temperature sensors article.

    Setting a regulator's output

    The LM317 and buck modules set their output voltage with a divider on the feedback pin. When you turn the trimmer on a buck module, you're changing a divider's ratio. Its own formula is in the LM317 article.

    Choosing the two resistors step by step

    1. Find the highest voltage that can ever come in, not just the normal one. A 12 V battery reaches 14.4 V while charging. A "12 V" solar panel can reach 22 V with no load.
    2. Find the input's maximum voltage, with margin: 3.3 V for the ESP32, so aim for about 3 V.
    3. Work out the ratio: 3 ÷ 14.4 ≈ 0.21, meaning R2 ÷ (R1 + R2) = 0.21.
    4. Pick R2 (say 10 kΩ) and calculate R1 = R2 × (Vin ÷ Vout − 1) = 10 × (14.4 ÷ 3 − 1) = 38 kΩ.
    5. Round R1 up to the next standard value (39 kΩ) so the output goes down, not up. Standard values have their own article.
    6. Recalculate the output with the real values at the highest input and check it's below the limit.

    The big mistake: powering a load from the divider

    Take the same divider that gave 3.33 V and connect a 1 kΩ load to its output (a small module, say). That load is now in parallel with R2, so the bottom resistance becomes about 952 Ω instead of 20 kΩ, and the output drops to just 0.43 V!

    Same two resistors: 3.33 V with no load, and down to 0.43 V once a 1 kΩ load is connected
    Same two resistors: 3.33 V with no load, and down to 0.43 V once a 1 kΩ load is connected

    Worse still, that voltage isn't stable: it changes with every change in what the load draws.

    What if I use smaller resistors?

    If you use very small resistors so the load barely affects them, the divider itself draws a large current and wastes energy as heat. The usual rule is that the divider current should be at least 10 times the load current, which usually means a lot of waste.

    Example: you want 5 V from 12 V for a module drawing 100 mA. If the divider passes 1 A (ten times the load), the power wasted in it is 12 × 1 = 12 W, to feed a load that needs half a watt! Not to mention that the resistors themselves would have to be large power resistors.

    So: a divider is for signals and measurement (things that draw almost no current). To power a circuit at a lower voltage, use a regulator such as an LM317, an LDO, or a buck converter. The comparison is in the buck vs linear regulator article.

    Why is my reading off?

    • Resistor tolerance: two 5% resistors can give up to a 10% error in the ratio in the worst case. 1% resistors fix most of this; for better accuracy, calibrate: measure the real voltage with a multimeter and adjust the factor in your code.
    • ADC input impedance: the ADC charges a tiny internal capacitor on every reading. If the divider's resistance is too high, that capacitor doesn't charge in time and the reading comes out low. The Arduino Uno, for example, is designed for a source resistance of about 10 kΩ or less. If you use large values (say 100 kΩ) to save current, add a 100 nF capacitor from the output to ground; it supplies the charge the ADC needs.
    • The multimeter itself loads the circuit: most digital multimeters have about 10 MΩ input resistance. If your divider is in the megaohm range, the meter acts as a parallel load and reads low.
    • No common ground: if you're measuring a voltage from another source, its ground must connect to the microcontroller's ground, otherwise the reading is random. Read what ground means.
    • The ADC itself isn't accurate: the ESP32 in particular is non-linear near 0 and near 3.3 V. Keep the voltage mid-range if you can; details in the ADC article.

    Tips

    • Resistor values: 10 kΩ to 100 kΩ suits most measurement uses. Very large values can make ADC readings unstable; the fix is a small capacitor (100 nF) from the output to ground.
    • Accuracy: use 1% resistors if the measurement needs to be precise.
    • Protect the input: calculate the output at the highest possible input voltage, not just the normal one.
    • Resistor power: with high voltages, check the power in R1 with P = V² ÷ R, especially with small resistor values.

    FAQ

    Can I use a potentiometer as a voltage divider? Yes, a potentiometer is a ready-made voltage divider: the two ends go to the voltage and ground, and the middle pin is the output. Same rule though: signals only, not power. Read the potentiometer article.

    Can I measure 220 V mains with a divider? No, never directly. The circuit would be connected to mains with no isolation between it, the microcontroller, and your hand. Use a small transformer or an isolated measurement module.

    The output changes even though the input is steady? Most likely there's a load on the output, the microcontroller pin is accidentally set as an OUTPUT, or the wires are long and picking up noise. Remove any load and add a 100 nF capacitor.

    Calculate it in a second

    The voltage divider calculator works out the output from the two resistors, or tells you which R2 gives a target voltage, and suggests the nearest standard value. And if you really need a supply, try the LM317 calculator.

    Circuits Nerd
    © 2026 Circuits Nerd. All rights reserved.