decodeais / Raspi_onoff

Simple solution to make a save Shutdown and Wake-up with one button
0 stars 0 forks source link
power-management raspberry-pi-zero-2w raspberry-pi-zero-w safe-shutdown wakeup

Raspberry Pi GPIO Safe Shutdown and Wakeup Solution

Overview

This project provides a simple and reliable way to safely turn your Raspberry Pi on and off using GPIO pins and the run/reset pad at the backsite, preventing data corruption and ensuring safe operation. It's compatible with any Raspberry Pi model, including the Raspberry Pi Zero 2W.

Safe Shutdown Schematic

Key Features

Installation

Follow these steps to modify the config.txt for safe shutdown:

  1. Open the config.txt file located in /boot/.
  2. Add the following lines:
    
    gpio=27=op,dl
    dtoverlay=gpio-shutdown,gpio_pin=17,active_low="y"

From the command line:



sudo sh -c 'echo "gpio=27=op,dl" >> /boot/firmware/config.txt'
sudo sh -c 'echo "dtoverlay=gpio-shutdown,gpio_pin=17,active_low=\"y\"" >> /boot/firmware/config.txt'