Wolfram23 wrote:Interesting discussion here. As someone who knows relatively little about electronics, I can confirm that most of what you're talking about is going over my head (although I understand the gist of it).
I'm planning to put my RPi in a car, so it's already on a 12V DC circuit. Trying to figure out the most efficient 12V to 5V adapter, as well as how to auto sleep/wake the RPi.
The idea I have is to use the 12V to 5V on the main 12V Battery line (constant power), with a second adapter 12V to 5V (or does it need to be 3.3V?) on the ignition line. Then when ignition goes live, the RPi wakes up, and when it goes dead, the RPi goes to sleep. I'd also consider a physical switch in case I won't be driving my car for more than several days, just to minimize battery drain.
Anyway I'm sure the hardwire side of it is just a little more reading away, but as for software interfacing with the GPIO pins, I really have no idea. Would be great if you guys can expand on that.
You can use a relay as a switch (energized by the ignition line) for the RPi. If you can boot the OS with SD card in read-only mode (it is possible with Linux), you can just power RPi down abruptly without OS corruption (no need to signal RPi about power down).
The relay coil must be 12 V energize-able. The are some cheap DC-DC switch mode converters on EBay (LM2577 based DC-DC converters). You need to turn the potentiometer to set the output as 5 V.
Thus, the ignition line controls the relay which turns on the DC-DC converter. You may need a surge suppressor on the input of the DC-DC converter to protect it.