You have every reason to add a power switch or a standy switch, which ever one you prefer to call it, to your Raspberry Pi when you first get your hands on it. Press the Power button any time to shutdown your computer. Press it again to wake it up. Both the hardware and software installations are easy and lightening fast, approximately 10 mintues.
Of course you can do without a power switch when running a desktop envrionment with keyboard and mouse attached. But this is not perfect as to restart your computer you still need to remove and reinsert the USB power cable again, which is annoying and embarassing. When you are running in SSH mode, it is even more difficult to shut it down, although you can do that from the Terminal. That's why we need a power button install today! Right now!
Section:
Hardware Set Up
1. Get a push switch or slide switch and a female to female jumper cable. Cut the cable in half and wire it to both side of the switch.
Tips: use heat shrink tube to avoid shortcircuiting
2, solder the connections to the switch. Move the heat shrink tube to cover the contact points of the switch after the solder cools down.
3, Use a heat gun or a lighter to heat up the tube
4, Attach one side of the jumper wire to GPIO 3, the other side to GND of Raspberry Pi. In this project, you can only use GPIO 3(SCL) not any others as you can only wake up the computer through this pin.
Warning: GPIO pins and physical pin numbers are NOT THE SAME. Make sure you follow the pinout correctly. For example, GPIO 3 is actually Pin 5 on the board.
Software Installation
1. Clone the script from the Github. In the Terminal, type:
git clone https://github.com/Howchoo/pi-power-button.git
2. Install the script. In the Terminal, type:
./pi-power-button/script/install
There you go. Done!
You can use the button to restart and shutdown the Raspberry Pi. It’s a pretty versatile, effective addition to your Pi board.
Resource:
Comments