How to make a simple on-button.
-
Hello all,
So i just got a pi 3, to weeks ago and i want to get a proper on-button for the pi. I have seen all kinds of addons you can buy and put on the pi. But i have also seen some people just use a small button and connect it to 2 pins on the pi.
Now i plan to use the "shutdown system" i the retropie options, so i just need a way to turn it on without having jank the power cord out and in all the time.
But is there a reason i need to buy a powerblock if can just solder a button to a few pins? if no, which pins should i use for the button?
-
A few different ways go about it. You could create your own using the GPIO pins or buy one. Personally, I bought mine from Mausberry Circuits and just connected it to it. The powerblock is also another option as well.
-
@Hywyn85 If you plug in the pi, it boots. If you issue a shutdown command, it shuts down (it is still powered but sleeping). If all you want is a way to connect a button to turn it back on again from this state, simply connect a momentary switch (push button) between GPIO3 and GROUND. That will tell the Pi to "wake up" from a powered shutdown.
You can also add software to watch GPIO3 and trigger your soft shutdown command too. That makes a button on GPIO3 very handy, as it can serve as a physical shutdown command as well as a startup button.
-
Great! That makes things more simple.
-
@Hywyn85 Yeah, this is what I am doing with my system, but it's not perfect. It still comes on the moment it is plugged in. If it is in a shutdown state, it comes back on if the power cycles.
One way around this is a a physical toggle switch, but if you do that on the AC or in series with the micro USB, you run the risk of someone who doesn't know better throwing the switch and instantly killing power and possibly corrupting your SD card. This is where PowerBlock and other more sophisticated power solutions come into play. They accommodate a toggle so that the power can really be completely cut off, but in a way that allows a command signaled shutdown, and once down, disengages the actual power. It's why there is a market for these add-ons, and I wish I had one.
-
@Hywyn85 If your pi is to be connected to power but turned off via the retropie shutdown menu then a momentary pushbutton between gpio 03 and ground(pins #5 and #6) will restart the pi. Check out this from element 14. https://www.element14.com/community/docs/DOC-78055/l/adding-a-shutdown-button-to-the-raspberry-pi-b Using the python script it can be used to start and shutdown your pi.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.