[Guide] Graceful shutdown switch without Pololu [RETIRED]
Re: [Guide] Graceful shutdown switch without Pololu
@camble just a couple questions.
Is it necessary to have @popcorn script installed for this circuit to work with the original dmg switch or will it work stand alone?
Also, maybe I'm not looking at it right, but in the schematic when the original dmg is in the "off" position there is no connection between enable and ground to close the circuit and disconnect the Powerboost. Wouldn't the Powerboost stay on at that position?
Is it necessary to have @popcorn script installed for this circuit to work with the original dmg switch or will it work stand alone?
Also, maybe I'm not looking at it right, but in the schematic when the original dmg is in the "off" position there is no connection between enable and ground to close the circuit and disconnect the Powerboost. Wouldn't the Powerboost stay on at that position?
- Camble
- Posts: 885
- Joined: Thu May 05, 2016 2:31 am
- Location: Scotland
- Has thanked: 269 times
- Been thanked: 488 times
Re: [Guide] Graceful shutdown switch without Pololu
@HoolyHoo Correct, you will need a script running to monitor the GPIO pin and shut down the Pi. @Popcorn's script does this perfectly. I will be supplying a script when my PCBs are ready.
In the second schematic, the DMG switch is already in the OFF position. The circuit is broken to turn on the PowerBoost.
In the second schematic, the DMG switch is already in the OFF position. The circuit is broken to turn on the PowerBoost.
Re: [Guide] Graceful shutdown switch without Pololu
Camble wrote:@HoolyHoo Correct, you will need a script running to monitor the GPIO pin and shut down the Pi. @Popcorn's script does this perfectly. I will be supplying a script when my PCBs are ready.
In the second schematic, the DMG switch is already in the OFF position. The circuit is broken to turn on the PowerBoost.
I'm sorry I know it's just me but I'm not quite understanding. In order for the Powerboost to turn off, the enable and ground must be connected, correct? So when I look at the diagram, when the dmg switch is in the off position, there is no connection between those pins, thus the Powerboost is on even though the switch is off. Please help me understand. Thanks.
-
- Posts: 263
- Joined: Sun May 22, 2016 6:22 am
- Location: France
- Has thanked: 137 times
- Been thanked: 37 times
Re: [Guide] Graceful shutdown switch without Pololu
When EN pin goes low the powerboost turns off. With the graceful shutdown, if the pi is on, the powerboost stays on. That's why you need the script. When you switch off, the script detects it and shutdown the pi. When the pi is off the powerboost turns off.
Re: [Guide] Graceful shutdown switch without Pololu
On ak34's AIO diagram the GND from the power in USB goes to the GND on the power boost. I presume there is only one GND on the power boost so we're taking 2 wires to it?
Re: [Guide] Graceful shutdown switch without Pololu
Hey @cambleCamble wrote:@skrapps924 If you're using Popcorn's Power Monitor, line 25 reads:
Change this line to read:Code: Select all
GPIO.setup(powerGPIO, GPIO.IN, pull_up_down=GPIO.PUD_UP)
I'll be adding a script to this guide at some point in future, since Popcorn's deals with low battery in a different way.Code: Select all
GPIO.setup(powerGPIO, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
Sorry for bugging you. I'm not sure if you saw the 2nd diagram I drew up. Can you verify which one is correct? The first one did turn on the unit but then it would not shut down, the 2nd one did not turn it on at all. I then found the code to modify popcorns monitor software. When ever I modify the code it gives a gpio error at shutdown then the OS will no longer boot. I have to apply the Retropie image again to get it to boot. What am I doing wrong?
1
deleted so people will not get confused
2
Last edited by hueblo on Mon Aug 22, 2016 1:53 pm, edited 1 time in total.
-
- Posts: 263
- Joined: Sun May 22, 2016 6:22 am
- Location: France
- Has thanked: 137 times
- Been thanked: 37 times
Re: [Guide] Graceful shutdown switch without Pololu
Your first schema is the good one.hueblo wrote: Hey @camble
Sorry for bugging you. I'm not sure if you saw the 2nd diagram I drew up. Can you verify which one is correct? The first one did turn on the unit but then it would not shut down, the 2nd one did not turn it on at all. I then found the code to modify popcorns monitor software. When ever I modify the code it gives a gpio error at shutdown then the OS will no longer boot. I have to apply the Retropie image again to get it to boot. What am I doing wrong?
2
From what you say, it seems to be a script issue.
in Popcorn scriptCamble wrote:If you want to use the original DMG-01 switch, you will need to connect the switch directly to the 3.3v pin on the Pi and set up GPIO27 to GPIO.PUD_DOWN
Last edited by SidSilver on Mon Aug 22, 2016 2:35 pm, edited 1 time in total.
Re: [Guide] Graceful shutdown switch without Pololu
Hey @SidSilver
Thank you for verifying the schematic. Below is the listing of the pins I have hooked up. I also added the code below to config.txt. When ever I change the code to GPIO.PUD_DOWN the pi0 no longer wants to boot. I have to apply the image again to get it to boot. What I'm doing wrong? Any help is appreciated. Also running Retropie 4.
Added to config.txt
Change to Popcorn's script
Physical Pin GIPO Description
13 GIPO27 Shutdown
15 GIPO22 Keep Alive
17 3.3V
Thank you for verifying the schematic. Below is the listing of the pins I have hooked up. I also added the code below to config.txt. When ever I change the code to GPIO.PUD_DOWN the pi0 no longer wants to boot. I have to apply the image again to get it to boot. What I'm doing wrong? Any help is appreciated. Also running Retropie 4.
Added to config.txt
Code: Select all
dtoverlay=gpio-poweroff,gpiopin=22,active_low="y"
Code: Select all
GPIO.setup(powerGPIO, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
Physical Pin GIPO Description
13 GIPO27 Shutdown
15 GIPO22 Keep Alive
17 3.3V
- Camble
- Posts: 885
- Joined: Thu May 05, 2016 2:31 am
- Location: Scotland
- Has thanked: 269 times
- Been thanked: 488 times
Re: [Guide] Graceful shutdown switch without Pololu
@HoolyHoo The second diagram with the DMG switch shows the switch is in the off position. The EN pin is connected through the switch to the Drain pin on the JFET.
@hueblo The second diagram is the correct one. The pairs are: 3.3v & Shutdown. EN & Drain.
@SidSilver Nope, sorry.
@hueblo The second diagram is the correct one. The pairs are: 3.3v & Shutdown. EN & Drain.
@SidSilver Nope, sorry.
-
- Posts: 263
- Joined: Sun May 22, 2016 6:22 am
- Location: France
- Has thanked: 137 times
- Been thanked: 37 times
Re: [Guide] Graceful shutdown switch without Pololu
Oh sorry I thought the tracks were vertical (because of the schematic)Camble wrote:@HoolyHoo The second diagram with the DMG switch shows the switch is in the off position. The EN pin is connected through the switch to the Drain pin on the JFET.
@hueblo The second diagram is the correct one. The pairs are: 3.3v & Shutdown. EN & Drain.
@SidSilver Nope, sorry.
Who is online
Users browsing this forum: No registered users and 1 guest