A Button to Switch your Pi Safe On and Off

30,043
0
Published 2022-08-12
🚀 Ready to master the Raspberry Pi 5? Join our comprehensive online course today! Whether you're a beginner or an experienced enthusiast, our course has everything you need to innovate and excel. Dive into advanced Python programming, hardware integration, and practical projects that bring your ideas to life.

👉 Enroll now and start your journey: Guides4Tech.com

Unlock exclusive course materials, including a detailed 90-page E-Book, and take advantage of a limited-time discount for early sign-ups. Don't miss out on transforming your technical skills!
---------------------------------------------------------------

In this Video i explain how to connect a power button to your raspberry PI that ensure that your raspberry will shut Off safe. I will exlain where to connect it and how to configure the /boot/config.txt to use it right.

if this does not work, update your bootloader:

sudo apt update
sudo apt full-upgrade
sudo apt install rpi-eeprom
sudo rpi-eeprom-update

-------------------------------------------------------------

Tools i use:
Wires: amzn.to/3Etm4Nl *
bread board kit: amzn.to/3PvUTrk *
LED set : amzn.to/3P94pzo *
transisotrs: amzn.to/44LrEVZ *
Pi Pico W: amzn.to/467nAR3 *

*affiliate link

-------------------------------------------------------------

All Comments (21)
  • @jayhays8267
    Wow, that was simple! I was trying to use some scripts that I found elsewhere for this power button but they didn't work (error messages), this worked great and it was fast and easy!
  • @Jarlitz
    Exactly what I was looking for, thanks!😁
  • @nadajoey1
    Im I am running Batocera for my arcade cabinet on my SD card, do I remove the SD card before proceeding?
  • @svidrr
    Thanks! Now I can use 1 button to turn on and off raspberry instead of 2!
  • @hydroturd
    Bruce Dickinson is teaching us electronics. Great video
  • @FW200
    Worked perfectly, thanks!
  • @Ja14111948
    Excellent, thanks. Another question re sound: I got the small screen with a 4pin connector plugged into the back to get sound, which worked okay. However the screen was too small and I got myself a HDMI switch where I can share a larger screen between Windows 11 and the Raspberry Pi 4B. The problem is: no sound because I disconnected the small screen. Is there a way where I can plug the 4Pin connector into the Pi's GPIO?
  • @prisilabaez6398
    Hi! Its possible to use a button of type switch (two state, not holding/push button) ? Its convinient and safe? Great video too.
  • I really appreciate the help. And no need to git clone. Thanks 👍ðŸŋ
  • @Despotricador
    I have followed the steps but when I press the button, Kodi shows the shutdown menu . Is there any command to force shutdown directly?
  • @SassafrasSapling
    Do you need to do the software if you have Android installed on the Raspberry Pi?
  • @Stardigit
    Hi. is there anyway to do this on Dietpi with Amiberry??
  • @cjlowe1650
    I take this back. This does no more or less than the python code projects offered. It still keeps my fan powered on. It doesn't start up if I hit the button again. If I need to power off I still have to unplug the usb power supply manually.
  • @mattivirta
    i just need code, what need make or were have code, reset/safe shutdown. i has before but new image not have and not found old code anywere. bush button short shutdown and if want only reset bush logtime about 5-10 sec.
  • @didakad4207
    On the 64 bit version you need to press the button twice unlike on the 32 bit version of pios. How can I fix that?