Here's my latest video to show that the automatic Low Battery Warning shutdown works 100%. The only intervention that I do in this video is just changing the power supply for the screen, from the wall to the battery. This is just to increase the load of the battery which forces a Low Battery condition. The shutdown process is all done by the daemon. I don't touch anything else or trigger it in anyway.
https://www.youtube.com/watch?v=TRkEfD04unk
In this, I'm using all the core GBZ components: A PI Zero, a BW Screen, a Lipo Battery, a Powerboost, etc. My battery level is around 3.3V so it's almost dead. In the start of the video, I have everything running off of the battery, except for the screen. When I switch the screen's power supply to run off of the battery, the screen pushes the Low Batt LED into a solid condition. And you can see the solid RED on the powerboost. The daemon detects that and then proceeds to shutdown as expected. Works great!
On the hardware side, I followed this guide BUT I discovered some biggish problems with this solution. And that is because when the battery level drains down around 3.2-3.3V, there's alot of bounce on the LED. So you don't want to powerdown on the first flash of the LED but you want to shutdown only when it's a solid condition.
So I solved this with some coding that ensures that there is no bounce over a certain period of time. So this way, you know for sure that battery is near dead and it's time to shutdown.
To do this, you use all the same GBZ components, like a Powerboost. But the extra things you will need are:
- Some wire
2N3904 NPN transistor
47k resistor
Here's the wiring diagram of the resistor and transistor from the original guide (note: I use GPIO17)
Also, I still want to clean up my code so I'll release that in the next day or so.
