--- title: Setting Power Button and LED with Device Tree Overlays tags: Raspberry Pi --- # Setting Power Button and LED with Device Tree Overlays * Power On: short pin 5 and GND * Power Off: In `/boot/config.txt` ```bash= # use gpio to shutdown dtoverlay=gpio-shutdown,gpio_pin=26,active_low=1,gpio_pull=up # shutdown button on gpio pin 26 (physical pin 37) ``` * Power LED: In `/boot/config.txt` ```bash= # use gpio to display PWR LED enable_uart=1 # PWR LED on gpio pin 14 (physical pin 8) ``` * Act LED: In `/boot/config.txt` ```bash= dtoverlay=act-led,gpio=16 # ACT LED on gpio pin 14 (physical pin 8) # dtoverlay=act-led,gpio=16,active_low=on # inverse on/off ``` # Reference * [Raspberry Pi Pinout](https://pinout.xyz/)