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?
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,
I tried the method described in howchoo on my Raspberry Pi 3 with Raspbian.
This has just a single push button with no other components.
The button simply shorts ground (e.g. pin 6) to pin 5 gpio.
If the Pi is in its low power shutdown state after being previously shutdown, taking pin 5 low does wake it up.
Then after booting, a Python program listens for an interrupt on the same pin, and triggers a shutdown.
I found it works really well.
In my case, I am already using the ground pin 6 for my display, so I used ground pin 9.
The black wire is ground, the blue wire is the GPIO:
HowChoo also has an article for adding a power LED to signal when it is safe to remove power.
I fitted the LED next to the power button (its not shown in the picture above).
I found this useful, but a little misleading as the LED shuts off about 5 seconds before the SD card "ACT" LED stops flashing.
Regards - Paul
Hi Graham,
I tried the method described in howchoo on my Raspberry Pi 3 with Raspbian.
This has just a single push button with no other components.
The button simply shorts ground (e.g. pin 6) to pin 5 gpio.
If the Pi is in its low power shutdown state after being previously shutdown, taking pin 5 low does wake it up.
Then after booting, a Python program listens for an interrupt on the same pin, and triggers a shutdown.
I found it works really well.
In my case, I am already using the ground pin 6 for my display, so I used ground pin 9.
The black wire is ground, the blue wire is the GPIO:
HowChoo also has an article for adding a power LED to signal when it is safe to remove power.
I fitted the LED next to the power button (its not shown in the picture above).
I found this useful, but a little misleading as the LED shuts off about 5 seconds before the SD card "ACT" LED stops flashing.
Regards - Paul