Powering a Raspberry Pi in a car
Why a phone charger in the lighter socket isn't enough, and what a car-ready power setup for a Pi needs.
A Raspberry Pi on the bench gets a steady 5 V from a wall adapter. A car is a much rougher place to live, and most “my Pi keeps corrupting its SD card in the car” stories come down to power.
What the car’s 12 V actually does
The nominal 12 V system is rarely 12 V:
- Engine running: the alternator holds it around 13.5–14.5 V.
- Cranking: the starter motor pulls the battery down hard. Depending on the battery’s health and the temperature, it can briefly dip to 6–8 V or lower.
- Load dump and switching spikes: when a large load disconnects suddenly, the voltage can spike well above normal for a moment.
- Ignition off: the accessory circuit simply drops out, with no warning to anything connected to it.
A cheap lighter-socket USB adapter may ride through some of this, or may brown out during cranking and spike the Pi on the way back up.
What a car-ready setup needs
- An automotive-rated DC-DC converter with a wide input range (one that keeps regulating through cranking dips) and protection against reverse polarity and transients. Size it with headroom over the Pi’s peak draw plus everything on its USB ports.
- An ignition sense line. Run a signal from a switched accessory circuit to a GPIO pin, through a voltage divider or an optocoupler so the pin only ever sees 3.3 V. The software watches it and starts a clean shutdown when the key turns off.
- Hold-up power. Feed the converter from constant battery power, or add a supercapacitor or small UPS board, so the Pi has a few seconds to finish shutting down after the ignition drops.
- A filesystem that tolerates surprises. Even with all of the above, assume power will be cut uncleanly someday. A read-only root filesystem with an overlay, and logs kept in RAM, mean an unexpected cut costs you nothing important.
Don’t drain the battery
A Pi drawing power from constant battery power never fully sleeps. Make sure the shutdown logic also cuts the converter’s output (many automotive Pi power boards do this for you), or the car may not start after a week in the airport parking lot.
Later build logs will cover the exact parts used in Yankee Noodle and measurements from the car itself.
Dispatches
Get the build log by email
New posts, parts lists and drive dates, about twice a month. No spam, unsubscribe any time.
Signup opens once the newsletter account is set up.