Voltage Divider Calculator — 5V to 3.3V for ESP32
Trying to connect a 5V sensor to a 3.3V microcontroller like an ESP32 or Raspberry Pi Pico? If you send 5V straight into a 3.3V pin, you'll likely fry it. You need a voltage divider to safely step that voltage down. Enter your voltages and resistor values below to find the exact output.
How the Voltage Divider Formula Works
A voltage divider uses two resistors in series to reduce a higher voltage to a lower one. The formula is:
Vout = Vin × (R2 / (R1 + R2))
- R1 (Top Resistor): Connects to your input voltage (e.g., your 5V sensor signal).
- R2 (Bottom Resistor): Connects to Ground (GND).
- Vout (Output): Taken from the junction between R1 and R2. This goes to your ESP32 pin.
Common Resistor Combinations (5V to 3.3V)
Don't have the exact resistors on hand? Here are the most common pairs for safely stepping 5V down to ~3.3V:
- 5V → 3.30V: R1 = 1.7kΩ, R2 = 3.3kΩ
(5 × 3300 / 5000 = 3.30V. Draws ~1.0 mA) - 5V → 3.33V: R1 = 1kΩ, R2 = 2kΩ
(5 × 2000 / 3000 = 3.33V. Draws ~1.67 mA) - 5V → ~3.24V: R1 = 1.8kΩ, R2 = 3.3kΩ
(5 × 3300 / 5100 ≈ 3.24V)
Crucial Mistakes to Avoid
- Do NOT use for power: A voltage divider is strictly for data signals or voltage references. If you try to power a motor or a module from the output, the voltage will drop out and the resistors will overheat. Use a buck converter or voltage regulator for power.
- Not for high-speed data: If you're using fast or bidirectional data lines (like I2C or fast SPI), a voltage divider is unreliable. Use a dedicated logic-level shifter instead.
- Mind your resistor values: 1kΩ to 10kΩ is a good starting range for logic signals. Values that are too low will waste power and generate heat. Values that are too high (e.g., 1MΩ) become highly sensitive to noise and the input impedance of your microcontroller pin.
Keep Learning
Now that you've got your voltages sorted, take your skills further with our other lessons and tools:
Liked this tool? Get the next lesson in your inbox.
Join the Electron Parade newsletter for the latest lessons, projects, and teardowns.