Tackling Graceful Shutdowns on the GBZ

Various user-contributed guides for software-related things
User avatar
Camble
Posts: 885
Joined: Thu May 05, 2016 2:31 am
Location: Scotland
Has thanked: 269 times
Been thanked: 488 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Camble » Tue Jul 19, 2016 6:02 am

No. I struggled with this for several weeks. I even struggled to get the P-channel JFET to work, until I moved the slide-switch to the drain side.

User avatar
Popcorn
Trailblazer
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

Post by Popcorn » Tue Jul 19, 2016 6:02 pm

Camble wrote:The UART TX pin is 3.3v and it shouldn't be receiving any current. It keeps the JFET's gate at +3.3v. A diode won't hurt, but I don't think it's necessary.

The GPIO27 pin is simply shorted to ground when you want to signal a shutdown, so no protection required here either.

Something that would be more useful is a way to prevent the UART voltage fluctuating to as low as 1v while the Pi boots up. After about 5 seconds of bootup, it stabilises at 3.3v, but if you close the power switch before this happens, the PowerBoost will shut off. Strange, because the minimum cut-off gate voltage for this JFET is 750mV. Maybe just not enough to pinch off. I might try playing with the voltages some more.
I read about the UART doing this during boot. Apparently it's because this is actually a serial console. And the fluctuations are actual console messages. What about using GPIO-poweroff driver instead but using the active low flag which should give you a solid high state on boot up?

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Camble » Wed Jul 20, 2016 1:23 am

@Popcorn That could work. How early during bootup is the pin likely to be active? With UART, you're waiting maybe 8-10 seconds after power on before you can do a safe shutdown.

User avatar
Popcorn
Trailblazer
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

Post by Popcorn » Wed Jul 20, 2016 8:59 pm

Camble wrote:@Popcorn That could work. How early during bootup is the pin likely to be active? With UART, you're waiting maybe 8-10 seconds after power on before you can do a safe shutdown.
That's long. Try with the dtoverlay. That process should happen at boot. Maybe a second or two from power on.

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Ganreizu » Thu Jul 21, 2016 7:56 am

Maybe we can get a board made for this now? It's pretty easy and i'll just make it handmade myself anyway but it would definitely help a ton of people!

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Camble » Thu Jul 21, 2016 8:00 am

@Ganreizu Not sure which solution you mean, but I am hoping to have a PCB made to replace this:

[spoiler="Perfboard prototype"]Image[/spoiler]

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Ganreizu » Thu Jul 21, 2016 8:07 am

Camble wrote:@Ganreizu Not sure which solution you mean, but I am hoping to have a PCB made to replace this:

[spoiler="Perfboard prototype"]Image[/spoiler]
Exactly that yes. :D

Lanceomni
Posts: 29
Joined: Fri Jul 01, 2016 12:19 am
Has thanked: 18 times
Been thanked: 3 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Lanceomni » Thu Jul 21, 2016 8:17 am

I'd be interested in the final product if you'd be willing to produce another.

larsen2011
Posts: 35
Joined: Sun Jul 17, 2016 11:37 am
Has thanked: 16 times
Been thanked: 4 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by larsen2011 » Thu Jul 21, 2016 8:23 am

Am I correct that this setup does the "work" but is not using a Pololu?

So looking at the wiring diagram my understanding is that we have the one JFET, a resistor and the switch as components plus board and cables?

Image

So this goes to EN and GND from the Powerboost as well as to the mentioned GPIOs on the Pi?

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Camble » Thu Jul 21, 2016 8:26 am

Alright, I'll update when I can. In the meantime, I've got a short guide to post in the Hardware section. I want to test @Popcorn's dtoverlay=gpio-poweroff idea with first.

@larsen2011 Yes. The circuit shorts EN to GND on the PowerBoost to keep everything off. After you slide the power switch to off, the JFET keeps the circuit open while the Pi shuts down.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests