mattg31
Posts: 79
Joined: Fri Jan 05, 2018 9:55 pm

Power button types on raspberry pi

Tue Feb 06, 2018 12:16 am

Hi everyone,

Just wanted to get some advice from you guys on this one, as I have read some conflicting comments on some of these tutorials and threads.
I am looking to add a power button to my raspberri pi, as it will be enclosed in a case, and I want the user to use a rocker switch to shut it down safely.

This tutorial looks easy, just uses a switch, a GPIO pin and a python script at startup.
https://howchoo.com/g/mwnlytk3zmm/how-t ... spberry-pi

So if it's as easy as above, why buy this? https://www.pi-supply.com/product/pi-su ... er-switch/
There are quite a few of variants of this as well.
I would obviously rather use a simple switch and two wires, but am worried as some people mention it may not be safe due to some GPIO pins starting in a high state during bootup.

Is the first example missing something critical?

Thanks for any input!

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Power button types on raspberry pi

Tue Feb 06, 2018 1:02 am

The simple switch can shut down or restart the RPi but does not remove power from the RPi board. When shutdown the RPi board still uses a small amount of power.
The other switch removes power completely from the RPi board.
IMO use the simple switch method unless you want to run the RPi on batteries.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

mattg31
Posts: 79
Joined: Fri Jan 05, 2018 9:55 pm

Re: Power button types on raspberry pi

Tue Feb 06, 2018 9:56 am

Great, thanks!

Return to “Beginners”