Posts: 89
Joined: Wed Aug 22, 2012 11:25 am
Location: Melbourne, VIC

On/off switch - a bit of an oldie, I guess

Sat Jun 11, 2016 8:22 am

One of the topics that gets raised every so often is that of an on-off switch - something that I have decided is becoming more important to me now that I am using Pis in gadgets (such as an Airplay receiver).
Based on a few ideas I have seen elsewhere, I have started on a prototype which uses the delay created by a capacitor discharging through a resistor to hold a MOSFET switched on while the Pi boots. At the end of the boot sequence, the Pi pulls a GPIO pin up to keep the MOSFET switched on. When the Pi shuts down, the GPIO pin goes down and then the power is cut.
On-off.png (32.94 KiB) Viewed 523 times
I still have some work to optimise the design and reduce its power consumption (especially in "off" mode) - one important change being replacing the LS family Schmitt trigger inverter that I am currently using with a HC family part. (I could only get a LS part on the weekend! :o )

A separate part is the external part of the "off switch", which is a switch connected to a GPIO pin which is set to input. When I detect a press on that switch, I trigger a shutdown. The two switches can be combined into a dual-pole momentary switch.

I have put together a bit more of a description here.
If anyone has any suggestions on improvements, I would be glad to hear them. I'm not exactly an electronics whiz!

Return to “HATs and other add-ons”