I was looking for a power switch or button for the Raspberry Pi 3. Does anyone have a recommendation on a good switch?
I was looking for a power switch or button for the Raspberry Pi 3. Does anyone have a recommendation on a good switch?
Pimoroni has also produced their own solution, as a SHIM: https://shop.pimoroni.com/collections/pimoroni/products/onoff-shim
The latest MagPi magazine has a how-to on page 50 for putting in a power switch. https://raspberrypi.org/magpi-issues/MagPi57.pdf
Another Raspberry Pi power switch solution is the PowerBlock from petrockblock: https://blog.petrockblock.com/powerblock-raspberry-pi-power-switch/ It has various input connector options, status LED, optional switched 5V output and mounting holes for all three Raspberry PI sizes.
I know that a solution that does a clean shutdown automatically is preferred but, a very simple approach is using a Belkin Conserve Power Switch: works wonders not only for the Raspberry Pi -I use them a lot-.
It is possible to add your own switch that works as both an on AND off push button.
It can be done trivially with some cheap components and a script.
I wrote a blog post on what I have set up:
Hi Graham,
Very interesting. Could you explain how come grounding pin 5 causes the Pi to boot up if it is halted? (I don't disbelieve, I believe you, I just genuinely didn't know about it, so I'm just curious to know more). Does the Pi pull-up that pin, in shutdown state? Is this at a particular run level, or when the CPU is halted?
Hi Shabaz,
I honestly don't know for sure what the technical details are as to why shorting pins 5 and 6 cause it to boot. I found that info on various forums like this one. I assume that the Pi must pull up pin 5 when it shuts down. My shutdown script essentially executes 'shutdown -h now', which safely shuts down and cuts power to the USB ports (which is ideal for me because I'm powering arcade controller button lights from the USB).
My original version didn't have the diodes or pin 13 connection, and I just used pin 5 in the script. This worked fine, however pin 5 is a bit of a 'special' pin, and a lot of hats seem to use it, which is why I decided instead to use pin 13 for shutdown detection. If you are doing a really simple project with no hats then you can just use pin 5 for both boot and shutdown, with no diodes.
Hi Graham,
Thanks for the info! I'll try it sometime hopefully, that's pretty neat that it can cause it to boot up.