Boards & Bits All articles
DIY & Making

The Reset That Ruins Your Week: Hunting Down Random Microcontroller Brownouts

Boards & Bits
The Reset That Ruins Your Week: Hunting Down Random Microcontroller Brownouts

Every maker knows this particular flavor of pain. You flash the firmware, run it for a few hours, everything's golden. You screw the enclosure shut, mount it on the wall, and two days later you get a text from Home Assistant telling you your garage sensor dropped offline. Again. For the third time this week.

Intermittent microcontroller resets are the worst kind of bug because they rarely reproduce when you're watching. The board behaves perfectly on your bench with a nice bench supply, then falls apart in the real world. The good news: these gremlins almost always fall into one of a handful of categories, and there's a systematic way to flush them out.

Start With the Obvious Suspect: Power

Before you blame your code, look at your power rail. Brownout resets are the single most common cause of "random" reboots, and they're usually self-inflicted.

The classic scenario: you're running an ESP32 or an nRF52 off a long USB cable or a cheap wall wart, and everything's fine until the radio fires up a transmission at full power. That transmit burst can pull 300–500mA in a spike lasting just a few milliseconds. If your supply and wiring can't source it, the rail sags, the brownout detector trips, and the chip reboots. From your perspective, it's random. From the chip's perspective, it's doing exactly what it was told.

Here's how to catch it:

Decoupling: The Rule Everyone Knows and Ignores

We've all heard "put a 100nF cap next to every VCC pin," and we've all been tempted to skip it because the board worked anyway. Then it worked anyway... until it didn't.

Decoupling caps are your first line of defense against inrush and switching transients. A bulk electrolytic (say 470µF) at the power entrance handles slow sags, while 100nF ceramics right at each chip's supply pins handle the fast spikes. If your board resets when a relay clicks or a motor kicks on, that's an inrush problem — the switched load is yanking the shared rail down, and your MCU is collateral damage.

One subtlety worth knowing: ceramic capacitors lose capacitance under DC bias. That 10µF 0805 MLCC might only be delivering 4µF at 3.3V. If your budget was tight to begin with, you're running on fumes.

Ground Loops and the Return Path Nobody Thinks About

Current flows in loops. That spike current pulled by your radio or your servo has to get back to the supply, and if it's returning through the same thin traces your sensitive analog circuitry uses as a ground reference, you've built yourself a noise injector.

Symptoms of a ground problem include resets that correlate with mechanical loads, ADC readings that jump when things switch, and behavior that changes when you touch the enclosure or swap USB cables. Fixes range from simple (star grounding — run each return path back to a single point) to structural (a proper ground plane on a real PCB instead of a bird's nest of jumper wires).

When It Actually Is the Firmware

Sometimes the hardware is innocent. Before you reflow the whole board, check these firmware suspects:

A trick that pays for itself: log the reset reason and a uptime counter to flash (or better, to your network) on every boot. After a week of data, you'll know whether you're chasing brownouts, watchdog bites, or software faults — and whether they correlate with your furnace kicking on at 3 AM.

The Long Stakeout

The hardest part of intermittent bugs is simply waiting. Set up your scope with a segmented memory or a trigger on the power rail, log reset reasons persistently, and let the thing run. A gremlin that strikes once a week is maddening, but it's also predictable: capture it once, and the fix is usually a 10-cent capacitor and an hour of rework.

The ghost in the machine is almost never a ghost. It's a voltage sag, a missing decoupling cap, or a watchdog you forgot you armed. Give it a week of patient surveillance, and it'll confess.

All Articles

Related Articles

We Built a Scope Out of a Raspberry Pi and a $60 ADC Hat — Here's Where It Crushed (and Choked)

We Built a Scope Out of a Raspberry Pi and a $60 ADC Hat — Here's Where It Crushed (and Choked)

Your Lab Is Bleeding Money While You Sleep: The Real Cost of Standby Power in Your Workshop

Your Lab Is Bleeding Money While You Sleep: The Real Cost of Standby Power in Your Workshop

Your Soldering Iron Is Lying to You: The Hidden Temperature Problem Wrecking Your Builds

Your Soldering Iron Is Lying to You: The Hidden Temperature Problem Wrecking Your Builds