Button and LED holder for Raspberry Pi 3
I made and tried this for the Raspberry Pi 3, but this guide should work with most of the Raspberry PI's but some modells don't have the RUN/Reset pinouts.
The used GPIO pins in this project are the same for Raspberry Pi 3 and Raspberry Pi Zero.
Shutdown - Shuts the Pi down safely from inside the OS.
Reset/Run - Both resets the Pi and will turn it on if it has been shutdown.
LED - lights up whenever the micro usb power cable is connected, the power button
I made this button and led holder for the Mini NES Pi 3 Case By LKM,
I didn't really spend much time on the button holder, just made it so it should work for me, included the 3D file if anyone feel the need to edit the thing.
The button holder works with all orientations of the Mini NES Pi 3 Case.
What you need:
- 2x Momentary push button.
- 1x 3mm red LED.
- 1x 150 Ω resistor (higher value is fine if you want a less bright led, but lower value then 68 Ω might break the LED Diode).
- Soldering iron & solder wire
- 6x normal wires or 3x Female To Female jumper wire that you cut in half to get 6x cables with female jumper in one end and a striped wire to solder in the other end.
- Heat shrink tubing or electrical tape to insulate the wires.
- Hot glue gun
- 2x Male pin header connector or you can solder the cable directly without the pin header connectors.
To get it working i did the following:
1. Reset button:
Most Raspberry Pi models have a build in force reboot function, you only need to solder 2 pins to the 2 holes marked "RUN" and the other ends to the Momentary push button. (No programing or further configurations needed)
2. LED light:
Simply plugged in 1 female cable to the ground and 1 female cable to the 3.3V pin then solder a 150 Ω resistor to the end of the 3.3V(+) cable and the end of the resistor to the Anode(+) on the LED (the long leg) and soldered the GND(-) cable to the Cathode(-) on the LED (the short leg).
I used a normal 3mm red LED with some hot glue to hold it in place and electrical tape to isolate the metal surface of the legs, but you can also use shrink tube but make shure to isolate each leg separate so you don't short the circuit.
(The 3.3V GPIO PIN are always High (active) when the Raspberry Pi have power connected so the LED will always be active when the Raspberry Pi have power, much like the standby LED on a TV, so you don't need any scripts running in order for it to work with this solution)
3. Off button:
3.1 installing WiringPI:
In order to controll the GPIO input/output on the Raspberry Pi with Retropie I had to install WiringPI.
First check that wiringPi is not already installed. In a terminal, run:
If you get something, then you have it already installed. The next step is to work out if it’s installed via a standard package or from source. If you installed it from source, then you know what you’re doing – carry on – but if it’s installed as a package, you will need to remove the package first. To do this:
sudo apt-get purge wiringpi
Then carry on.
If you do not have GIT installed, then under any of the Debian releases (e.g. Raspbian), you can install it with:
sudo apt-get install git-core
If you get any errors here, make sure your Pi is up to date with the latest versions of Raspbian: (this is a good idea to do regularly, anyway)
sudo apt-get update
sudo apt-get upgrade
To obtain WiringPi using GIT:
git clone git://git.drogon.net/wiringPi
If you have already used the clone operation for the first time, then:
git pull origin
Will fetch an updated version then you can re-run the build script below.
To build/install there is a new simplified script:
The new build script will compile and install it all for you – it does use the sudo command at one point, so you may wish to inspect the script before running it.
Test wiringPi’s installation
run the gpio command to check the installation:
That should give you some confidence that it’s working OK.
Credits for the wiringpi guide where it belongs:
WiringPi is released under the GNU Lesser Public License version 3.
3.2 Connecting the power button:
I used this tutorial: https://www.element14.com/community/docs/DOC-78055/l/adding-a-shutdown-button-to-the-raspberry-pi-b
3.3 Programming the power button:
I used superglue to get the button/led holder to stick to the case and hotglue to secure the LED in place.
I included a breadboard view of how i wired everything.
Be careful I don't take any responsibility if your raspberry pi go up in a puff of smoke or if you hurt yourself or others.
If you are unfamiliar with GPIO/Electronics/Raspberry Pi be careful and read up on it first.