soldr.ai

Docs  /  When it doesn't work

Your ESP32 reboots the moment the motor starts

The board runs fine until something with a coil in it switches on — then it resets, over and over. This is almost never your code.

5 min read Power ESP32 · Arduino

What you're seeing

Your sketch uploads and runs. The instant a motor, pump, relay or solenoid switches on, the board restarts. The serial monitor shows a burst of garbage, then the boot banner again:

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
Brownout detector was triggered

Sometimes it loops forever. Sometimes it only happens when the motor is under load.

Why it happens

A motor pulls a large current spike the moment it starts — often five to ten times what it draws while running. If it shares a supply with the ESP32, that spike drags the rail below the voltage the chip needs, and the brownout detector resets the board to protect it.

The USB port is not a power supply A laptop USB port gives you around 500 mA. A small DC motor can ask for more than that in its first few milliseconds. This is the single most common cause.

Fixing it

  1. Give the motor its own supply

    Power the motor from a separate adapter sized to its stall current, not its running current. Do not run it from the board's 5V pin.

  2. Tie the grounds together

    The motor supply's ground and the board's ground must connect. Without a shared reference the control signal has nothing to switch against — this is the step people skip.

  3. Add a capacitor across the motor supply

    A 470 µF or larger electrolytic across the motor's power rail absorbs the start-up spike before it reaches the regulator.

  4. Switch the motor with a driver, never a pin

    A GPIO can source about 20 mA. Use a MOSFET, a motor driver or a relay module between the pin and the load.

  5. Re-flash and watch the serial monitor

    If the brownout line is gone, it was the supply. If it persists, the driver or the ground link is still wrong.

Screenshot
Soldr chat showing a brownout diagnosis: pasted serial output containing "Brownout detector was triggered", the reply naming the 12V supply as the cause, and the revised parts card with the buck converter added.

Letting Soldr do it

Paste the serial output straight into Soldr. It reads the reset reason against the sketch you actually flashed, not a generic answer, and rebuilds the parts list with the supply corrected.

Or photograph the breadboard and ask what's wrong — it will read the picture.

Both of these are free Questions, diagnosis and troubleshooting never cost credits. You only spend credits when Soldr generates something for you.
Soldr power narration for a plant-watering build: active parts draw roughly 441mA in total, while peak figures are listed separately as ESP32 500mA, pump 1200mA and driver 3000mA during stall, burst or full-load
The reset explained in one paragraph, generated live for a pump build. Steady draw is 441mA — but the peaks are listed separately: pump 1200mA, driver 3000mA during stall. A supply picked for 441mA meets the average and collapses on the stall, and the board browns out and reboots. Note it also says a runtime cannot be given because no battery capacity is listed, rather than inventing one.

A worked example

This is the build Soldr produces for "automatic plant watering with a 12V solenoid valve and an ESP32" — note that the power problem above is designed out from the start:

PartWhy it's therePrice
ESP32-C3 Super Minithe controller₹290
12V Solenoid Valvethe load, on its own rail₹240
IRF540N MOSFETswitches 12V from a 3.3V pin₹60
LM2596 Buck Converterkeeps the board at 5V, isolated from the spike₹95
12V 2A DC Adaptersized to the valve, not the board₹300
Core of the buildthe rest is wiring₹985

If it still resets