Combined Power on / off Button for Raspberry Pi
You can wire GPIO 3 and a second GPIO connected together and to ground through a switch Using GPIO 3 for power up and second GPIO for shutdown.
By default, the software assumes the switch is connected to pin BCM 24. The pin can be changed in the Python source file.
- Connect to your Raspberry Pi via SSH
- Clone this repo:
git clone https://github.com/lihak/rpi-power-button.git
- Run the setup script:
./rpi-power-button/script/install
If you need to uninstall the power button script:
- Run the uninstall script:
./rpi-power-button/script/uninstall
Connect the power button to Pin 5 (BCM3 - SCL) and Pin 18 (BCM24) and any GND Pin shown in this diagram: