The plan is to place a Raspberry Pi in a vehicle togheter with a camera and fully automate the startup/shutdown of the raspberry. So -
what is the best way to detect that the vehicle is running?The first thing that comes into my mind is - check if the alternator outputs some voltage. The first problem appears when starting car.The alternator produces some voltage. This can be solved with some electronics (RPi power controller
RPipc), to give power to the raspberry after 20 seconds when the alternator starts producing some voltage.
The second problem is shutting down raspberry. Again -
RPipc can monitor alternator output and if alternator is not producing any output (or below some voltage), then send a signal to raspberry GPIO and then the script stops all apps and shuts down raspberry pi.After one minute (some time)
RPipc turns off power to the raspberry pi.
Power to raspberry pi can be provided via some relay witch is controlled by
At this moment i do not plan to place some ODB2 tool to vehicle and attach it to raspberry pi. And my car ODB connector is under a cover in the front of the center console: If i want to permanently add the ODB diagnostics tool, i am going to need to solder another connector.
RPipc must wake up after it receives a signal from the alternator and cut power when the vehicle is turned off. But my question is about how to detect if the vehicle is turned on (engine is running).