Key Engineering Takeaways
- •A voltage divider produces an output voltage proportional to the ratio of two resistors: V_out = V_in · R_2 / (R_1 + R_2).
- •Use voltage dividers to safely step down 5V logic signals to 3.3V for ESP32/Raspberry Pi GPIO pins.
- •Variable sensors (LDRs, thermistors) require a fixed pull-up or pull-down resistor to convert changing resistance into readable voltage.
- •NEVER use a resistive voltage divider as a DC power supply to power motors or chips: connecting a load draws current and causes V_out to collapse.
- •Add an Op-Amp Voltage Follower (Buffer) to isolate high-impedance divider outputs before feeding into low-impedance ADC circuits.
- • Ohm's Law and Series Circuits
- • Breadboard
- • 5V / 12V Power Source
- • Resistors (1kΩ, 2kΩ, 10kΩ)
- • LDR Photoresistor
- • Multimeter
What is a Voltage Divider? Mathematical Derivation
A Voltage Divider is a simple circuit of two series resistors that converts a larger input voltage (V_in) into a smaller, precise output voltage (V_out).
Mathematical Derivation:
- 1Current flowing through series resistors R_1 and R_2 is:
- 2Output voltage across R_2 (referenced to ground) is Ohm's Law (V = I · R_2):
Stepping Down High Voltages for Microcontrollers (5V to 3.3V)
Modern microcontrollers (ESP32, RP2040, STM32) operate on 3.3V logic and will be destroyed if connected directly to 5V Arduino signals or 12V battery rails.
Example: 5.0V to 3.3V Logic Level Shifter:
- Desired: V_in = 5.0V, V_out = 3.30V
- Choose standard R_2 = 2.0 kΩ (2000 Ω) and R_1 = 1.0 kΩ (1000 Ω):
This provides a safe digital logic signal for 3.3V GPIO input pins!
Interfacing Analog Sensors (LDRs, Thermistors, Potentiometers)
Microcontroller ADC (Analog-to-Digital Converter) pins measure Voltage (0V - 3.3V), not resistance.
To read a resistive sensor (like a Light Dependent Resistor or NTC Thermistor), you MUST pair it with a fixed reference resistor in a voltage divider:
- When light shines on an LDR, its resistance drops from 50 kΩ to 500 Ω.
- With R_fixed = 10 kΩ connected to +5V and LDR connected to GND:
- In Darkness (50 kΩ): V_out = 5V × (50k / 10k + 50k) = 4.17V
- In Bright Light (500 Ω): V_out = 5V × (0.5k / 10k + 0.5k) = 0.24V
The Loading Effect Trap (Why Dividers are NOT Power Supplies)
A frequent beginner misconception is trying to use a voltage divider to step 12V down to 5V to power a robot motor or microcontroller.
Why This Fails Catastrophically:
When you connect a load (resistance R_load) to the output, R_load acts in parallel with R_2. The equivalent lower resistance becomes R_2 parallel R_load, which causes the output voltage to immediately collapse from 5V down to fractions of a volt!
Fixing Loading Effects with Op-Amp Voltage Follower Buffers
If you must connect a voltage divider to a low-impedance circuit without altering its output voltage, place an Operational Amplifier (Op-Amp) configured as a Voltage Follower (Unity Gain Buffer) between the divider and load:
- High input impedance (>10^12 Ω) draws zero current from the divider.
- Low output impedance (<0.1 Ω) drives the downstream load with stable, rock-solid voltage.
Frequently Asked Questions
How do I choose resistor values for a voltage divider?
For microcontrollers, choose total divider resistance (R1 + R2) between 10kΩ and 100kΩ. If resistors are too low (<1kΩ), they waste battery power through continuous heat dissipation. If too high (>1MΩ), input bias currents on ADC pins will cause measurement errors.