Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 871 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 871 Bytes

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