[Guide] Graceful shutdown switch without Pololu [RETIRED]

Various user-contributed guides for hardware-related things
jsawhite
Posts: 31
Joined: Fri Aug 26, 2016 5:45 am
Location: Lutz, FL
Has thanked: 23 times
Been thanked: 7 times

Re: [Guide] Graceful shutdown switch without Pololu

Post by jsawhite » Fri Oct 21, 2016 6:06 am

Ganreizu wrote:@camble

I got a metric ass ton of wiring and whatnot done these past few days. Fully wired up the shutdown pcb today and it works great! I noticed that when the battery is plugged into the powerboost and it is charging through the micro usb, it doesn't safely shut down (and similarly when the battery is unplugged and the system is powered by the micro usb). When the battery is the only power source it works like it should though. Have I done something wrong or does the graceful shutdown just not trigger for those cases?

PS: When i was setting up the script I noticed that rasppi's default keyboard is for the UK and had trouble finding "~" for a good half hour lol. May want to mention changing the keyboard default to people's "normal" layout in the guide. :D
I actually have the same behavior with mine. As long as it's only on battery it works (most of the time), but will never shutdown nicely when plugged into power. I'm guessing it's fluctuations in either the FET or maybe the 100k resistor? not sure, but I exhibit the same thing...

User avatar
Ganreizu
Posts: 552
Joined: Thu May 05, 2016 8:20 am
Has thanked: 168 times
Been thanked: 97 times

Re: [Guide] Graceful shutdown switch without Pololu

Post by Ganreizu » Fri Oct 21, 2016 6:13 am

Camble wrote:@Ganreizu Glad to hear it! I'm not sure how you'd find the tilde on a US keyboard if the layout is UK to be honest. I know the tilde is beside the "1" for you, but it's beside Enter for me, along with # (our pound is £, on the 3 in place of # funnily enough) :roll:

It should shutdown regardless of power source, so as @SidSilver has said you may have missed something. I can take a look to confirm if you post some pics.
~ ended up being above enter on the british keyboard haha. There's a code to change they keyboard to us in the optimizations thread, i'll edit this post with it in an hour or so.

Pics:
IMG_1991.JPG
IMG_1991.JPG (1.12 MiB) Viewed 3235 times
IMG_1990.JPG
IMG_1990.JPG (1.45 MiB) Viewed 3235 times

User avatar
Camble
Posts: 881
Joined: Thu May 05, 2016 2:31 am
Location: Scotland
Has thanked: 269 times
Been thanked: 487 times

Re: [Guide] Graceful shutdown switch without Pololu

Post by Camble » Fri Oct 21, 2016 4:39 pm

@jsawhite @Ganreizu That is very strange. Your wiring looks fine to me. I'll need to see if I can recreate this.

User avatar
Ganreizu
Posts: 552
Joined: Thu May 05, 2016 8:20 am
Has thanked: 168 times
Been thanked: 97 times

Re: [Guide] Graceful shutdown switch without Pololu

Post by Ganreizu » Fri Oct 21, 2016 4:48 pm

Camble wrote:That is very strange. Your wiring looks fine to me. I'll need to see if I can recreate this.
I'm going to replace the wires for the micro usb itself and see if that's it. The ground wire was slightly burned through exposing some wire so that's why that tape is wrapped around it, and the connections to the pcb are strained because of the wire length. Besides that I don't see what is abnormal.

Once this is fixed I only need to connect the cartridge reader and finish wiring the AIO and i'm done!

Edit: @camble I switched out the wires for the micro usb port but same behavior. D:

User avatar
fdeluxe
Posts: 71
Joined: Tue Aug 23, 2016 10:16 am
Has thanked: 12 times
Been thanked: 27 times
Contact:

Re: [Guide] Graceful shutdown switch without Pololu

Post by fdeluxe » Wed Nov 09, 2016 4:42 am

Do you guys think it would be possible to ditch the JFET and use the Teensy/Arduino instead to shutdown the Powerboost? Just want to know your opinion before I start digging into this.

