2020-10-23, 11:53 PM
I have been thinking more about how to get cost effective safe power down and then power back up again when the DC power switch is restored. I could use Pi Juice, but it is a little expensive and other UPS's didn't automatically restore the Pi on power restore - see attachment
This Schematic would use a second source as backup that to the main source and if the main source is cut, then the backup would ensure power to the Pi until power down, then the relay would cut it. the relays are https://www.amazon.com/dp/B00LW15A4W, the Power supplies are https://www.amazon.com/dp/B01MQGMOKI
There would have to be some code added In the file /boot/config.txt (use sudo nano /boot/config.txt):
dtoverlay=gpio-poweroff,gpiopin=20,active_low="y" <-- this would make sure that the relay released when the Pi was safely powered off.
there would need to be some code to trigger the shutdown when pin 40 (GPIO 21) was at 0v and I am not sure how to do that - I guess it would start with:
dtoverlay=gpio-shutdown,gpio_pin=21
I think I may have to make pin 40 (GPIO 21) pull down? anybody know how to do that?
anyone have any concerns with the plan?
I do currently have a momentary switch that I have on Pin 40 (between Pin 40 and GND), that could stay in parallel
Thanks
Techstyle
This Schematic would use a second source as backup that to the main source and if the main source is cut, then the backup would ensure power to the Pi until power down, then the relay would cut it. the relays are https://www.amazon.com/dp/B00LW15A4W, the Power supplies are https://www.amazon.com/dp/B01MQGMOKI
There would have to be some code added In the file /boot/config.txt (use sudo nano /boot/config.txt):
dtoverlay=gpio-poweroff,gpiopin=20,active_low="y" <-- this would make sure that the relay released when the Pi was safely powered off.
there would need to be some code to trigger the shutdown when pin 40 (GPIO 21) was at 0v and I am not sure how to do that - I guess it would start with:
dtoverlay=gpio-shutdown,gpio_pin=21
I think I may have to make pin 40 (GPIO 21) pull down? anybody know how to do that?
anyone have any concerns with the plan?
I do currently have a momentary switch that I have on Pin 40 (between Pin 40 and GND), that could stay in parallel
Thanks
Techstyle