A Button to Switch your Pi Safe On and Off

Поделиться
HTML-код
  • Опубликовано: 2 июл 2024
  • 🚀 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
    ---------------------------------------------------------------
  • НаукаНаука

Комментарии • 85

  • @tahjthenerd1126
    @tahjthenerd1126 Год назад +5

    Short, simple, sweet! Thanks mate :)

  • @Jarlitz
    @Jarlitz Год назад +4

    Exactly what I was looking for, thanks!😁

  • @jayhays8267
    @jayhays8267 Год назад +8

    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!

    • @lutz4tech
      @lutz4tech  Год назад

      Thank you 😀 i also found thos not working Scripts in the preperation of this Video 😂😂

  • @gravelyetigravelyeti4284
    @gravelyetigravelyeti4284 Год назад +9

    im going to find the hugest comedy sized button ever to shut down my pi 👍😂

    • @lutz4tech
      @lutz4tech  Год назад +1

      Hahaha, would Love to See a picture of it 😀😀😂

    • @lutz4tech
      @lutz4tech  Год назад

      Maybe for this Project your Button would also fit:
      ruclips.net/video/jqCa5RZWT9s/видео.html
      😉

  • @user-fn4pe3mp8r
    @user-fn4pe3mp8r 3 месяца назад

    Very useful video! Thank you very much!

  • @hydroturd
    @hydroturd 5 месяцев назад

    Bruce Dickinson is teaching us electronics. Great video

  • @svidrr
    @svidrr 9 месяцев назад +1

    Thanks! Now I can use 1 button to turn on and off raspberry instead of 2!

    • @BadyssNebulous
      @BadyssNebulous Месяц назад

      and when you click on the button, the raspberry power up ? or this button is only used to shutdown the raspberry ?

  • @FW200
    @FW200 9 месяцев назад

    Worked perfectly, thanks!

    • @lutz4tech
      @lutz4tech  9 месяцев назад

      Your welcome :-)

  • @nadajoey1
    @nadajoey1 Месяц назад

    Im I am running Batocera for my arcade cabinet on my SD card, do I remove the SD card before proceeding?

  • @FourLightsOfficial
    @FourLightsOfficial 7 месяцев назад

    I really appreciate the help. And no need to git clone. Thanks 👍🏿

    • @lutz4tech
      @lutz4tech  7 месяцев назад

      Your welcome :-)

  • @Ja14111948
    @Ja14111948 2 месяца назад

    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?

  • @GAPIMAN12
    @GAPIMAN12 Год назад +2

    yayy it works! Thanks! :D

  • @NerdcraftRealm
    @NerdcraftRealm 7 месяцев назад

    this worked great !

  • @prisilabaez6398
    @prisilabaez6398 8 месяцев назад +1

    Hi! Its possible to use a button of type switch (two state, not holding/push button) ? Its convinient and safe? Great video too.

  • @Stardigit
    @Stardigit 7 месяцев назад +1

    Hi. is there anyway to do this on Dietpi with Amiberry??

  • @SassafrasSapling
    @SassafrasSapling 3 месяца назад

    Do you need to do the software if you have Android installed on the Raspberry Pi?

  • @nathanbasset
    @nathanbasset Год назад

    thank you!

  • @cedricvanbebber829
    @cedricvanbebber829 14 дней назад

    I did it exactly like shown in the video, but nothing happens when I press the button

  • @Despotricador
    @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?

  • @cjlowe1650
    @cjlowe1650 Год назад +2

    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.

  • @edrianloisarborilla4602
    @edrianloisarborilla4602 3 месяца назад

    Can i do this with dietpi with dac hat?

  • @MrRedhorizon
    @MrRedhorizon Год назад

    Thanks, worked like a charm.
    Ps. My use of the pi4 is quiet stupid, I use it as a smart tv box under android tv instead of buying the chinese crap.

  • @mattivirta
    @mattivirta 6 месяцев назад

    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
    @didakad4207 2 месяца назад

    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?

  • @Drake_Jokes_The_Life
    @Drake_Jokes_The_Life 15 дней назад

    Its the same for orange pi

  • @mindcraft4043
    @mindcraft4043 Год назад +1

    thanks

  • @iblocstudios5563
    @iblocstudios5563 Год назад +1

    great vid!

  • @christophercastro3505
    @christophercastro3505 Год назад +1

    Hey, I am trying to add the same functionality but I am running Ubuntu 20.04 on the pi instead of Raspbian, will it still work?

    • @lutz4tech
      @lutz4tech  Год назад +1

      Hey, lets say it this way: i have no Idea why it should not work, but i didn't tried it.
      Let my know If it works or not, others are propably interested too. Thanks in advance.

  • @pipieAliff
    @pipieAliff Год назад

    Can use for raspberry pi 2?

  • @karl1469
    @karl1469 7 месяцев назад +2

    its working, but not as expected:
    For shutdown, I need to trigger the button twice.
    1) trigger button once: it opens up the log-off window(shutdown, reboot...),
    2) trigger button again: it does the shutdown.
    Is this a feature? Maybe version related (Raspberry Pi OS Oct. 2023 release)?

    • @Obsidianxenon
      @Obsidianxenon 4 месяца назад

      That's exactly what the Pi 5 power button does. I'm looking for the same functionality in a Zero 2 W

    • @hermetheuscoffee
      @hermetheuscoffee 2 месяца назад

      Same issue here on my Pi5, but no solution (yet).

    • @Obsidianxenon
      @Obsidianxenon 2 месяца назад

      @@hermetheuscoffee There are broken out pins next to the RTC port for the button on the Pi 5.

    • @hermetheuscoffee
      @hermetheuscoffee 2 месяца назад

      @@Obsidianxenon yes, I’m actually soldered to those pads and not the GPIO, but that irritating “press twice” behavior is still there. There has to be a way in configuration to skip the “reboot/shutdown” screen, but for the life of me, I can’t find it.

    • @Obsidianxenon
      @Obsidianxenon 2 месяца назад +2

      @@hermetheuscoffee I'd say the second press feature is good especially if you press it accidentally.

  • @emilmanka6033
    @emilmanka6033 4 месяца назад

    not working on rpi 3b v1.2

  • @kurtroyales2659
    @kurtroyales2659 4 месяца назад

    May I know specifically what kind of switch to use here? I'm afraid I might pick the wrong one lol

    • @lutz4tech
      @lutz4tech  3 месяца назад

      In General there is Not much you can do wrong by choosing a Button. You can use Something Like this
      a.co/d/6K4q1aO
      Enjoy your Project

    • @virt1one
      @virt1one 2 месяца назад

      you want a switch of the type "momentary". most are of the correct type contacts "normally open". (or just "N.O." or "NO") Do not get it if it says "normally closed" / NC.

  • @genericinterneter
    @genericinterneter Год назад +2

    I’m using a Soviet-era switch to turn mine on and off 😎😎

  • @mattrosen1839
    @mattrosen1839 Год назад

    Lutz, amazing!! The button turns on my raspberry pi 3B+ and turns it off but then it automatically reboots. Any quick idea why?

    • @lutz4tech
      @lutz4tech  Год назад

      Thanks for your Feedback. At my 3b+ it Works without a Problem. Did you Update the bootloader? May this can Help.
      Just to make it clear you use a Button not a switch?

    • @mattrosen1839
      @mattrosen1839 Год назад

      @@lutz4tech Thank you. I will follow the boot loader instructions. Yes it is a switch. Is this compatible with running Retropie?

    • @lutz4tech
      @lutz4tech  Год назад

      @@mattrosen1839 please use a Button instead of the Switch.
      Never Tried retropi, but in my Unserstanding it should Work.

    • @mattrosen1839
      @mattrosen1839 Год назад

      HI! I appreciate all you feedback. How do you remove the code? It is still causing me issues. No worries if it is not an easy process. Appreciate you

  • @j.goggels9115
    @j.goggels9115 4 месяца назад

    How do you not cause a short-circuit ?

    • @lutz4tech
      @lutz4tech  3 месяца назад

      The Button is Connected to a gpio, Not 5v. Gpio Pins are made to "pull" Thema to gnd. They are protected inside of the IC.

  • @UzunKamis
    @UzunKamis 3 месяца назад

    Will this work with my RPi2B?

  • @gregorymurphy5055
    @gregorymurphy5055 Год назад +1

    Does this work for the Pico?

    • @lutz4tech
      @lutz4tech  Год назад +1

      No, only Zero and the big ones. On a Pico should it normaly Not a Problem to Switch the Power off, If your not writing to Files.

    • @gregorymurphy5055
      @gregorymurphy5055 Год назад +1

      @@lutz4tech Thanks, that's what I was thinking, but good to get confirmation.

  • @CsoszGergo
    @CsoszGergo Год назад +1

    My button is connected but it doesn't do anything, but if I disconnect the cables from it, it boots up the pi. What is going on?

    • @lutz4tech
      @lutz4tech  Год назад

      Hmm, sounds strange. Is your Button maybe opening If you Push it?

    • @lutz4tech
      @lutz4tech  Год назад

      @@CsoszGergo this Sounds Like a non-bouncing Switch. So is different to use, you need To Power it with a voltage and then its switching the Signal on the "Out" Pin to gnd (its an Open collector propably). If you supply it with (propably 3v3 or 5v) it should Work as well.
      AS a try what i explain in the Video use instead of this Button a Wire. This you can Close and Open it. For the Pi it Looks Like a Button.

    • @CsoszGergo
      @CsoszGergo Год назад

      @@lutz4tech I connected the VCC to 3x3 and even 5v, and then the OUT to the GND. Now it resets the pi, like when pressing the reset button on a computer. So it looks like it's still not the way to connect these. I try asking around in the rasp discord to see if someone can help out. But thanks for the vid!

    • @lutz4tech
      @lutz4tech  Год назад

      @@CsoszGergo i think you get me wrong. Vcc to 3v3, Out to Pi Button pin, gnd to gnd.
      Or use the wire ;-)

    • @CsoszGergo
      @CsoszGergo Год назад

      @@lutz4tech I tried this as well, but that does nothing.
      What you mean by wire?

  • @Jan-lb1lt
    @Jan-lb1lt 4 месяца назад

    How can I make it work for the pi5?

    • @lutz4tech
      @lutz4tech  4 месяца назад

      Pi5 has a own Button, on the side of the PCB.

    • @CorsairGamer515
      @CorsairGamer515 2 месяца назад

      My pi5 will be in a housing so would this still work?

  • @Z33Garage
    @Z33Garage Год назад

    sadly this does not seem to work with retro pie, and yes im using a button and not a switch

    • @lutz4tech
      @lutz4tech  Год назад +1

      I googled a bit, there is a RUclips Video explaining it for retro pie. I didn't Check it, so i don't know If it helps you but i Hope so.
      m.ruclips.net/video/4nTuzIY0i3k/видео.html
      Greetings lutz

    • @Z33Garage
      @Z33Garage Год назад

      @@lutz4tech thanksan it helped!!

  • @janssendalton8339
    @janssendalton8339 Год назад

    Why can't we use a switch? Why does it need to be a button?

    • @lutz4tech
      @lutz4tech  Год назад

      You can use a Switch in the supply, but this would directly Turn Off the Pi. So the software has No Change to Finish its writing Tasks and you can get corrupt Data.
      If you mean in the Same was as i described but usw a Switch. The Interface of the Pi is Made for a Button, so you would need to toggle the Switch fast (On/Off/on) like a Button would to it.

  • @techy9912
    @techy9912 Год назад

    can i use different pin?if yes. please do some tuto please

    • @mindcraft4043
      @mindcraft4043 Год назад

      yes, he shows you how to use another pin in this tutorial

  • @ChristianAldave
    @ChristianAldave Месяц назад

    didnt work

  • @mekinn8483
    @mekinn8483 Год назад

    I can switchon the system however i cant shutdown after pressing the power button. Can anyone help me.

    • @lutz4tech
      @lutz4tech  Год назад

      Hi sorry for late response. Did you do the Update as i described in the Video description?

  • @Bob_Meier
    @Bob_Meier Год назад +2

    What is wen the gpio Pins are used by a hat?

    • @lutz4tech
      @lutz4tech  Год назад

      Used by a hat? Typo?
      If the gpios are used you can try an Other one (need to Change the nimber in Software, but Not erveryone Work). Or you use an Other gpio for your application.

  • @tubeDude48
    @tubeDude48 Год назад

    *CTRL-Y X Enter*