Ugh! Sorry to hear that. Looking forward to seeing it come together.prerunnerseth wrote:Well my boards came in and I made a mistake. I used a different package of mybpushbutton controller than tested with and it seems one of the missing pins was actually needed. I'll have to order more
Tackling Graceful Shutdowns on the GBZ
- Zeke2040
- Posts: 22
- Joined: Tue May 17, 2016 2:11 pm
- Location: Alabama, USA
- Has thanked: 3 times
- Been thanked: 1 time
Re: Tackling Graceful Shutdowns on the GBZ
- Popcorn
- Trailblazer
- Posts: 354
- Joined: Thu May 05, 2016 12:58 am
- Location: Berlin
- Has thanked: 29 times
- Been thanked: 71 times
Re: Tackling Graceful Shutdowns on the GBZ
Ok, here's the Power and Battery monitor finished. I've been testing it out and it works quite well.
Firstly, follow this wiring diagram. Here I'm using the Pololu Mini Slide Switch LV.

PLEASE NOTE: In the diagram, the Pololu's built-in slide switch is set to On, this is from their website. We need this always in the OFF position.
For the software monitor, you'll need to use SSH and log onto the Pi. Default user PI and password "raspberry"
You should be able to do this if you have a Wifi adapter on the Pi Zero and then connect from a computer on the same Wifi network. (Use Putty on PCs)
At the command prompt, making sure you are the Pi user, type this to download the monitor and the videos:
You can then test it out by issuing this command:
Once you are satisfied that it detects your power switch and the low battery warnings, you can add it to the startup easily using the crontab of the pi user. I chose this method rather than messing with services because you'd don't have to be the root user.
Simply enter this line on the command prompt to add the monitor on startup.
Videos of it in action
https://www.youtube.com/watch?v=TRkEfD04unk
Low Battery Warning
https://www.youtube.com/watch?v=nRJ42oSrIg4
Power Switch test
Let me know how it works for you guys.
Firstly, follow this wiring diagram. Here I'm using the Pololu Mini Slide Switch LV.

PLEASE NOTE: In the diagram, the Pololu's built-in slide switch is set to On, this is from their website. We need this always in the OFF position.
For the software monitor, you'll need to use SSH and log onto the Pi. Default user PI and password "raspberry"
You should be able to do this if you have a Wifi adapter on the Pi Zero and then connect from a computer on the same Wifi network. (Use Putty on PCs)
Code: Select all
ssh pi@retropie.local
Code: Select all
cd ~;git clone https://github.com/NullCorn/GBZ-Power-Monitor.git
Code: Select all
python ~/GBZ-Power-Monitor/gbz_power_monitor.py
Simply enter this line on the command prompt to add the monitor on startup.
Code: Select all
echo "@reboot /usr/bin/nice -n 19 /usr/bin/python ~/GBZ-Power-Monitor/gbz_power_monitor.py" >> mycron; crontab mycron;rm mycron
https://www.youtube.com/watch?v=TRkEfD04unk
Low Battery Warning
https://www.youtube.com/watch?v=nRJ42oSrIg4
Power Switch test
Let me know how it works for you guys.
- Fleder
- Posts: 849
- Joined: Thu May 05, 2016 9:04 am
- Location: Germany
- Has thanked: 183 times
- Been thanked: 258 times
Re: Tackling Graceful Shutdowns on the GBZ
@[mention]Popcorn[/mention]
I am sorry, i am sure this was already answered, but will the push button switch work as well instead of the slide switch?
I am sorry, i am sure this was already answered, but will the push button switch work as well instead of the slide switch?
- Popcorn
- Trailblazer
- Posts: 354
- Joined: Thu May 05, 2016 12:58 am
- Location: Berlin
- Has thanked: 29 times
- Been thanked: 71 times
Re: Tackling Graceful Shutdowns on the GBZ
Yes, the push button will work. Put UART TX to CTRL. Everything else should be wired the same. We can also use the OFF pin and GPIO-Poweroff but CTRL should work fine.Fleder wrote:@[mention]Popcorn[/mention]
I am sorry, i am sure this was already answered, but will the push button switch work as well instead of the slide switch?

-
- Posts: 263
- Joined: Sun May 22, 2016 6:22 am
- Location: France
- Has thanked: 137 times
- Been thanked: 37 times
Re: Tackling Graceful Shutdowns on the GBZ
Is it possible to use the pololu's board switch as main switch instead of adding another ?
- Popcorn
- Trailblazer
- Posts: 354
- Joined: Thu May 05, 2016 12:58 am
- Location: Berlin
- Has thanked: 29 times
- Been thanked: 71 times
Re: Tackling Graceful Shutdowns on the GBZ
If you mean the on-board switch, it's super super tiny and won't work with the original DMG power switch.SidSilver wrote:Is it possible to use the pololu's board switch as main switch instead of adding another ?
If you mean the Emergency Latching Switch is not actually mandatory, but I recommend it just in case. It's there in the event of a kernel panic or some other condition where the monitor fails to power the pololu off. It's also there to disconnect the batteries when putting away the unit for longer periods.
-
- Posts: 279
- Joined: Fri May 06, 2016 5:36 pm
- Has thanked: 16 times
- Been thanked: 229 times
Re: Tackling Graceful Shutdowns on the GBZ
I've fixed my boards and ordered another the second revision. I was also able to make the board a little smaller. I did confirm by hacking in the correct package that they will function as intended.
-
- Posts: 263
- Joined: Sun May 22, 2016 6:22 am
- Location: France
- Has thanked: 137 times
- Been thanked: 37 times
Re: Tackling Graceful Shutdowns on the GBZ
Ok. Thanks. I didn't realize the actual size of the on-board switch.Popcorn wrote:If you mean the on-board switch, it's super super tiny and won't work with the original DMG power switch.SidSilver wrote:Is it possible to use the pololu's board switch as main switch instead of adding another ?
Final question, can you remember me what is the transistor for ?
- Popcorn
- Trailblazer
- Posts: 354
- Joined: Thu May 05, 2016 12:58 am
- Location: Berlin
- Has thanked: 29 times
- Been thanked: 71 times
Re: Tackling Graceful Shutdowns on the GBZ
Just found a small bug that will prevent the videos from playing on the Low Battery warnings. If you cloned the git repository before now, do this to grab the latest version. Sorry.
If you are reading this and haven't grab it previously, then you don't need to do this. (Although doing it never hurts to be up-to-date)
Code: Select all
cd ~/GBZ-Power-Monitor;git pull origin master
- Popcorn
- Trailblazer
- Posts: 354
- Joined: Thu May 05, 2016 12:58 am
- Location: Berlin
- Has thanked: 29 times
- Been thanked: 71 times
Re: Tackling Graceful Shutdowns on the GBZ
It acts like a simple switch. When the Low Battery LED saturates the transistor, it pulls the GPIO line low and our monitor detects that. When it's not, it's pulled high. Since the voltage on the LED is variable, this is the safest way to know for sure that there is a Low Battery condition.SidSilver wrote:Ok. Thanks. I didn't realize the actual size of the on-board switch.Popcorn wrote:If you mean the on-board switch, it's super super tiny and won't work with the original DMG power switch.SidSilver wrote:Is it possible to use the pololu's board switch as main switch instead of adding another ?
Final question, can you remember me what is the transistor for ?
Who is online
Users browsing this forum: No registered users and 1 guest