ESP32 Reboots Randomly
Track down unexpected resets in your ESP32 projects. Learn how to identify power, hardware, and software-related causes — from brownouts and loose wires to watchdog triggers — and apply proven techniques to stabilize your system.
Common Causes
- 📉
Power Instability or Brownouts
Momentary dips in voltage due to poor cables, shared loads, or weak supplies can cause the ESP32 to reboot unpredictably.
- 🔌
Loose or Intermittent Connections
Poor USB connectors, breadboard slop, or wobbly jumpers can break power or signal paths, leading to unexpected resets.
- 🧯
Watchdog Timer Resets
If the main loop blocks or crashes, hardware or software watchdog timers may trigger a reset to recover.
- 🔩
Defective ESP32 Module or Soldering Faults
Poor factory soldering or damaged internal flash/RAM can cause seemingly random reboots.
Symptoms
ESP32 Reboots Without Warning
The board runs for a while, then resets spontaneously, often without a clear trigger or consistent interval.
Serial Monitor Shows Unexpected Boot Messages
Output includes lines like
rst:0x1 (POWERON_RESET)
or other reset reasons during normal operation.
Sketch Restarts Mid-Execution
Code execution begins anew without any call to
ESP.restart()
suggesting an external or system-triggered reset.
Solutions
Inspect and Reinforce Physical Connections
Check USB, power rails, breadboards, and jumper wires for solid, secure contact. Replace flaky components or connections.
Replace the USB Cable and Power Source
Use a high-quality cable and a stable power adapter rated at 1A or more to eliminate voltage drop or instability.
Add Serial Debugging for Reset Reason
Use
esp_reset_reason()
at startup to log the cause of each reset and identify power vs. software issues. Issues with Serial Monitor? Check here.
Try a Different ESP32 Board
Swap in a second ESP32 to rule out hardware failure or faulty components on the first board.
More Details
ESP32 Reboots Randomly #
Does your ESP32 unexpectedly reset in the middle of operation? You’re not alone — intermittent reboots can stem from multiple causes, including power issues, hardware faults, or code-related watchdog resets.
This guide walks through the most likely culprits and what you can do to stabilize your ESP32.
Typical Symptoms #
- ESP32 resets without being touched
- Serial monitor shows new boot messages randomly
- The sketch restarts even though there's no
ESP.restart()
- Behavior is unpredictable and not easily reproducible
- Board works fine one day, reboots constantly the next
What Might Be Happening #
📉 Power Instability #
Momentary voltage dips — even as short as a few milliseconds — can cause a brownout reset. Common causes include:
- Undersized or unstable USB power
- Shared supply with motors or LEDs
- Long or thin USB cables with high resistance
🔌 Loose Connections #
Wobbly jumpers, flaky breadboards, or half-plugged USB connectors can cause brief power interruptions, leading to resets.
🧯 Watchdog Timer Triggers #
If your code enters a blocking loop or runs out of memory, the watchdog timer may trigger a system reset to recover.
🔩 Faulty Hardware #
Cheap or damaged ESP32 boards may have soldering defects, weak flash chips, or marginal regulators that lead to instability.
How to Diagnose It #
✅ 1. Check the Reset Reason Programmatically
Add this code to your sketch to log why the ESP32 reset:
#include "esp_system.h"
void setup() {
Serial.begin(115200);
delay(1000);
Serial.println("Reset reason: " + String(esp_reset_reason()));
}
This can help distinguish brownouts from watchdogs or manual resets.
✅ 2. Watch the Serial Monitor for Clues
When the board resets, the first few lines usually show something like:
rst:0x1 (POWERON_RESET), boot:0x13 (DOWNLOAD(USB/UART0))
If you see BROWNOUT_RST
, it's a power problem. If it’s a watchdog, look at your code’s loop behavior.
✅ 3. Physically Inspect Your Setup
- Reseat or replace your USB cable
- Re-plug jumper wires
- Press gently on the board and see if resets are triggered
- Move to a more stable surface than a breadboard
How to Fix It #
🔧 Use a Better Power Source
Replace your USB cable with a short, thick one. Avoid hubs. Power your board from a wall adapter or bench supply rated at 5V 1A or more.
🔧 Add Bulk Capacitors
Place a 470–1000µF capacitor across the ESP32's 3.3V or 5V and GND lines to absorb any voltage transients.
🔧 Debug or Simplify Your Code
Check for:
- Infinite loops without
delay()
- Out-of-memory issues
- Unhandled exceptions in libraries
Use yield()
or delay()
in long loops to prevent watchdog timeouts.
🔧 Swap Boards
If you've ruled out everything else and the problem persists, your ESP32 might simply be faulty. Try another module to confirm.
Summary #
Random reboots are frustrating, but you can track them down with careful debugging. Always start by checking power and connections, then inspect your code and board health. A few small improvements can make your ESP32 rock-solid.

Quick Navigation
Additional Resources
Still Stuck with an ESP32 Issue? Let's solve it together.
Our interactive troubleshooting wizard will guide you through common ESP32 problems and their solutions, step by step.