[Guide] Graceful shutdown switch without Pololu [RETIRED]
Re: [Guide] Graceful shutdown switch without Pololu
@RxBrad if your still in the testing mood, try leaving popcorns script as is meaning don't change anything. Then on your power switch instead of wiring the 3.3v from switch to pi, try wiring that switch leg to ground. Use layout #2.
- 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 That would work, except GPIO27 will be grounded when the switch is in the on position. You can use the other side of the DPDT switch, but 3.3v was used to make the circuit compatible with the DMG-01 switch.
Re: [Guide] Graceful shutdown switch without Pololu
Yes but script calls for it to be pulled high until the circuit is open which is what we want, isn't it?Camble wrote:@HoolyHoo That would work, except GPIO27 will be grounded when the switch is in the on position. You can use the other side of the DPDT switch, but 3.3v was used to make the circuit compatible with the DMG-01 switch.
- 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 switch will pull it to ground and override the internal pull-up. The Pi will think you want to shut down.
Re: [Guide] Graceful shutdown switch without Pololu
I finished my build without this feature eventually. It worked great, but after 4 turn offs something failed. Don't know what.
I think that a much easier solution is to use a tiny normally closed relay. With no voltage applied the relay will shorten the enable to ground. On power on the switch will disconnect the enable from ground and the pi will signal the relay to open. Now even if the switch will return to off position the enable pin is floating and the pi can control the relay.
I think that a much easier solution is to use a tiny normally closed relay. With no voltage applied the relay will shorten the enable to ground. On power on the switch will disconnect the enable from ground and the pi will signal the relay to open. Now even if the switch will return to off position the enable pin is floating and the pi can control the relay.
Re: [Guide] Graceful shutdown switch without Pololu
@Camble so then changing line 64 to 0 and line 87 to 1 should do it.
- 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
@RxBrad A JFET is a "tiny normally-closed relay".
@HoolyHoo Correct, but that's not leaving Popcorn's script as is.
@HoolyHoo Correct, but that's not leaving Popcorn's script as is.

Re: [Guide] Graceful shutdown switch without Pololu
Ok so may be @RxBrad can try it with those changes. My thinking is with your current circuit perhaps sending voltage to the gpio before it has been initialized in script is causing erratic behavior.
- RxBrad
- Posts: 278
- Joined: Fri Jul 22, 2016 9:10 am
- Has thanked: 125 times
- Been thanked: 160 times
- Contact:
Re: [Guide] Graceful shutdown switch without Pololu
I can try later today when I'm back home.
Is there maybe an issue because I'm using a DPDT switch to test (the same one Camble recommends near the beginning of this thread)? I assume the pins are laid out similarly to the DMG.
On the top row, for the OFF position, I have EN and the FET attached to the 2 leftmost pins. (Does the order matter here?)
On the bottom row for the ON position, GPIO 27 and 3.3 volt are attached to the two rightmost pins. (Again, does the order matter?)
Is there maybe an issue because I'm using a DPDT switch to test (the same one Camble recommends near the beginning of this thread)? I assume the pins are laid out similarly to the DMG.
On the top row, for the OFF position, I have EN and the FET attached to the 2 leftmost pins. (Does the order matter here?)
On the bottom row for the ON position, GPIO 27 and 3.3 volt are attached to the two rightmost pins. (Again, does the order matter?)
Last edited by RxBrad on Mon Sep 19, 2016 8:59 am, edited 2 times in total.
- 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
Unlikely. The script is what monitors the GPIO pin, so the voltage on the pin before the script runs is irrelevant.HoolyHoo wrote:Ok so may be @RxBrad can try it with those changes. My thinking is with your current circuit perhaps sending voltage to the gpio before it has been initialized in script is causing erratic behavior.
@RxBrad The DPDT switch is fine and so is your pin layout. You're at the point now where something really really silly is preventing this from working. As I've said, you'd be better to jump on Discord (link in my signature) and send me a PM instead of this back and forth on the forum.
Who is online
Users browsing this forum: No registered users and 1 guest