Tackling Graceful Shutdowns on the GBZ
Re: Tackling Graceful Shutdowns on the GBZ
Having all of the following features that chiz mentioned is a great goal for us to go for!
Safe shutdown on power off and low battery
Hard reset button
Battery indicators (low power, charging, on)
If we had all of those features we have a no mess legitimate gameboy! Something you could feel safer with a small child using. Really excited to follow and implement this.
Safe shutdown on power off and low battery
Hard reset button
Battery indicators (low power, charging, on)
If we had all of those features we have a no mess legitimate gameboy! Something you could feel safer with a small child using. Really excited to follow and implement this.
-
- 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'm a little confused as to what you want the reset button to do.
Re: Tackling Graceful Shutdowns on the GBZ
Rarely sometimes the pi can crash apparently and having a hard reset will let us cut/refresh power instead of having to take the case apart.prerunnerseth wrote:I'm a little confused as to what you want the reset button to do.
-
- 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
Ganreizu wrote:Rarely sometimes the pi can crash apparently and having a hard reset will let us cut/refresh power instead of having to take the case apart.prerunnerseth wrote:I'm a little confused as to what you want the reset button to do.
I'm thinking when you initiate a shutdown with the button or switch It will send a signal to the RPi to shut down. Once it receives that signal it cuts the physical power to the RPi, But there would be a timer. if it doesnt receive a signal from the RPi to turn off the physical power then after a predetermined amount of time it would kill the power anyways.
Re: Tackling Graceful Shutdowns on the GBZ
After further thought, I think that having the Low Bat signal directly shutting down the RPI might be a bad idea. Nothing more frustrating than not having saved in awhile and your game turns off without notice! Still having a visible indicator light is absolutely necessary in this case. The PowerBoost has a built in LED, but that's a little hard to have it visible in the case. It's also a little tough to wire up your own LED as the pin in HIGH when the battery is good, and LOW when it's not.
With this in mind, I've drawn up a quick schematic that might work. The LED goes between the EN pin and LBO. When the PowerBoost is enabled and battery level is good, EN and LBO are both tied to VBAT. When the battery level is low, LBO goes to ground, while EN stays high, thus driving the LED. When the PowerBoost is off, EN goes to ground, but LBO would stay tied to VBAT if the battery level is good! But, an LED being a diode this shouldn't be a problem since the breakdown voltage of most LEDs is greater than the worst case of 4.2V from VBAT. I haven't tested this schematic, can anyone point out any flaws I may have missed that could make it not work/damage components?
I'm hoping this could work since the Pololu switch has a prohibitively high shipping cost, and I don't think this scheme would take up much room at all to implement.

With this in mind, I've drawn up a quick schematic that might work. The LED goes between the EN pin and LBO. When the PowerBoost is enabled and battery level is good, EN and LBO are both tied to VBAT. When the battery level is low, LBO goes to ground, while EN stays high, thus driving the LED. When the PowerBoost is off, EN goes to ground, but LBO would stay tied to VBAT if the battery level is good! But, an LED being a diode this shouldn't be a problem since the breakdown voltage of most LEDs is greater than the worst case of 4.2V from VBAT. I haven't tested this schematic, can anyone point out any flaws I may have missed that could make it not work/damage components?
I'm hoping this could work since the Pololu switch has a prohibitively high shipping cost, and I don't think this scheme would take up much room at all to implement.

-
- 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
My simulation is working really well using one of our power path controllers.... it can use either a switch or a button. Right now. You flip the switch and the output enables. When the switch goes low an output is pulled low to tell the RPi to shut down. It waits for a signal from the RPI to tell it that its time to shut down. then it shuts off the physical power. If it doesn't receive a signal to shut down in 45 seconds it will shut down anyways. The 45 seconds is fully adjustable. only thing to test is the ability to have the Low batt signal also initiate a shutdown, but that can be as simple as having the RPI receive a signal from the Low batt and initiate a shut down.
Im going to order one of our prototype boards and start testing. Once i have this circuit working fully, I will work on integrating it into a battery charger/boost board.
Im going to order one of our prototype boards and start testing. Once i have this circuit working fully, I will work on integrating it into a battery charger/boost board.
Re: Tackling Graceful Shutdowns on the GBZ
How are we defining a low battery? For example, does it mean we have 20 minutes left or only 5? If it's 5 (or something very low) then an auto graceful shutdown makes sense. I assume that you could probably configure a script to make Emulation Station save your state prior to sending the shutdown signal.Masato wrote:After further thought, I think that having the Low Bat signal directly shutting down the RPI might be a bad idea. Nothing more frustrating than not having saved in awhile and your game turns off without notice! Still having a visible indicator light is absolutely necessary in this case. The PowerBoost has a built in LED, but that's a little hard to have it visible in the case. It's also a little tough to wire up your own LED as the pin in HIGH when the battery is good, and LOW when it's not.
- 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
Low Battery is defined by the Powerboost when voltage drops below 3.2V. Check the spec documents.tanooki wrote:How are we defining a low battery? For example, does it mean we have 20 minutes left or only 5? If it's 5 (or something very low) then an auto graceful shutdown makes sense. I assume that you could probably configure a script to make Emulation Station save your state prior to sending the shutdown signal.Masato wrote:After further thought, I think that having the Low Bat signal directly shutting down the RPI might be a bad idea. Nothing more frustrating than not having saved in awhile and your game turns off without notice! Still having a visible indicator light is absolutely necessary in this case. The PowerBoost has a built in LED, but that's a little hard to have it visible in the case. It's also a little tough to wire up your own LED as the pin in HIGH when the battery is good, and LOW when it's not.
https://learn.adafruit.com/adafruit-pow ... st/pinouts
In other news, I just wanted to provide my working model pin config in case anyone else wants to try. I know some of you were asking for this before. This is working live on my RPI, self-controlling it's own power.
EDIT: Removed Wiring Diagram for now because LBO can be pulled up to battery level of 4.2V which is higher than the GPIO input of 3.3V which might damage your PI. Just need to add a transistor or IC in between to limit the voltage. Will revise and repost the diagram once everything is 100%
Who is online
Users browsing this forum: No registered users and 1 guest