Power constant + ignition


4 posts
by thomasbrentnall » Fri Nov 02, 2012 12:23 pm
Hello all, I am working on a little project using a rpi.

I plan to have my pi connected to a car stereo harness (like this http://www.nexxia.co.uk/pics/CT20FD10.jpg). There is three wires used for power in this harness, Ground (black), 12v+ (red), and Ignition. I realise that these will all need to be stepped down to 5 volts. Any way, what I want to do is to have the ground and 12+ constantly connected so the device does not lose time settings etc, however I only want the device to physically switch on when the ignition is turned on, and then power off when the ignition is switched off.

However I want the device to power off correctly instead of switching off instantly, like this:
1) Ignition is switched off and power is cut from the ignition cable
2) 'sudo shutdown now' command is issued
3) Device safely powers off using power from the ground and 12v+


Is this possible? I understand that the ignition will have to be connected to a GPIO header. Thank you in advance

Thomas Brentnall

Note to admin; sorry if this is in the wrong section of the forum, I could not find an exact place to post this
Posts: 1
Joined: Fri Nov 02, 2012 12:07 pm
by tedhale » Fri Nov 02, 2012 1:54 pm
You might want to look at this thread for some ideas.
viewtopic.php?f=63&t=8820&start=25&hilit=auto+power+turn+on

The RasPi does not have a clock in it, nor does it have any other volatile information that needs power to maintain.
So there is no need to keep it powered at all when it is off.

Having the RasPi shut down automatically when the car turns off is pretty straight-forward.
Just monitor the ignition line from a gpio pin and shut down when it goes low.

The trickier part is making it turn on automatically when the car turns on.
The design in the thread above uses a push button to turn it back on.

I plan on making a data logger for my truck as my next project (OBD interface and GPS) probably in a few months, so I am watching these threads for ideas.
I would like it to turn on automatically, so I will have to build something a little more complicated.
- Ted B. Hale
http://raspberrypihobbyist.blogspot.com
User avatar
Posts: 112
Joined: Thu Sep 20, 2012 4:52 pm
Location: Williamsburg, VA, USA
by notarat » Fri Nov 02, 2012 2:21 pm
thomasbrentnall wrote:Hello all, I am working on a little project using a rpi.

I plan to have my pi connected to a car stereo harness (like this http://www.nexxia.co.uk/pics/CT20FD10.jpg). There is three wires used for power in this harness, Ground (black), 12v+ (red), and Ignition. I realise that these will all need to be stepped down to 5 volts. Any way, what I want to do is to have the ground and 12+ constantly connected so the device does not lose time settings etc, however I only want the device to physically switch on when the ignition is turned on, and then power off when the ignition is switched off.

However I want the device to power off correctly instead of switching off instantly, like this:
1) Ignition is switched off and power is cut from the ignition cable
2) 'sudo shutdown now' command is issued
3) Device safely powers off using power from the ground and 12v+


Is this possible? I understand that the ignition will have to be connected to a GPIO header. Thank you in advance

Thomas Brentnall

Note to admin; sorry if this is in the wrong section of the forum, I could not find an exact place to post this


Since the Pi doesn't have an RTC, it needs to be powered on to maintain the correct time.

The cleanest way to accomplish this is to get something like the PiCrust Add-On which allows you to connect the RTC from the Aduino (It's a direct fit)

Then, you can use a standard relay to connect to the automobile's power/gnd/ign to power the Pi.
Posts: 106
Joined: Wed Sep 12, 2012 12:32 pm
by gradtje » Sun Nov 04, 2012 1:49 am
You could use a i2c rtc for keeping time. You have to fiddle around with some hardware for the on/off switching anyway. I would use a script that monitors the state of the ignition and issue a shutdown when ignition is off. Also I would use a timer that switches the 12V off a while after ignition is down. (to prevent your battery from sucking dry.
Using i2c also enables you to control a nifty pre-amplifier, like this one: http://jpkc.szpt.edu.cn/2008/ICbtsj/Upl ... LM4832.pdf
Assuming you would use your Pi for audio as well (I would :) )
Posts: 1
Joined: Sun Nov 04, 2012 1:36 am