User avatar
Camble
Posts: 881
Joined: Thu May 05, 2016 2:31 am
Location: Scotland
Has thanked: 269 times
Been thanked: 487 times

Re: [Guide] Graceful shutdown switch without Pololu

Post by Camble » Wed Nov 09, 2016 4:48 am

fdeluxe wrote:Do you guys think it would be possible to ditch the JFET and use the Teensy/Arduino instead to shutdown the Powerboost? Just want to know your opinion before I start digging into this.
No. You need the JFET to act as a normally closed switch when the system is unpowered. If it was possible to use the Teensy/Arduino, it would be possible to just use the Pi.

User avatar
fdeluxe
Posts: 71
Joined: Tue Aug 23, 2016 10:16 am
Has thanked: 12 times
Been thanked: 27 times
Contact:

Re: [Guide] Graceful shutdown switch without Pololu

Post by fdeluxe » Wed Nov 09, 2016 5:14 am

Camble wrote:
fdeluxe wrote:Do you guys think it would be possible to ditch the JFET and use the Teensy/Arduino instead to shutdown the Powerboost? Just want to know your opinion before I start digging into this.
No. You need the JFET to act as a normally closed switch when the system is unpowered. If it was possible to use the Teensy/Arduino, it would be possible to just use the Pi.
I thought that a digital pins default state is that it's connected to ground(LOW). Thats why I thought about something like this:

Wiring:

EN to digitalPin02 on Teensy/Arduino
GPIO22 to digitalPin01 on Teensy/Arduino

The rest stays pretty much the same...

Startup

The power switch is slid to the ON position.
digitalWrite() on digitalPin02 goes HIGH
digitalRead() on digitalPin01 reads HIGH from GPIO22 as the Pi boots

Shutdown

The power switch is slid to the OFF position.
The 3.3v/GPIO27 connection is broken and a shutdown is signalled.
digitalRead() on digitalPin01 reads LOW from GPIO22 as the Pi shuts off
digitalWrite() on digitalPin02 goes LOW connecting EN to ground.
The PowerBoost shuts off.

User avatar
Camble
Posts: 881
Joined: Thu May 05, 2016 2:31 am
Location: Scotland
Has thanked: 269 times
Been thanked: 487 times

Re: [Guide] Graceful shutdown switch without Pololu

Post by Camble » Wed Nov 09, 2016 5:32 am

@fdeluxe You can do this with a pull-up resistor on the EN pin. The PowerBoost has a 200K pull-up on EN. Pulling EN high with a momentary switch and having a GPIO pin take over works fine. The problem is when you have a slide switch, the PowerBoost's LEDs oscillate quickly.

Why not try out your idea and post your findings?

User avatar
fdeluxe
Posts: 71
Joined: Tue Aug 23, 2016 10:16 am
Has thanked: 12 times
Been thanked: 27 times
Contact:

Re: [Guide] Graceful shutdown switch without Pololu

Post by fdeluxe » Wed Nov 09, 2016 6:58 am

@Camble I'll give it a try next week. Got to much going on right now to disassemble my GBZ and hook up everything to my breadboard.

tescorg
Posts: 6
Joined: Wed Aug 31, 2016 6:28 pm
Has thanked: 3 times
Been thanked: 3 times

Re: [Guide] Graceful shutdown switch without Pololu

Post by tescorg » Thu Nov 10, 2016 6:33 am

I want to do this using parts that I have available at home, to save me shipping costs and so I don't have to wait for the shipping.
I don't have any JFETs but I did have some NPN transistors.
I came up with this idea that I hope will work, and I can't wait to test it, but I wanted to have someone more knowledgeable than me take a look at it first. I don't want to fry my Pi Zero or Powerboost. :lol:

Image

So the idea is, the 10k resistor pulls down EN to GND. When the switch is moved to ON position, VBAT of the powerboost is applied to EN to bring it back HIGH to power everything up. The transistor is there to latch that VBAT to EN while KEEP ALIVE is HIGH and switch is in the OFF position.
Do you guys think this will work without frying anything? Do resistor values look okay? Is that correct use of an NPN transistor?

Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest