Open Bones-74 opened 5 years ago
when a load is added on to teh 5v transformer, the power dissipates much quicker. I've got may hands on an adafruit powerboost 500c which I intend to use a a mini UPS to power down the pi if mains is lost for X mins, X is user defined, in the config, probably 30s, or 5m or 20mins. Most power outages only last a few mins right? and after all if there is no power, then the sockets ain’t gonna be powered either!
can use the 3.3 right out of the buck module for the mains loss, ad can also tie in the LBO line from the powerboost to detect low battery and shut-down immediately. need to drop down the signal level through- see https://www.element14.com/community/thread/63677/l/powerboost-low-battery-output-to-safely-shutdown-raspberry-pi?displayFullThread=true
added the powerboost 500c to the pi and a python script to monitor the gpio attached to the 3.3v output from the mains-powered buck module. on loss of mains, the powerboost takes over supplying the PI. power loss is detected through the loss of 3.3v from the buck module, the pi will wait for 5mins before shutting down.
unfortunetly, once shutdown, the pi will not start up again when mains is back on. I could add a button to short the 'run' pins on teh PI, which would work, but obviously requires human intervention.
Ideally, on reapplication of mains, (whilst the the PI is still being powered by the powerboost-battery) a circuit will briefly short the 'run' pins thereby telling the pi to start up. but i do not a ciruit to do that yet.
The PI need to be shut-down properly. I've noticed that the ac-to-5vdc psu holds the voltage for a while 10-20s before dropping slowly, so if I can pick up when the ac drops, I should be able to safely shut-down the PI before the 5vdc supply stops being useful.
NB I've not seen how fast the psu discharges with active load, only when I've already shut-down the PI
An AC relay across L-N and switching GPIO level dv voltages should do the trick.
also see https://core-electronics.com.au/tutorials/how-to-make-a-safe-shutdown-button-for-raspberry-pi.html