Page 32 of 37

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Tue Jul 19, 2016 6:02 am
by Camble
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.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Tue Jul 19, 2016 6:02 pm
by Popcorn
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?

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed Jul 20, 2016 1:23 am
by Camble
@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.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed Jul 20, 2016 8:59 pm
by Popcorn
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.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Thu Jul 21, 2016 7:56 am
by Ganreizu
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!

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Thu Jul 21, 2016 8:00 am
by Camble
@Ganreizu Not sure which solution you mean, but I am hoping to have a PCB made to replace this:

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

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Thu Jul 21, 2016 8:07 am
by Ganreizu
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

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Thu Jul 21, 2016 8:17 am
by Lanceomni
I'd be interested in the final product if you'd be willing to produce another.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Thu Jul 21, 2016 8:23 am
by larsen2011
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?

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Thu Jul 21, 2016 8:26 am
by Camble
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.