04-08-2021, 04:33 PM
Hi all,
New to all this but getting there!
My set-up is slightly different.
I have a Pi 4 with 2 HAT's. First is a Pican3 which takes a 12v input and powers both itself and the Pi. It's function is to interface with CANBUS and it adds a real time clock (RTC). Second is a Pimoroni Automation HAT mini which has 3 24v inputs and 3 24v outputs plus a 2A relay.
Now, because the Pi is effectively powered by 12v now (through the Pican3) I don't need any voltage reduction and because the Automation HAT mini can take and measure 24v inputs I have the following setup;-
12v permanent live and ground into the Pican3 HAT so Pi is always receiving power thus wont power down and corrupt or damage anything when the ignition is switched off.
12v accessory (only 12v when ignition is on) attached to one of the 12v inputs on the Automation HAT mini.
I then have a Python script that runs every 5 seconds and if it measures the voltage coming into the Automation HAT mini input is 0v (i.e. the ignition is off) it waits 5 seconds then issues a shutdown -h now command.
This works perfectly for a safe shutdown whenever my car is switched off however, how do I get it to turn back on when I switch the ignition on again?
I hope this makes sense!
Michael
New to all this but getting there!
My set-up is slightly different.
I have a Pi 4 with 2 HAT's. First is a Pican3 which takes a 12v input and powers both itself and the Pi. It's function is to interface with CANBUS and it adds a real time clock (RTC). Second is a Pimoroni Automation HAT mini which has 3 24v inputs and 3 24v outputs plus a 2A relay.
Now, because the Pi is effectively powered by 12v now (through the Pican3) I don't need any voltage reduction and because the Automation HAT mini can take and measure 24v inputs I have the following setup;-
12v permanent live and ground into the Pican3 HAT so Pi is always receiving power thus wont power down and corrupt or damage anything when the ignition is switched off.
12v accessory (only 12v when ignition is on) attached to one of the 12v inputs on the Automation HAT mini.
I then have a Python script that runs every 5 seconds and if it measures the voltage coming into the Automation HAT mini input is 0v (i.e. the ignition is off) it waits 5 seconds then issues a shutdown -h now command.
This works perfectly for a safe shutdown whenever my car is switched off however, how do I get it to turn back on when I switch the ignition on again?
I hope this makes sense!
Michael