How to safely power ESP32 with batteries or external supplies
ESP32 projects get “real” fast: WiFi, sensors, LEDs, servos… and suddenly USB power isn't enough. The goal is simple: give the ESP32 a stable supply with current headroom.
Which pin do I power?
- Most dev boards: feed a regulated 5V into the 5V or VIN pin (or USB).
- Don't feed raw batteries into 3.3V. The 3.3V pin expects a clean, regulated 3.3V.
Board labeling varies across clones. If you're unsure, check your board's pinout before connecting power.
Battery options (what works, what doesn't)
Great energy density, but voltage changes a lot. Use a proper regulator (buck/boost as needed) to get stable 5V or 3.3V.
Alkalines sag under load. Fine for low-power builds, but WiFi bursts can cause brownouts if the regulator and wiring aren't solid.
Often the easiest “battery.” Just watch out for auto-shutoff on low current draw (some banks turn off if your project is too low-power).
Current headroom: the part people underestimate
ESP32 WiFi spikes can be hundreds of mA in bursts. Add sensors and LEDs and you're quickly out of “random USB port” territory.
- Rule of thumb: aim for a supply that can comfortably deliver 1A+ if you're doing WiFi + peripherals.
- Even if average current is low, bursts matter.
Wiring rules that prevent resets
- Share ground between supplies (GND to GND).
- Keep power wires short and thicker than signal wires.
- Add a bulk capacitor near the ESP32 (470µF-1000µF is a good starting point for WiFi projects).
- Keep motors/LED strips on their own supply when possible, and tie grounds together.
Pick a stable regulated 5V (or regulated 3.3V if your board supports it), give yourself current headroom, and treat wiring and decoupling as part of the design. That's how you avoid brownouts and random reboots.
Related: External power safely · USB vs external power · Brownout detector reset