ESP32 random reboot troubleshooting for brownouts, boot pins and power problems

Random ESP32 reboots are rarely random. In most cases the chip is reacting to one of a small number of conditions: the 3.3 V rail dipped too low, a watchdog fired, an exception caused a panic reset, the EN pin was disturbed, or a boot-strapping pin was in the wrong state during reset.

The fastest way to fix the problem is to stop guessing and identify the reset cause first. This guide gives you a practical diagnostic sequence for classic ESP32 boards and modules, then shows how to correct the underlying hardware or firmware fault.

Start by identifying the reset reason

ESP-IDF exposes the reason for the previous reset through esp_reset_reason(). That is the first thing to log during startup because it immediately separates power problems from watchdogs, software resets, deep-sleep wakeups, and panic resets.

#include "esp_system.h"

void setup() {
  Serial.begin(115200);
  delay(500);

  esp_reset_reason_t reason = esp_reset_reason();

  Serial.print("Reset reason: ");
  Serial.println((int)reason);
}

void loop() {
}

Common reset reasons include power-on reset, software reset, watchdog reset, panic reset, deep-sleep reset, and brownout reset. If the serial monitor shows Brownout detector was triggered, treat that as a power-integrity problem first—not as a firmware bug.

1. Brownouts: the most common reboot cause

The ESP32 includes a brownout detector. When supply voltage falls below a safe level, the chip resets to avoid unpredictable behavior. Espressif explicitly recommends checking the power source, USB cable, regulator capability, and local capacitance when brownout resets occur.

Wireless activity is a common trigger. Wi-Fi transmission can create short current peaks that a weak USB port, thin cable, undersized regulator, or high-resistance breadboard path cannot supply cleanly. A project may therefore look stable while idle and reboot only when it connects to Wi-Fi, starts Bluetooth, transmits MQTT data, or drives another load.

What to check

  • USB cable: replace long or poor-quality cables first.
  • Power source: use a supply that can handle transient current, not only the average load.
  • 3.3 V regulator: verify both current capability and thermal margin.
  • Wiring: avoid thin jumper wires and long breadboard power paths for high-current loads.
  • Local decoupling: place suitable bypass and bulk capacitance close to the ESP32 power pins/module.
  • Shared loads: motors, relays, servos, LED strips, and radios can pull the rail down when switched.

A multimeter can miss a fast voltage dip. If the problem happens during Wi-Fi transmit or load switching, an oscilloscope across the ESP32 3.3 V and GND pins is much more useful.

For battery-powered projects, also check the battery’s internal resistance and the regulator’s peak-current behavior. A battery that measures an acceptable open-circuit voltage can still collapse briefly under a wireless current burst.

2. Do not power heavy loads from the ESP32 rail

A common design mistake is powering a servo, relay board, LED strip, motor driver, or other load from the same small regulator that powers the ESP32. The load switches on, the rail dips, and the ESP32 resets.

Use an appropriately sized supply for the load and keep the grounds common where required. Add local decoupling near both the ESP32 and the load. Inductive loads also need correct flyback or suppression components.

If your project is intended to run for long periods on battery, see our ESP32 power optimization guide for a broader look at regulators, sleep modes, and wireless power consumption.

3. Check EN / CHIP_PU behavior

The ESP32 enable pin is normally labeled EN on development boards and CHIP_PU in Espressif documentation. Pulling it low resets the chip.

Espressif’s hardware guidelines specify that the 3.3 V rail should be allowed to stabilize before CHIP_PU is asserted high. Noise on EN, a poor reset circuit, excessive trace length, or an external circuit pulling the pin can create reboot behavior that looks like a power failure.

Typical checks

  • Confirm EN remains high during normal operation.
  • Inspect the reset button and any external reset circuitry.
  • Keep the EN/CHIP_PU connection short and clean on custom PCBs.
  • Do not let external modules drive EN unintentionally.
  • Check startup timing if the ESP32 is powered by a slow or sequenced supply.

4. Strapping pins can cause boot loops

On the classic ESP32, several GPIOs are sampled during reset to determine boot configuration. Espressif lists GPIO0, GPIO2, GPIO5, MTDI, and MTDO among the strapping pins for the original ESP32 family.

That means a circuit attached to one of these pins can work normally after boot but still prevent the board from starting correctly after a reset. The classic symptom is a board that works when disconnected from a peripheral but enters download mode or fails to boot when that peripheral is attached.

Pay particular attention to GPIO0 because pulling it low during reset can select the download bootloader. Also remember that strapping details differ across ESP32 variants such as ESP32-S3, C3, C6, and newer families. Always use the datasheet for the exact chip or module on your board.

