Powering a Pi Without Corrupting the Card

Covers current needs by board, undervoltage symptoms, detecting throttling and power warnings, cable resistance, and shutting down to protect the filesystem.

Usb power supply, photographed for a technology article.

Ask experienced Raspberry Pi users what kills more projects than anything else, and many will name the same culprit before you finish the question: not enough clean power. A board starved of current does not fail politely. It freezes at random, drops USB devices, refuses to boot, and quietly scrambles the card until an install that worked yesterday is gone. This walkthrough shows how to size a supply for your board and its peripherals, spot the warning signs the Pi already gives you, and shut down in a way that keeps the filesystem intact.

Why thin power corrupts a card

The card is the fragile point in a power problem. Writing to flash is a multi-step operation, and if the voltage sags or vanishes partway through, the card can be left with half-updated structures the filesystem cannot make sense of later. A single bad write during a routine update can turn into a boot failure days afterward, which is why undervoltage damage so often looks random and unrelated to its cause.

This is also why the same symptoms recur across so many setups: corruption, mystery crashes, and cards that seem to die young. Many of the failures people blame on cheap flash are really power failures wearing a disguise, a pattern the guide on why cards fail in Pi projects traces in detail. Fixing the supply often cures problems that swapping cards never touched.

What your board and peripherals draw

Every board has a baseline appetite, and every peripheral adds to it. A Pi Zero needs little, a Pi 3B+ expects a 2.5-amp supply, a Pi 4 asks for 3 amps, and a Pi 5 wants a 5-amp, 27-watt supply to power demanding USB devices without complaint. The board itself is only the starting figure. A USB hard drive can pull close to an amp as it spins up, a camera and several sensors add more, and a HAT draws from the same 5-volt rail.

The load therefore depends heavily on what you are building, since a headless service with nothing plugged in behaves nothing like a board driving disks and screens. The spread of projects and their differing demands is set out in the guide to what these boards do well. Add up the board plus every attached device, then choose a supply with comfortable margin above that total.

Board Recommended supply Rough idle draw
Pi Zero 2 W 5V, 1.2A Under 1 watt
Pi 3B+ 5V, 2.5A Around 2 watts
Pi 4 5V, 3A Around 2.7 watts
Pi 5 5V, 5A Around 3 watts

The cable nobody suspects

A correctly rated supply can still starve a board if the cable between them is poor. Current flowing through a thin or long cable meets resistance, and that resistance drops voltage before it ever reaches the board. A cheap cable might present a fifth of an ohm of resistance, which at three amps quietly loses more than half a volt, enough to push a Pi below its safe threshold even though the plug on the wall is rated correctly.

This is why the official supplies use a captive cable of the right thickness rather than relying on whatever lead you have in a drawer. If you supply your own, choose a short, thick cable intended for power rather than a slim charging lead, and treat any long extension with suspicion. The wall adapter and the cable are one system, and the weaker of the two sets the real limit.

Reading the warnings the Pi gives

The board tells you when it is unhappy, if you know where to look. On a connected display a small lightning bolt appears in the corner during undervoltage. From the command line, the command vcgencmd get_throttled returns a hexadecimal value whose bits flag undervoltage and frequency capping, both currently and at any point since boot, so a non-zero result is a clear signal. The system log, read with dmesg, prints plain “Under-voltage detected” lines with timestamps.

Throttling is the board’s self-defence: when voltage drops or temperature climbs, it lowers the processor clock to stay within limits, trading speed for survival. That protects the hardware but ruins performance, so a Pi that feels mysteriously slow is often quietly throttling. Checking these values takes seconds and turns a vague hunch about power into a definite yes or no.

Powering and shutting down safely

Good habits at both ends, supply and shutdown, remove most of the risk. The steps below build a setup that resists corruption and shuts down cleanly, which matters most for a board expected to run continuously, such as the always-on controller described in the guide on building a home automation hub.

  1. Choose the official supply for your board, or a named-brand unit that meets its full voltage and current rating.
  2. Add up the current your peripherals draw and confirm the supply has headroom above that figure, not just the board’s baseline.
  3. Use a short, thick power cable, and avoid passing the supply through a hub or a long extension lead.
  4. After first boot, run vcgencmd get_throttled and check for undervoltage flags under your normal working load.
  5. Shut the board down with sudo shutdown now rather than pulling the plug, so the filesystem flushes and unmounts.
  6. For unattended boards, add a small battery backup or a read-only root filesystem so a sudden outage cannot corrupt the card.

Where careful power leaves you

Undervoltage earns its reputation as the quiet destroyer of Pi projects because its damage arrives late and wears the mask of other faults. Sizing the supply for the board and everything hanging off it, using a proper cable, watching the throttling flags, and shutting down gracefully together remove the single largest cause of instability people meet. None of these steps is difficult, and each costs little beyond a few minutes of attention.

If your peripheral load keeps climbing and the supply keeps growing to match, that can itself be a signal. A project heavy enough to strain a board’s power delivery may belong on different hardware, a trade-off weighed in the comparison of mini PCs against single board computers. For most builds, though, a right-sized supply and a clean shutdown are all that stand between a reliable board and a corrupted card.

Frequently asked questions

Why does my Pi keep corrupting the SD card?

Repeated corruption usually points to power rather than the card. If the voltage sags during writes, from an underrated supply, a poor cable, or peripherals drawing too much, the filesystem is damaged a little at a time. Pulling the plug instead of shutting down does the same. Check vcgencmd get_throttled for undervoltage flags, fit a proper supply and cable, and always shut down cleanly.

What power supply does a Raspberry Pi need?

It depends on the model. A Pi 3B+ wants 5V at 2.5A, a Pi 4 needs 5V at 3A, and a Pi 5 expects a 5V, 5A, 27-watt supply to run demanding USB devices. Add the current of anything you attach, such as drives or cameras, and pick a supply with margin above the total. The official units are sized correctly and worth the small premium.

Can I power a Pi from a laptop USB port?

For a Zero or a lightly loaded board, sometimes. A standard USB-A port supplies around 500 milliamps, well short of what a Pi 4 or Pi 5 needs under load, so the board may boot but then freeze or throttle once it does real work. It is fine for brief, low-power testing, but a dedicated supply is the only dependable option for continuous use.