Power Button For RPi V1.02
As everyone at some point will recognize the Raspberry Pi doesn't include any kind of shutdown button.
So the only way to power it off is by unplugging it from the power supply.
To make sure you get no corruption of your data files on the SD card you should shutdown the Raspberry before powering it off.
So the whole procedure can be a bit annoying especially if you want to use the Raspberry as some kind of embedded PC .
e.g. a media server or an internet radio.
Power Button provides a small circuit that includes the features:
- Sending a shutdown signal to the Raspberry if the Shutdown Button is pressed
- Waiting for the Raspberry to shut down
- Powering off the Raspberry after save shutdown
- Powering on the Raspberry after the Button is pressed again
- LED light indicating the current state: On / Shutdown / Off
- Easy to setup
There is a chart which can show you the function of the GPIO Pin definition of this board:
|Disk Status||21||Pin 40|
|Shut Down||24||Pin 18|
|PWR Status||26||Pin 37|
NOTE: Please make sure that your Raspberry Pi have 5V/2.5A power supply with this module!!!
How to set it up
- 1. Remove your TF card and connect it to your PC or laptop with TF card adapter.
- 2. Modify /boot/config.txt file as following:
- 3. Download shell script:
cd ~ git clone https://github.com/yoyojacky/rpi-pwrbtn.git cd ~/rpi-pwrbtn chmod +x rpi-psu_client.sh sudo ./rpi-psu_client.sh
- 4. Reboot your Raspberry Pi and plug power button on your RPi, press the button to test.