How to Add a Power Button to Your Raspberry Pi (+ FLIRC Case Install!)

Поделиться
HTML-код
  • Опубликовано: 17 авг 2019
  • In this video, I'll teach you how to build your own Raspberry Pi power button, allowing you to shut your Pi down safely! I'll also show you how to install it in a FLIRC (or other Raspberry Pi) case. This will work with any Raspberry Pi model (Raspberry Pi 4, 3, Zero, etc.)
    ---
    ● View the full text/photo guide on howchoo:
    howchoo.io/raspberry-pi-power...
    ● Everything you'll need (direct links):
    1. Premade button: howchoo.io/pi-power-button-yt
    - OR -
    1. Normally Open (NO) momentary button: amzn.to/2HdRlq4
    2. Jumper wires: amzn.to/33GlsQH
    3. Soldering iron: amzn.to/2KGN7JC
    4. Solder: amzn.to/2HcB3xP
    5. Raspberry Pi 3 FLIRC case (optional): amzn.to/31NC873
    6. Raspberry Pi 4 FLIRC case (optional): amzn.to/328YOQw
    ● Or, see all products in our Amazon List:
    www.amazon.com/shop/howchoo?l...
    ● Build your own 3D-printed soldering fume extractor:
    howchoo.io/diy-solder-fume-ex...
    ● Raspberry Pi 4 EEPROM/bootloader:
    Download link: drive.google.com/file/d/1hrnz...
    Release notes: www.raspberrypi.org/forums/vi...
    ● Theme song:
    "Microchip" by Jason Farnham from the RUclips Audio Library.
    ● Affiliate link/advertising notice:
    I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to AMAZON Sites. When you click on an Amazon link above and buy something through Amazon, Amazon may give me a small commission.
  • НаукаНаука

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

  • @JeanPaulLapointeCGI
    @JeanPaulLapointeCGI 4 года назад +6

    Wow! 100% on my Pi 4. This was an awesome little project.

  • @drwhowhogrub3908
    @drwhowhogrub3908 4 года назад +1

    This is by far the best tutorial for a power button. Very easy to do thanks very much

  • @raudet28
    @raudet28 3 года назад +1

    Simple , straight forward, like that. Thanks for this video it actually was more helpful than I first imagine.

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

    Works on PI 4 in March 2023. Many thanks for all the hard work saving me loads....

  • @thndrpnts
    @thndrpnts 4 года назад +8

    Aw man. Seeing those RadioShack switches brings back memories. That was my first job right out of high school!

    • @Howchoo
      @Howchoo  4 года назад +3

      Aww yeah. I miss being able to run there to pick up a quick component or switch last minute-worth paying 5X the price :)

    • @teesdiy3993
      @teesdiy3993 3 года назад +1

      Radio shack was called Tandy in Australia back in the day.. Gone now.. Jaycar is my shop now when I need something right then.

  • @m.hannis9894
    @m.hannis9894 4 года назад +2

    Excellent video!!! I just bought the premade button from your website, and will complete the project!!! Also liked and subscribed!!!

    • @Howchoo
      @Howchoo  4 года назад +1

      M. Hannis Awesome! Glad you liked it, we’ll ship your buttons out today :)

  • @xaniac2429
    @xaniac2429 3 года назад

    Thank you for the tutorial! Very easy to follow along and it worked just like a charm.

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

    Awesome!! Thanks so much for your scripting, your video and the detailed write up on your site. I just wired and installed on my Pi4 which is in vehicular use. Now, so much easier to shut down gracefully, with a physical button, instead of the GUI (or worse, turning off ignition key and hard-crashing the pi). I was prepared to copy and paste the code, run it at boot up etc etc. But your script did all the heavy lifting. Cheers!!!

  • @stressed76
    @stressed76 4 года назад

    Man that worked like a charm! Thanks for saving me from pulling my hair out🤣.
    Tried older diys with no luck, then finally found this! Thank you sooooo much!!

  • @xflow79
    @xflow79 3 года назад

    Thanks for the nice tutorial, now i was easily able to add the power button and status led to some pi3 and a pi4! thank you!

  • @DrKazAstro
    @DrKazAstro 4 года назад +1

    You legend. Thanks so much - this worked first go - super fast - super easy - THANKS SO MUCH

  • @ninoponchev
    @ninoponchev 3 года назад

    Great video! I tried it on raspberry zero W and it worked on first try!

  • @VeryMuchBlessed
    @VeryMuchBlessed 4 года назад +3

    Great instructive video howchoo! I've been looking for this to add to my Pi 4B for days. Works great. Thanks much for making this video.

    • @Howchoo
      @Howchoo  4 года назад

      No problem! Stay tuned for more :)

  • @00Gerny00
    @00Gerny00 2 года назад

    Super easy and it worked on my Pi4! Thanks so much

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

    Great video, as the guy below stated, easy to follow and worked like a charm

  • @milanowns
    @milanowns 2 года назад

    Excellent tutorial! Simple to follow and no bs!

    • @Howchoo
      @Howchoo  2 года назад

      Aw, thanks so much! Glad you enjoyed it :)

  • @johncharlesbuccat3766
    @johncharlesbuccat3766 3 года назад +1

    WOOOOOOWW! THANK YOU VERY MUUUUUCH! Worked on first try :)

  • @umeshjadhav3326
    @umeshjadhav3326 3 года назад

    simple and worked without any extra hassle......great ! Thanks to you....

    • @Howchoo
      @Howchoo  3 года назад

      You're welcome!

  • @JoeEverett-nj1re
    @JoeEverett-nj1re 3 месяца назад

    Worked Great, I ran the code ahead of time, Thanks for the howto Video

  • @endlessbeast
    @endlessbeast 4 года назад +2

    Nice!! Thanks for share!!

  • @joshg8391
    @joshg8391 3 года назад

    Awesome work, man. Thank you a lot :D

  • @itstbe76
    @itstbe76 2 года назад

    Nice work, thank you! Works fine with my new Pi-Hole. 👍

  • @marlbear
    @marlbear 4 года назад +2

    Perfect!! My bartop is now 100% finished. Thank you 🙏🏼

    • @Howchoo
      @Howchoo  4 года назад

      No problem! Sounds like a cool project :)

    • @pdjames1729
      @pdjames1729 4 года назад +1

      @@Howchoo is usb3 speed still shafted on the 'new' firmware - I'm holding off on updates as All of the ones released so far have had other issues. I know it's a small risk but I'd reticent about bricking another one - having had one dev machine blowing it's hdmi 0 socket off from under-powering

    • @TheSimonScowl
      @TheSimonScowl 4 года назад

      Power Button: "Burrrrrrpp!!!!"
      Me: I'm cutting you off!

  • @jacobh6272
    @jacobh6272 4 года назад

    Awesome video I got my rpi 4b on dec 25 and it worked no problem no need to get the latest version. Btw recommend turning off the pi through the interface like you would a regular laptop or pc but turning ot on worked no problem.

    • @Howchoo
      @Howchoo  4 года назад

      Great, thanks for the info!

  • @timosman3877
    @timosman3877 3 года назад

    Worked perfectly thanks!

  • @therexershow
    @therexershow 4 года назад +10

    This video should have a ton more views. Great video.

    • @Howchoo
      @Howchoo  4 года назад

      Thanks! All in good time ;)

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

    Thank you! This works really well.

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

    Managed to make it work with a switch rather than a button. followed your instructions carefully and it works! now I need to figure out how to turn off the fan

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

      Hi! May I ask what type of switch did you use on your end? Will a rocker switch work?

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

      @@kurtroyales2659 yes a 2 way rocker switch with 3 connection points

  • @redpogo
    @redpogo 3 года назад

    Obrigado! Fiz e deu super certo.

  • @MiekkiVT
    @MiekkiVT 3 года назад +1

    Thanks you so much. This video helped me a lot.

    • @Howchoo
      @Howchoo  3 года назад

      No problem! Glad it helped :)

  • @salze145
    @salze145 3 года назад +1

    clean and nice work!

  • @GingerWithASoul100
    @GingerWithASoul100 3 года назад +1

    Great video, thanks for sharing this. Is there an easy way to add a delay for shutdown? I’m using this in my vehicle and it has some interference. I figured if I add a .5 sec shutdown delay (hold the button for .5 sec) it will keep the noise from shutting down my PI.

  • @sanjaybhatikar
    @sanjaybhatikar 2 года назад

    I have implemented this on a Raspberry Pi 3 and it works very well. Kudos to you for very clear instructions. I have a question that perhaps you can help answer. Will this solution work to power down the pi running on battery power when the battery is running low? I am guessing that pin 5 will go logic low as battery runs out, effectively same as shorting with pin 6 (GND). Thank you 🙏

  • @zatoichibeat
    @zatoichibeat 4 года назад +3

    For a raspberry pi 4 you can now update from the Terminal so no need for the boot loader, but once you install everything do a reboot first and then the button turns off and on. Thanks for the tut 👍

    • @mauznemo
      @mauznemo 2 года назад

      with sudo apt update?

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

    Great video - very clear and easy to follow. Thank you for sharing..
    Is the button a momentary button..

  • @rajibalam9748
    @rajibalam9748 4 года назад

    Thank you so much!!

  • @mikeg1zrn896
    @mikeg1zrn896 3 года назад +1

    Hello,
    Running Buster on a Pi 3b+, your script is the only one I got to work, thank you.
    Question, is possible to add a "Hold" time in the script so the button has to be held down for x number seconds before shutting down. Many thanks.

  • @maximobarawid6657
    @maximobarawid6657 2 года назад

    Thanks for this wonderful howto video. I did it to my RPi3B and it works. I have a question though. Do you have a tutorial on how to add a serial (RS232) port on a RPi3B+? I need a communication port to control a serial modem.

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

    Thank you for your script. Works great even on a Raspi 1 :)

  • @therealnamonid
    @therealnamonid 4 года назад +1

    I have a question. If we are already using Pin 5 for another thing like a controller, is there any way to change the pin settings for the button? Also great video!

  • @Lunolux
    @Lunolux 2 года назад

    Great video, thx
    I think i will add a led if i do that, idk if it worth i but i like having visual that its "on" when using button like that

  • @percypappiono8464
    @percypappiono8464 3 года назад

    thanks helped a lot :)

  • @Howchoo
    @Howchoo  4 года назад

    Don't have a soldering iron? Get a pre-soldered button here! howchoo.io/pi-power-button-pinned
    See the full guide on howchoo: howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi

  • @inonfarag
    @inonfarag 2 года назад +1

    Thanks working great!
    just one question, I've tried to change the script from PIN 3 to PIN 21,
    now it only shuts down the pi and not waking it up.
    any suggestions?

  • @kjkansara
    @kjkansara 2 года назад

    Great tutorial, thanks a lot. I was wondering how can I keep the host connection active even if I shut down the pi. PS. I am using Putty on Windows

  • @mrgatez2007
    @mrgatez2007 3 года назад

    CRACKING I love it I now if have my raspberry pi 4 in a *" fractal pc case "*

    • @mrgatez2007
      @mrgatez2007 3 года назад

      Using the cases power button to boot it up I will upload a video to my channel of it running off a power bank on my Sony 43 TV I LOVE IT with only 1 cable out of it witch is the HDMI cable

  • @allezism1
    @allezism1 4 года назад +1

    great, thank you

  • @viva7642
    @viva7642 3 года назад

    That's a 3d printed coffee cup!! :D nice vid.

  • @MrElofix
    @MrElofix 4 года назад

    Werry well explained man. Thank you verry much! The only thing i suggest is to get another case with bigger hight and position the button at the back nect to the sd card. This red button on your case loocks like an emergancy stop :)
    Technicaly....10 points, design....2 points ;)

    • @Howchoo
      @Howchoo  4 года назад

      Haha thanks for the feedback!

  • @fabian3265
    @fabian3265 3 года назад +1

    awesome, works!

    • @Howchoo
      @Howchoo  3 года назад

      Good to hear!

  • @ue260
    @ue260 3 года назад

    Thanks for this, very helpful. My PI ws turning on and off fine but all of a sudden it only turns it off. It won't turn back on and a reboot command is the same, shuts off but won't come back on.

  • @ianpiercy6551
    @ianpiercy6551 4 года назад +8

    Hi, nice video, I am using the 7 inch touchscreen which utilises pins 5 and 6 already, is there an alternative pin out location i can use for the button?? TIA. Ian

    • @RomanOnARiver
      @RomanOnARiver 3 года назад +1

      The only two pins actually required for the touchscreen are 5V and GND - consider if your use case actually requires you to use any others - it might not.

  • @lucbisschops
    @lucbisschops 4 года назад

    Got it, i made a type fault, works perfect thank you👍👍👍👍👍

    • @Howchoo
      @Howchoo  4 года назад

      Excellent!

    • @lucbisschops
      @lucbisschops 4 года назад

      @@Howchoo does it switch the negative wire? Open and close

    • @Howchoo
      @Howchoo  4 года назад

      @@lucbisschops What do you mean? It doesn't matter which order the wires go; there's no polarity here.

    • @lucbisschops
      @lucbisschops 4 года назад

      @@Howchoo ahhh ok, thats my problem than i have a psu relais controle for my 3d printer on my raspberry aswel, and the ground was pluged in on the same place your ground for the killswitch was programed in your script, thats why, when i shut down my psu relais, the raspberry pi shuts down aswell, is there a way to rewrite the script for a different position of the gpio.

  • @jmorahz
    @jmorahz 3 года назад

    Thank you!!!!!

  • @Adam-rw4xk
    @Adam-rw4xk 4 года назад

    Do power cables that have switches built-in do the same thing basically? Great video, fun to watch.

    • @Howchoo
      @Howchoo  4 года назад

      Thanks! And not quite-using a power cable with a switch is the same as ripping the cord out of the wall. That physically cuts power without SAFELY shutting the Pi down, which is bad :)

  • @pajaspk
    @pajaspk 3 года назад

    :D same third hand , same soldering machine :D i just have blue one :D awesome one for its price

  • @brutalpancho
    @brutalpancho 3 года назад

    really good tutorial thanks. no idea why there are any thumbs down. only thing is, for me, I have 2 fans running on the same pin so will have to see if theres a way to move them or the button elsewhere?

    • @Howchoo
      @Howchoo  3 года назад

      Which pin are they running on? If it’s pin 5, this is definitely required for the power button’s “wake” functionality. But you can likely move your fan to another one (any other GPIO pin) since the fan probably only needs basic GPIO functionality :)

  • @QletTV
    @QletTV 3 года назад

    What kind of wire stripper do you use? I really liked that one

  • @stefanmerk5750
    @stefanmerk5750 2 года назад

    hi, thanks for showing. I have a question, can you do this with a touch (capacitive) button? By touching the button for 3 seconds? that would work and if so, how?

  • @vongdong10
    @vongdong10 3 года назад +1

    Can I use different pins? The ones you showed are occupied by a display I'm using.

  • @TheOleHermit
    @TheOleHermit 4 года назад

    This looks like a good solution for saving power on a RPi4 connected surveillance camera, but using a low power WiFi connected ESP32 (& motion detector) instead of a mechanical switch. Assuming that the RPi4 never really powers down, how much power does it use while in 'sleep' mode? Does it require a RTC battery to keep it 'alive'? Thanks😎

  • @axwellx1553
    @axwellx1553 4 года назад +2

    Quality.

  • @kristiknight-craddock8748
    @kristiknight-craddock8748 3 года назад

    Excellent Video......Thank you......I would like to use a button with an LED light ring. How can I use a flat metal actuator, surrounded by a green plastic LED ring. On the back there are 3 contacts for the button (common, normally-open and normally-closed) and 2 for the green LED ring (+ and -). Connect 3 to 6V to the LED and the Normal Open as in your video. My question is what would I connect the LED ring to on the board?

    • @bartcowan6907
      @bartcowan6907 2 года назад

      Did you ever find a solution for this. I would like to use a lighted button as well.

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

    This works great. Just 2 things. 1). I get a message there is a resistor on GPIO3 when executing the script. 2). My Power does not fully go down. My Fan is still on although it looks like the USB ports are not active and of course the RED Led is still on.
    But this does Stop (shutdown) and Restart when I push the button.

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

    This worked great for my arcade cabinet power button until I needed to add a fan in 5v mode using pins 2 and 6. Can I use any other pins for a power button?

  • @olhakesta
    @olhakesta 2 года назад

    Hi! Good work!
    Unfortunately, however, although following all the steps indicated, this scheme does not work on my Raspberry Pi B+ V1.2 (2014) either with regard to the led or the on/off button (cf. the other video). Do you have any suggestions that can help me?
    Thanks in advance.

  • @KubiIay
    @KubiIay 3 года назад

    Will the raspberry also turn on when you re insert the power (usb) cable or can you just insert it and need to press the power button? Because I don’t want it to unnecessarily turn on when inserting power cable. Just like a normal computer for instance.

  • @pugk9unit
    @pugk9unit 3 года назад

    So does the button only work on sd cards that you have written this code to? So if you reflash your sd card with another software, you'd have to redo all these steps?
    Does this work with other OS's like retropie, OSMC, or Kodi?

  • @EmptyVessel5
    @EmptyVessel5 4 года назад

    Hello! I'm currently planning out my first RPi project ever and I'm curious whether or not you know if there's a way to have it where you have to hold the button to shut down. With the project I'm planning, I'd imagine there's a chance of the button getting accidentally hit during use, so I want to mitigate this problem before it even begins. You wouldn't happy to have any thoughts regarding this, would you?

    • @Howchoo
      @Howchoo  4 года назад +1

      This could be done by forking and modifying the code-would require some knowledge of Python, but it can definitely be done :)

  • @Powergeek
    @Powergeek 11 месяцев назад

    Which pins should I use when doing this with a 7" pi touch screen? Pin 6 is used as part of the wiring for that so are there alternatives I could use instead?

  • @leangalz
    @leangalz 4 года назад

    Awesome! I will use this for the arcade I'm working on. A question tho, Can I "unplug" the power cable after the script runs without any risk? Or the rpi stays on some kind of hibernation state?
    I'm asking this because I have a main switch on the Arcade to cut off all the electricity. (for safety reasons AND because I'm using a CRT tv that I turn off/on like this) and I pretend to use the button/script first and then press the main switch.
    Any thoughts?

    • @Howchoo
      @Howchoo  4 года назад

      Oh yeah you can totally cut the power after it shuts down safely. :) Just reconnect the power and it’ll boot right up.

    • @leangalz
      @leangalz 4 года назад

      @@Howchoo Great! So this is just what I need. Thanks you!!

    • @Speccy48k
      @Speccy48k 4 года назад +1

      Does it mean the shutdown script doesn’t perform a complete shutdown (power off) of the RPi?

  • @shingrutashish5639
    @shingrutashish5639 2 года назад

    Thank you for the video. can I install directly now without that bootloader thing because its been two years now. do these things updated now?

    • @Howchoo
      @Howchoo  2 года назад

      Yep, you don’t need the boot loader as long as you don’t somehow buy a super old Pi 4 that still has the original firmware (like old stock or something). Try skipping the firmware step and see if everything works. You can always do that step afterwards if needed.

  • @federicomilano5272
    @federicomilano5272 2 года назад

    Hi! THANKYOU!! Only 1 question; this is a "push" button or is the "click" button?

  • @armanditoetc
    @armanditoetc 3 года назад

    This video is so cool! TY.
    I have a Q. why this pin now also works to turn on the Pi?

    • @armanditoetc
      @armanditoetc 3 года назад

      I found on internet that devs aded a wake up routine on bootloader on GPIO3.

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

    Hey quick question, so if I am supplying power from an OBD2 adapter in my car, stepped down from 12v to 5v and then plugged directly into the usb port, if I run this script will it still shut down the pi? I am trying to think of ways around splicing a toggle into the obd cable. thanks!

  • @lauf7lauf375
    @lauf7lauf375 3 года назад +1

    Hi Howchoo, great and easy tutorial, however please help with one detail: I got the momentary NO button with 4 contacts (additional 2 contacts represent built-in LED functionality) - how should I connect /solder my button? Thanks for advice for anyone in this world. Cheers

    • @trispytreems
      @trispytreems 3 года назад

      I wish I had the answer to this, my Rpi 4 isn't working with this script and I don't know if it's the bootloader or the way I've soldered my button...

    • @jarkko4732
      @jarkko4732 3 года назад

      @@trispytreems I think you should be able to test your button with the instructions given between 02:07 - 02:28. Although the instructions are for a bit different thing (to detect if your button is a "normally open" or "normally closed" button), you can use the same style to detect which pins in your button are used for the button press if you try different pin combinations.

    • @trispytreems
      @trispytreems 3 года назад

      @@jarkko4732 just an update: it works now! All I had to do was do a Sudo apt get update then Sudo apt upgrade and it updated the bootloader.

  • @FMDev1
    @FMDev1 2 года назад

    Hey Zach! Love you channel, and appreciate all of your work.

  • @alexanderneels970
    @alexanderneels970 3 года назад

    Bist der beste ;-)

  • @1rowellb
    @1rowellb Год назад

    looking to add an LED on my Raspberry Pi 4b. Can I also add a raspberry pi fan as well? Or are the pins taken up by the button?

  • @cyberstar251
    @cyberstar251 3 года назад

    does ground need to be pin 6 or can it be any ground pin on the board? because 6 is already populated by a pwm cooling fan on mine.

  • @pandaguan
    @pandaguan 2 года назад

    I don't recommend stripping and soldering jumper wires, those are usually made of iron. It will corrode over time, specially that it would be exposed to the heat of the solder.
    Use a regular stranded copper wire instead.

  • @joshualawson7604
    @joshualawson7604 4 года назад +6

    Download link says "Sorry, the file you have requested does not exist."

  • @TheDarkelvenangel
    @TheDarkelvenangel 4 года назад +1

    Great video, however why not use the gpio-shutdown overlay?

    • @cpassuel9857
      @cpassuel9857 3 года назад

      Yes, I'm wondering too, it seems easier. Is there some limitations with gpio-shutdown method ?

  • @toddcoello6461
    @toddcoello6461 4 года назад +1

    I have a raspberry pi 4 and the pi 7 inch touchscreen. it uses the same pins is there a way to add a power button to that setup?

    • @toddcoello6461
      @toddcoello6461 4 года назад

      I was able to get a power button installed on my setup

  • @petebuka
    @petebuka 4 года назад

    Thanks for the video. I have a pi4 and would like to do this with a touch power button.. is this possible. it has gnd / io / vcc ?

    • @willsarms3
      @willsarms3 4 года назад

      yes this should be possible if you wire the gnd to gnd, vcc to 5v available on the board, and io to pin 5

  • @Dali-yd3bf
    @Dali-yd3bf 3 года назад

    Hello can I connect 2 wires in the same gpio for the screen and the buttons ?

  • @iwillalwasecomelast
    @iwillalwasecomelast 4 года назад

    very new to linux, but i'm enjoying the learning... i tried this and got this back
    /usr/local/bin/listen-for-shutdown.py:8: RuntimeWarning: A physical pull up resistor is fitted on this channel!
    GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
    and the button does not work.
    i'm using a 3b if that makes a difference

    • @dartveider1372
      @dartveider1372 4 года назад

      how has decided this problem? I heared we have to
      solder two resistors so that there is no short circuit

    • @nikolatotev
      @nikolatotev 4 года назад

      From what I know, there are builtin pull-up resistors which basically prevents shorting pins when using a button. In this case I can only assume that its warning you about that, but I'm not 100% sure.

  • @CheckitOutYaw
    @CheckitOutYaw 4 года назад

    Great video, very clear and you helped me allot! I want to build it in a PC. Anybody knows if a power button and/or the reset button on a PC case is NO based?

    • @KompositMormor
      @KompositMormor 4 года назад

      I just tested the button in the chassi am putting my raspberry pi 4 in and it's a NO switch:)

    • @CheckitOutYaw
      @CheckitOutYaw 4 года назад

      @@KompositMormor thnx for the feedback bro! Imma try it my self then.

    • @KompositMormor
      @KompositMormor 4 года назад

      @@CheckitOutYaw Status update: Just tried the script and it works beautiful with the chassis built in start button:)

    • @CheckitOutYaw
      @CheckitOutYaw 4 года назад

      @@KompositMormor I use this with my raspberry pi 4b guided transparent LCD side panel (made my self). Its important that the raspi turns it self off along with the pc in a save way (preventing SD card corruption). Did you manage to turn your pc off and your raspi in the right sequence? Raspi first the ur pc? Now I just made a batch file to execute telling my raspi to shut down and then after my pc.

    • @Howchoo
      @Howchoo  4 года назад +1

      It should be, but it really depends on the case and its circuitry-the most reliable way to test it is to pick up a cheap multimeter and test for continuity (as I did in the video). They're invaluable to have either way.

  • @sethzora6810
    @sethzora6810 3 года назад

    Does this work with a regular non monetary NO switch? The pi is in a setup with a few other things that require a latching switch.

  • @zer0b0t
    @zer0b0t 4 года назад +1

    I did a similar project some time ago, the only problem with this is that if for example the script doesn't load for some reason or you load another image that doesn't have the script loaded and you push the button it may break the Pi, so it's safer to at least add a resistor to the switch or ideally make a pull up-down resistor circuit.

    • @Howchoo
      @Howchoo  4 года назад

      How would it break the Pi? Shorting GPIO3 to GND won’t do that

    • @zer0b0t
      @zer0b0t 4 года назад

      @@Howchoo I think I did it with gpio21. I don't know if gpio3 is different?

    • @zer0b0t
      @zer0b0t 4 года назад

      @@Howchoo But I believe the problem is that the pin stays at high voltage (3 or 5v) and doesn't use the internal push down or up resistor unless you enable it with the software.

    • @jorgealejo1968
      @jorgealejo1968 4 года назад +1

      Yea I just fried my board.... lame

    • @zer0b0t
      @zer0b0t 4 года назад

      @@jorgealejo1968 Ouch that sucks

  • @salvodimarco4617
    @salvodimarco4617 4 года назад

    Hi
    I have an RTC module on my RPI 4 already using pin 5, may use an alternative pin for the power button? Thanks for your advice!

    • @Howchoo
      @Howchoo  4 года назад

      Unfortunately not -- does the RTC have to be on Pin 5 (SCL)? Shorting SCL to GND is required to wake the Pi; so you could use another pin, but you'd only be able to use it to shut down the Pi, not wake it.

    • @melvinvandijk7816
      @melvinvandijk7816 4 года назад

      @@Howchoo i dont want to start the pi with the button. how can i change it that it turns off on another pin

  • @gabstar3029
    @gabstar3029 3 года назад

    Hey I have octoprint on my pi3b+ I was wondering if this will work with my instance of octoprint or it will corrupt my pi

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

    How do you do the software if you have a different operating system installed on the raspberry pi? I have Emteria OS installed on mine

  • @teesdiy3993
    @teesdiy3993 3 года назад

    Can I use pins 5 and 9 if I'm already using 4 and 6 for a fan etc?

  • @Arthurnate
    @Arthurnate 4 года назад +1

    Just wondering, is it fine to use one of the other earth pins? I'm already using 6 for a small fan. Thanks :)

    • @Howchoo
      @Howchoo  4 года назад

      Matthew Morgan Yep, you can use any ground.

    • @Arthurnate
      @Arthurnate 4 года назад +1

      @@Howchoo Thanks for the reply, great vid!

    • @ThesexyMrX
      @ThesexyMrX 4 года назад

      does your fan shut down with this? im curious

  • @miremaker
    @miremaker 11 месяцев назад

    If I have a small case fan ground going into pin 6, can I just move it to another ground on the pi? Does it matter which ground?

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

      You can use any other ground pin as well

  • @nix3649
    @nix3649 2 года назад +1

    Now, I think we can simply use "dtoverlay=gpio-shutdown" command in "/boot/config.txt" instead of this script. This script constantly shutdown my pi4 randomly while the 'dtoverlay' commande does not. Probably because of a debounce param missing, I guess.
    Thanks anyway for sharing

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

    It looks like the I/O connectors are too tall to clear the case. Did you shorten them somehow?

  • @geraldperron9780
    @geraldperron9780 4 года назад

    Howchoo quick question I have this script up and running but notice that if i plug anything usb while running it shuts down (sleep mode) but if I take off the connectors to the pins 5 and 6 and the script still running (basically no button connected there's no issue with it shutting down) I got better powerd adapter for pi and a powered usb Hub just to see if that was the problem and that is not the case still doing it? maybe if there is a way to edit the script to add a few seconds before shutting down? How do I edit a script? I really appreciate and help or advice Thank You :)

    • @Howchoo
      @Howchoo  4 года назад

      That’s super weird-double-check your connections, sounds like you might have a bad ground connection or bad button causing this to happen. :) as far as adding a delay, you can add a Python “sleep” in the core script you installed as part of the setup process.

  • @alexviollet7699
    @alexviollet7699 4 года назад

    In some other video it is explained to use some resistors not to damage the pins (breadboard and 4 pads button setup). Is this due to the button being used that you don't need anything but the button in your setup ?

    • @Howchoo
      @Howchoo  4 года назад

      This isn’t completely necessary-this is mainly to protect the Pi in case you accidentally connect the leads to the wrong pins. :)

    • @alexviollet7699
      @alexviollet7699 4 года назад

      @@Howchoo ok I see. Thanks for the answer