Most “why did it crash” mysteries come down to power. A board that resets at random, a Pi that corrupts its card, a sensor that reads fine on the bench and flakes in the field: more often than not the supply is too small, too cheap, or too far down a thin cable. Getting power right is unglamorous and it fixes more bugs than any line of code.
Underpowering, the silent bug.
A device draws its hardest at the worst moment: an ESP32 spikes its current when the Wi-Fi radio fires, a Pi 5 when its disk and USB wake up. If the supply cannot deliver that brief peak, the voltage sags and the device browns out and resets, and nothing in the logs explains why. The fix is to size the supply for the peak draw with headroom, not the average, and to use a real supply rather than whatever charger was in the drawer.
The USB power trap.
The single most common culprit is USB. A thin or charge-only cable drops voltage over its length; a cheap charger cannot hold 5 volts under load. The board at the end sees less than it needs and misbehaves. Two habits fix nearly all of it: use a quality charger rated above the device’s peak (the Pi 5 in particular wants a supply built for it), and use a short, thick data cable, not a charge-only one. If a board acts haunted, swap the cable and the charger before you suspect anything else.
The power pieces.
The mains-side options, by job. They often combine: a sealed supply feeding a DC-DC converter feeding a board.
| Piece | USB charger | Sealed PSU / adapter | DC-DC converter | UPS |
|---|---|---|---|---|
| Gives you | 5 V over USB | A fixed DC voltage at rated current | Steps one voltage to another | Power through an outage |
| Typical use | A board near an outlet | A hub or a panel of gear | Running off 12 V or a battery | The hub (Pi, mini PC) |
| Watch out for | Cheap ones brown out | Match voltage; leave headroom | Buck for efficiency, LDO for low noise | Size for runtime; set graceful shutdown |
| Best for | The easy default indoors | Permanent, tidy installs | Clean rails and odd voltages | Not losing the brain in a blackout |
For odd input voltages (running a 5 volt board off a 12 volt supply or a battery), a small DC-DC buck converter is efficient; for a low-noise rail to a sensitive analog sensor, a linear LDO regulator is quieter. Between separate buildings, mind surges, as covered on the wired networking page. For the deep dives, see the power supply and battery backup.
A UPS for the hub.
Your sensors can miss a reading during a blackout and no harm done, but the hub is different. A Raspberry Pi or mini PC that loses power mid-write can corrupt its storage and come back broken. A small uninterruptible power supply bridges the gap: a desktop UPS for a mini PC, or a battery-backed power hat for a Pi. Size it for the runtime you need, and, better still, wire it so the hub does a graceful shutdown when the battery runs low rather than dropping dead. It is cheap insurance for the one machine you cannot afford to lose.
Where it fits, and where it doesn’t.
Where it fits
- Any gear near mains power: hubs, panels, indoor nodes.
- Curing brownouts and random resets with a proper supply.
- Making clean 3.3 or 5 volt rails from an odd input.
- Keeping the hub alive through outages (UPS).
Where it doesn’t
- Off-grid field nodes; those want solar and a battery.
- Underspecced supplies; too little current is the usual fault.
- Cheap chargers and charge-only cables on hungry boards.
- Powering a wired remote node, where PoE is tidier.
Resources.
These open in a new tab:
Raspberry Pi power supplies Adafruit: choosing a supply Off-grid power Where to buy
Frequently asked questions.
Why does my Raspberry Pi or ESP32 keep crashing?
The most common cause is power. If the supply cannot deliver the brief peak current the device draws, the voltage sags and it browns out and resets, with nothing in the logs. Use a quality supply rated above the peak draw and a short, thick data cable. On a Pi 5, use a supply built for it.
How big a power supply do I need?
Size it for the peak draw, not the average, with headroom on top. A device pulls hardest in bursts, such as when a radio transmits or a disk spins up, and the supply has to hold its voltage through those peaks. A supply rated comfortably above the device current avoids brownouts.
What is a DC-DC converter for?
It changes one DC voltage to another, such as 12 volts down to the 5 volts a board needs, which is handy when running off a battery or a 12 volt supply. A buck converter is efficient; a linear LDO regulator is quieter for sensitive analog sensors but wastes more as heat.
Do I need a UPS for my setup?
For the hub, it is worth it. A Raspberry Pi or mini PC that loses power mid-write can corrupt its storage. A small UPS bridges short outages, and wiring it to trigger a graceful shutdown when the battery is low protects the machine. Sensors usually can miss a reading without harm, so they need it less.
Can a cheap USB charger damage my board?
It rarely damages it, but it commonly causes brownouts and resets because it cannot hold 5 volts under load, especially through a thin or charge-only cable. Use a quality charger rated above the device peak and a proper data cable; it cures most random-reset problems.