2014
05.23

Last Saturday I made a shut down button for my XBMC Pi which has worked great and made my SD cards live in a happier place

I decided to look into a PowerOn button because it is still sorta silly to unplug/plug in the Pi to turn it back on. Well as it turns out if you have a button on Pin 5 (GPIO 3) it will reset the Pi from halt state when pressed.

I verified this first with my arcade box as it already had a shut down implemented and an On button would be great plus I probably already had a button on that pin as I only had 2 free GPIO pins to begin with. Sure enough my yellow right hand button was on this pin.

I shut down the arcade box using the coin+1p nerve pinch and once the Pi was in a halted state I pressed the yellow button.

Success!

I immediately applied this change to my XBMC pi just by move my button connection from 7/GND to 3/GND and updated the retrogame program to reflect the change.

So now both my Pi’s have graceful shutdown buttons and power on buttons. Life is good.

Facebook Comments

2 comments so far

Add Your Comment
  1. When you push the button to power it off, the pi still has some power right? You wouldn’t want to pull the SD card or plug things into the GPIO at this point – wouldn’t you want to unplug the pi?

    And if you did unplug it, when you plug it back in, will it immediately boot.

    I just want to be clear on all this (and be safe)

    • the off button as I use it sends a shut down command to the OS you would want to wait for the green activity light to stop blinking before pulling any sd cards or external devices. Usually takes 5-10 seconds.

      if you then unplugged and re plugged the cable it would turn the Pi back on. In two later posts I explain that if you set this button up on GPIO 3 the button can double as a power on button too. When a Pi is in standby/off mode any activity on that pin will make the Pi boot.

You must be logged in to post a comment.