How to add switch to start and shutdown Raspberry Pi

In this post I will show how you can add a power switch to start and shutdown raspberry pi.

Introduction

In this post I will show how you can add a power switch to start and shutdown Raspberry Pi. It is not a good idea to always plugin/out you USB cable or switch on/off your mains power to shutdown or start Raspberry Pi. With a very simple hack you can add a power switch to your raspberry pi. This will not only help you to safely shutdown, it allows to restart the Pi without plugging/unplugging the power cable.

Steps and things you need

  • You just need a push switch and a pair of wire connecting switch to raspberry pi.
  • Update /etc/boot/config.txt with following line using command sudo nano /etc/config.txt
    1. dtoverlay=gpio-shutdown
  • Connect one wire to GPIO03 and other to GND ( PIN 5 and PIN 6 of respectively). Connect the other end to the push switch. Refer the diagram below.

Diagram/Schematic

switch to start and Shutdown Raspberry Pi

2 Comments

  1. The path /etc/boot/config.txt does not exist.
    May be the right path is: /boot/config.txt ? that is Update /boot/config.txt with following line using command sudo nano /etc/config.txt

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.