Skip to content

The-Exterminator/Raspberry-Led-Power-Button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

Create Led Shutdown Switch


This power switch will shutdown the Pi safely so that you don’t have
to worry about corrupting your SD card and file system,
which can happen if you just disconnect the power abruptly.

  • Add config device tree overlays
    sudo nano /boot/config.txt

  • Insert this to the bottom
    dtoverlay=gpio-shutdown,gpio_pin=3,active_low=1,gpio_pull=up

  • Create file
    sudo nano /etc/udev/rules.d/99-gpio-power.rules

  • And insert this
    ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \
    SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \
    ATTRS{keys}=="116", TAG+="power-switch"

  • And restart raspberry pi.

I2C must be deactivated if you use GPIO3 (Pin 5)


Screenshot

About

Raspberry Led Power Button

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published