Guide · Power · Troubleshooting
ESP32 keeps resetting? It’s the power, not your code
Random reboots. The board freezes the moment Wi-Fi connects. The serial monitor prints
Brownout detector was triggered. Almost every beginner hits this — and it’s almost never a
code bug. It’s the power supply sagging under load. Here’s why, and how to fix it for
good.
What “brownout” actually means
The ESP32 has a built-in brownout detector: if the 3.3 V rail dips below a threshold (~2.4–2.8 V), it resets the chip to avoid running on bad voltage. So the message isn’t the disease — it’s the symptom telling you the rail collapsed.
The trigger is almost always the Wi-Fi radio. Transmitting pulls sudden current spikes of 300–500 mA. If your supply, cable or the onboard regulator can’t deliver that instantly, the voltage drops, the detector fires, and the board reboots — which is why it dies exactly when Wi-Fi kicks in.
The usual causes
- A weak or long USB cable — a thin “charge-only” cable drops enough voltage to brown out under load. This is the #1 cause.
- A stingy USB port — some laptop/hub ports limit current; a wall charger or powered hub is steadier.
- Feeding the 3V3 pin directly from a weak source — you bypass the board’s bulk capacitance and regulator headroom.
- The onboard AMS1117 LDO — cheap boards use it; it’s adequate but has little margin for current spikes and drops out easily.
The fixes (in order)
- Swap the cable first. A short, thick, data-rated USB cable fixes a shocking number of “dead” boards.
- Add a decoupling cap — a 470–1000 µF electrolytic across 3V3 and GND right next to the module absorbs the Wi-Fi current spikes. The single most effective fix.
- Power via 5V / VIN, not the 3V3 pin, so the onboard regulator and its caps do their job. Give it a clean 5 V from a decent supply.
- Separate hungry peripherals — never run servos, motors or LED strips off the board’s 3V3; give them their own supply and share ground.
- Upgrade the regulator for serious builds — a small buck converter delivers far more current than an AMS1117 and runs cooler.
Powering peripherals without brownouts
A WS2812 strip, a servo or a motor can each pull more than the whole ESP32. Drawing that through the board’s little regulator guarantees resets. Rule: compute and radio on one supply, muscle on another, grounds tied together. A 5 V module or LED needs a 3.3 V ↔ 5 V level check too if it talks logic back to the ESP32.
On battery
Batteries add their own trap: the AMS1117 wastes current just sitting idle (poor quiescent draw) and needs headroom above 3.3 V to regulate. For battery projects, use an efficient buck/boost — or feed a LiFePO4 cell (3.2 V) almost straight into the 3.3 V rail. Then chase every microamp with deep sleep.
Nine times out of ten the cure is a better cable plus a fat capacitor. Fix the rail and the mysterious crashes, Wi-Fi drops and “random” reboots simply stop.
Wiring 5 V parts to a 3.3 V ESP32? Don’t fry a pin while you’re at it.