2023-01-10, 05:17 PM
I started off just installing a power switch. momentary switch was connected across pins 39 (GND) and 40 (GPIO21). an LED was connected up between pin 38 (GPIO20) and the same GND (39).
In the file /boot/config.txt (use sudo nano /boot/config.txt)
Add the following:
#on/off switch
dtoverlay=gpio-shutdown,gpio_pin=21
dtoverlay=gpio-poweroff,gpiopin=20,active_low="y"
this will command a shutdown when pin 21 is grounded and then when power is off, pin 20 will go low - this is a simple demonstrator and works well (and you can prototype with simple components)
mine looked like this:
simple and easy to use, but breakers got switched off...
In the file /boot/config.txt (use sudo nano /boot/config.txt)
Add the following:
#on/off switch
dtoverlay=gpio-shutdown,gpio_pin=21
dtoverlay=gpio-poweroff,gpiopin=20,active_low="y"
this will command a shutdown when pin 21 is grounded and then when power is off, pin 20 will go low - this is a simple demonstrator and works well (and you can prototype with simple components)
mine looked like this:
simple and easy to use, but breakers got switched off...