Page 1 of 1
add a switch for turn on the pi
Posted: Thu Dec 05, 2019 1:24 pm
by joeydream
Hi everybody, the newcomer is called Joeydream, nice to meet you all here.
As title, i wish to add a switch for my pi instead for "unplug and plug" the usb cable. I read some discussion on web, and they said that i can add a "press button" for the "RUN pin" onboard. Is it a good idea ? Or the pin is designed for another purpose ?
Thanks for your help.
Re: add a switch for turn on the pi
Posted: Thu Dec 05, 2019 1:39 pm
by fruitoftheloom
joeydream wrote: ↑Thu Dec 05, 2019 1:24 pm
Hi everybody, the newcomer is called Joeydream, nice to meet you all here.
As title, i wish to add a switch for my pi instead for "unplug and plug" the usb cable. I read some discussion on web, and they said that i can add a "press button" for the "RUN pin" onboard. Is it a good idea ? Or the pin is designed for another purpose ?
Thanks for your help.
https://howchoo.com/g/mwnlytk3zmm/how-t ... spberry-pi
Re: add a switch for turn on the pi
Posted: Thu Dec 05, 2019 9:57 pm
by joeydream
Thanks, i follow your suggested webpage and it's work now. i think it's a proper way as it can shutdown the pi properly by an external physical button. Bravo.
anyway,
I still want to know more about what is the use of the pin "run", thx
Re: add a switch for turn on the pi
Posted: Fri Dec 06, 2019 12:55 pm
by deepo
The Run pin needs to be shorted to ground with a push button to wake the processor from halt state.
You use e.g. sudo shutdown -h now to enter the halt state.
/Mogens
Re: add a switch for turn on the pi
Posted: Fri Dec 06, 2019 1:10 pm
by emma1997
It's unfortunate "unplug and plug" and "press button" are confused because they are not at all the same. First one removes power completely but risks corrupting SD (unlikely but "It could happen!"

). Second, often referred to as "safe shutdown", but leave some current drain when off (halt mode).
Many think Pi4 draws more than older models but I found the opposite to be true, specially regarding halt mode. Using 12v DC converter instead of 5v wall wart to power the PI solved not only dreaded lightning bolt of death, but allows me to safely shut down with virtually no current drain. Like this:
https://www.raspberrypi.org/forums/view ... 8#p1550408
You can see the actual power cut slide switch for emergency use and a tact button for the more common 'safe' on/off. Even safe mode can draw relatively little power depending on eeprom settings.
Re: add a switch for turn on the pi
Posted: Fri Dec 06, 2019 8:14 pm
by alphanumeric
If you connect a normally open, momentary contact switch, to GPIO 3 (physical pin 5) and ground pin 6. Your Pi will boot up if it was shut down and left powered. Momentarily grounding GPIO 3 will boot it up. Also, if you add dtoverlay=gpio-shutdown to your config.txt file, it will do a safe shutdown when that same switch is pressed. One button does both. =)