5. Separate power resets from watchdog resets

If the reset reason is a watchdog rather than brownout, the debugging path changes completely. Watchdogs usually indicate that firmware stopped giving the system enough execution time.

Common causes include:

  • Long blocking loops.
  • Interrupt service routines doing too much work.
  • Tasks that never yield.
  • Deadlocks around mutexes or shared resources.
  • Very long critical sections.
  • Waiting forever for a peripheral or network response.

In Arduino-style code, repeatedly using long blocking delays or busy-wait loops can make systems less responsive, while poorly structured FreeRTOS tasks can starve other work. In ESP-IDF, inspect the watchdog log and task name rather than immediately increasing watchdog timeouts.

6. Panic resets are firmware faults, not power faults

A panic reset usually follows an exception such as invalid memory access, stack corruption, assertion failure, or heap corruption. The serial console normally prints a panic message or backtrace before reset.

If you see a backtrace, capture it. Do not treat the reboot itself as the problem—the crash that happened immediately before it is the problem.

Useful checks

  • Decode the backtrace with the correct ELF/build symbols.
  • Check array bounds and pointer lifetime.
  • Watch stack usage in tasks with large local buffers.
  • Look for use-after-free or double-free bugs.
  • Check whether callbacks access objects that no longer exist.
  • Track free heap and minimum free heap during long runs.

7. Wi-Fi can expose a weak power design without being the real fault

When an ESP32 reboots exactly as Wi-Fi connects, many people blame the Wi-Fi library. Often the real sequence is simpler: the radio starts transmitting, current demand rises sharply, the supply droops, and the brownout detector resets the chip.

A good test is to run the same firmware from a known stable supply with short wiring. If the reboot disappears, investigate the power path before changing network code.

For a complete working wireless example, our ESP32 IoT temperature and humidity monitor project is a useful reference for building and testing an end-to-end Wi-Fi application.

A diagnostic order that saves time

  1. Read the serial boot log. Capture the text printed before and after the reboot.
  2. Log esp_reset_reason(). Determine whether this is brownout, watchdog, panic, software reset, or another cause.
  3. Disconnect external loads. Run only the ESP32 from a known good supply.
  4. Replace the USB cable and supply. Eliminate the simplest power-path failures.
  5. Measure the 3.3 V rail. Check it during Wi-Fi transmit and load switching.
  6. Inspect EN/CHIP_PU. Confirm nothing is pulling it low or injecting noise.
  7. Inspect boot-strapping pins. Temporarily disconnect peripherals on boot-sensitive GPIOs.
  8. If the cause is watchdog or panic, debug firmware. Capture the task, backtrace, heap state, and failing condition.
  9. Stress-test after the fix. Reconnect Wi-Fi repeatedly, switch loads, reboot, and run long enough to reproduce the old failure conditions.

Quick symptom-to-cause table

Symptom Likely cause First check
“Brownout detector was triggered” Supply voltage droop USB cable, regulator, 3.3 V rail
Reboots when Wi-Fi starts Power transient or brownout Scope 3.3 V during radio activity
Boots only when a peripheral is disconnected Strapping-pin conflict GPIO0/GPIO2 and other boot pins
Task watchdog message Blocked/starved task Task timing and critical sections
Guru Meditation / panic backtrace Firmware exception Decode backtrace and inspect memory access
Reset when motor/relay/servo switches Supply dip or electrical noise Separate power path and suppression
Random reset on custom PCB Power, EN timing, layout, or EMI 3.3 V, CHIP_PU, decoupling, grounding

What not to do

Do not disable the brownout detector as your first fix. It can hide a real power-integrity problem. Likewise, do not simply increase watchdog timeouts until a watchdog error disappears. Both approaches can mask the symptom while leaving the underlying design fault in place.

The better sequence is: identify the reset reason, reproduce it deliberately, measure the relevant signal, correct the cause, then stress-test the system again.

Final reliability checklist

  • The previous reset reason is logged during development.
  • The 3.3 V rail stays stable during Wi-Fi/Bluetooth transmit.
  • High-current peripherals are not stressing the ESP32 regulator.
  • EN/CHIP_PU has clean startup and reset behavior.
  • Boot-strapping pins are not forced to unsafe levels at reset.
  • No watchdog or panic messages appear during long-duration testing.
  • The system recovers correctly from Wi-Fi loss and peripheral faults.
  • Repeated cold boots and warm resets behave consistently.

Authoritative references