10-19-2019, 01:07 AM
(This post was last modified: 11-06-2019, 05:17 PM by ashwaganda.
Edit Reason: spacing
)
After reading some of the great Power Supply threads here I thought I'd share a method I came up with to use my cars key fob as a power on/off switch.
Since I have no patience and it takes all of 30 seconds for OA to boot up I wanted my PI to have the system up and ready when I sit down in my car.
For the Power On I simply run a constant 12V source using a Piggyback fuse to a 12v to 5v converter which I spliced into a micro usb cord. (I'm not using a hub now but plan to in the future). My PI powers my 7" touchscreen and sound card. Works so far.
To get the PI to wake up from a halt state after shutdown I wired in a simple relay that is Normally Closed.
Knowing I just have to momentarily open the circuit to "blip" the power to my halted PI-which will turn it on- I spliced a wire from my door lock actuators unlock wire to the relay.
When the relay gets the blip from the actuator it opens the circuit cutting the power for a split second waking up the PI. By the time I get in the car OA is up and running.
---------------
For the shut down with my fob it got a little more confusing but still doable.
I used two relays for the Power Off. They send a signal to the gpio pins on the PI which then executes a shutdown script.
The reason I needed two relays is that when I hit 10 mph in my car the doors lock automatically which triggers a shut down while I'm happily putzing along listening to tunes.
So, I needed two conditions to be met for the shut down to occur. Hence the second relay for shutdown.
I noticed that when I open my car door a little light in the footwell comes on and stays on for 20 seconds after the door is closed. A handy timer that was already in my car.
Knowing this I spliced a wire into the positive wire of the little footlight which triggers the first Power Off relay.
I then spliced a wire into the "door locked" wire of the door lock actuator.
When I open the door to get out of my car the first relay is activated by the light coming on and staying on for 20 seconds...My first condition.
Then when I'm walking away I lock my car with the fob like always and...My second condition is met.
When both conditions are met my signal runs through each relay to the waiting gpio pins and the script is run shutting my PI down.
If I don't lock the door the PI will stay on. Which is actually handy for when I'm working on or around the car. However, I always lock my car and I know I have about three days before the PI system will drain my battery if I forget to lock my car.
Simple.
---------------------
I am not an expert with electronics or coding but it's really not a super complex project and Goggle was my friend with the relays, splicing, wiring, and coding.
A few more notes:
The power wires to your door actuator, if you do get in there to do this, are the White and Blue ones. (seems to be universal as far as Goggle could tell me) I'm pretty sure the blue wire is usually the unlock and white lock. You don't have to get all the way up to the actuator either. I spliced into the wires at a spot relatively close to where they exit the door and go into the car dash- just used the same path that was already there.
The relays, wire, and connectors can all be found at any auto parts store. It's very basic stuff.
As a fail safe, I have a simple on/off switch wired into the 12V constant that I can override everything to manually power things on and off if needed. Which also lets me shut it completely down if I'm on vacation or such.
I also have a touchscreen shutdown button shortcut placed in the "Applications" tab of Open Auto which I can use for a non-click shutdown if needed. The instructions for that are here on the Blue Wave forum.
Anyway, reading some of the other cool power on/off threads here i thought maybe someone could use the door actuator key fob idea to further trick out their on/off systems.
Wiring Diagram:
The shutdown script I used can be found here: https://www.makeuseof.com/tag/add-power-...pberry-pi/
I believe I had to add the '&' symbol to the end of this line of code on the last step of the instructions: chmod a+x shutdown-press-simple.py
It is very important to remember the ‘&’ at the end this tells the Pi to run this program in the background. If you do not do this it will wait for the infinite loop to finish before moving to the next item on its to-do list.
Cheers
Since I have no patience and it takes all of 30 seconds for OA to boot up I wanted my PI to have the system up and ready when I sit down in my car.
For the Power On I simply run a constant 12V source using a Piggyback fuse to a 12v to 5v converter which I spliced into a micro usb cord. (I'm not using a hub now but plan to in the future). My PI powers my 7" touchscreen and sound card. Works so far.
To get the PI to wake up from a halt state after shutdown I wired in a simple relay that is Normally Closed.
Knowing I just have to momentarily open the circuit to "blip" the power to my halted PI-which will turn it on- I spliced a wire from my door lock actuators unlock wire to the relay.
When the relay gets the blip from the actuator it opens the circuit cutting the power for a split second waking up the PI. By the time I get in the car OA is up and running.
---------------
For the shut down with my fob it got a little more confusing but still doable.
I used two relays for the Power Off. They send a signal to the gpio pins on the PI which then executes a shutdown script.
The reason I needed two relays is that when I hit 10 mph in my car the doors lock automatically which triggers a shut down while I'm happily putzing along listening to tunes.
So, I needed two conditions to be met for the shut down to occur. Hence the second relay for shutdown.
I noticed that when I open my car door a little light in the footwell comes on and stays on for 20 seconds after the door is closed. A handy timer that was already in my car.
Knowing this I spliced a wire into the positive wire of the little footlight which triggers the first Power Off relay.
I then spliced a wire into the "door locked" wire of the door lock actuator.
When I open the door to get out of my car the first relay is activated by the light coming on and staying on for 20 seconds...My first condition.
Then when I'm walking away I lock my car with the fob like always and...My second condition is met.
When both conditions are met my signal runs through each relay to the waiting gpio pins and the script is run shutting my PI down.
If I don't lock the door the PI will stay on. Which is actually handy for when I'm working on or around the car. However, I always lock my car and I know I have about three days before the PI system will drain my battery if I forget to lock my car.
Simple.
---------------------
I am not an expert with electronics or coding but it's really not a super complex project and Goggle was my friend with the relays, splicing, wiring, and coding.
A few more notes:
The power wires to your door actuator, if you do get in there to do this, are the White and Blue ones. (seems to be universal as far as Goggle could tell me) I'm pretty sure the blue wire is usually the unlock and white lock. You don't have to get all the way up to the actuator either. I spliced into the wires at a spot relatively close to where they exit the door and go into the car dash- just used the same path that was already there.
The relays, wire, and connectors can all be found at any auto parts store. It's very basic stuff.
As a fail safe, I have a simple on/off switch wired into the 12V constant that I can override everything to manually power things on and off if needed. Which also lets me shut it completely down if I'm on vacation or such.
I also have a touchscreen shutdown button shortcut placed in the "Applications" tab of Open Auto which I can use for a non-click shutdown if needed. The instructions for that are here on the Blue Wave forum.
Anyway, reading some of the other cool power on/off threads here i thought maybe someone could use the door actuator key fob idea to further trick out their on/off systems.
Wiring Diagram:
The shutdown script I used can be found here: https://www.makeuseof.com/tag/add-power-...pberry-pi/
I believe I had to add the '&' symbol to the end of this line of code on the last step of the instructions: chmod a+x shutdown-press-simple.py
It is very important to remember the ‘&’ at the end this tells the Pi to run this program in the background. If you do not do this it will wait for the infinite loop to finish before moving to the next item on its to-do list.
Cheers