On off button for Raspberry Pi

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Tooluser
 
Posts: 5
Joined: Sun Nov 01, 2015 7:38 pm

On off button for Raspberry Pi

Post by Tooluser »

I'm using the Pi2B+ with openelec and Kodi for a media center,and was wondering if anyone can suggest the best way to power off the system. So unplugging the system after openelec power down using ssh or the button is the usual way,but I want another approach. There is a board available which will allow for an integral power off switch,and I have heard of connecting a switch between pin 5 and 6...so what is the adafruit approach to this issue? Thanks in advance.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: On off button for Raspberry Pi

Post by adafruit_support_mike »

We have a version of the OS with a custom device that watches for a signal on GPIO 20 and issues a `shutdown -h now`.

Stepping back from what happens inside the RasPi, let's clarify what happens outside it. What kind of signal do you want to send the RasPi that will tell it to shut down?

User avatar
Tooluser
 
Posts: 5
Joined: Sun Nov 01, 2015 7:38 pm

Re: On off button for Raspberry Pi

Post by Tooluser »

First off we are shutting off the OS with a shutdown -h now or using the software "button" to power down,then unplugging the Pi. This has the potential of corrupting the sd card. So asking me what signal I want to send the Pi from outside the system would suggest there is some other choice.....That is the reason for my post!! I am asking for another method of turning off the Pi after software shutdown. Is there not some way to integrate a switch into the box?

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: On off button for Raspberry Pi

Post by adafruit_support_mike »

Disconnecting power after the OS has shut down won't corrupt the SD card.

The OS flushes the filesystem as part of the shutdown process. After you get the "Power down" message on the console, it's safe to unplug the power or disconnect power with a switch.

User avatar
Tooluser
 
Posts: 5
Joined: Sun Nov 01, 2015 7:38 pm

Re: On off button for Raspberry Pi

Post by Tooluser »

Thanks Mike for the reply. And while I agree that unplugging a Pi after program shutdown should not corrupt the SD card,the first time reboot after using my new system,found a no boot condition and I had to reinstall with new card.
Regardless of what caused that ,many others from other related Forums have also wondered how to add a simple on/off switch to the Pi itself. And there is a UK manufacturer offering an addon board for about $25.00 US. which will accomplish this.
I'm thinking there must be an easier solution than this...Adafruit the leader in the Maker movement must have someone who has encountered this question and developed an answer. Am I incorrect?
If the best offering is "unplugging shouldn't cause any problems" then maybe I should just buy the card.
By the way this media center was my first Adafruit project and all went flawlessly right out of the box with that one exception of the card issue.(may have been a bad sd card) Very happy overall and keep up the good work!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: On off button for Raspberry Pi

Post by adafruit_support_mike »

Power switches are a surprisingly diverse collection of circuits when you dig in and start trying to design one.

Some people want a simple power cutoff, others want a soft switch that tells the OS to shut down then disconnects power. Others want battery backup power, with the number of "prefer this source over that one" proportional to the square of the number of sources. There's also a range of options on what constitutes "shut off" and how to detect each of those states.

WRT our position in the Maker movement, we think it has that name for a reason. It isn't called the "I want someone else to make this for me" movement.

That happens to be a rant topic for me, so I'll stick to the executive summary: In the Maker movement, the correct response to the question, "why isn't anyone making this?" is "why aren't you making it yourself?" One of the core princples of the Maker movement is, "don't expect anyone to invest more of their time, money, or effort in your project than you do."

Both of those have implications that are critically important to the nature of Making and the definitions of Open hardware and software.

User avatar
Tooluser
 
Posts: 5
Joined: Sun Nov 01, 2015 7:38 pm

Re: On off button for Raspberry Pi

Post by Tooluser »

I'm a machinist not an electrical engineer,I asked only for guidance,I did not ask you to come over and solder the switch in place for me.Mike all you have done is criticize without any "Support" whatsoever. I really don't understand what I did to deserve this.
I will be forwarding this thread over to Lady Ada,maybe she can sort out why her admins are so full of attitude and lack any sense of service to her clients.
By the way I know that in some Pi versions connecting pin 5 to ground with a switch or jumper is one answer,and I guess a resistor needs to in there too,so I thought by coming here I could get a confirmation on that or get some other ideas to help me out.
Your rant was totally out of line! I have really enjoyed doing this project,with the exception of this thread. Its too bad I had to encounter a disgruntled employee.
I subscribe to all the videos and watch all the shows and I think Limor and Adafruit is just fantastic.

User avatar
Tooluser
 
Posts: 5
Joined: Sun Nov 01, 2015 7:38 pm

Re: On off button for Raspberry Pi

Post by Tooluser »

There actually are many options available to add an on/switch to your PI project,and in case others are looking for a solution,here is what I came up with: A component kit which has a soft boot option that gives the halt command,turning off the OS then waits for 2 minutes until shutting down the system,assuring no sd card corruption will occur. Find that here... https://www.pi-supply.com/product/pi-su ... 16fd43adaa and the US distributor here ... http://www.robotshop.com/en/on-off-powe ... ry-pi.html
For those that want to start from scratch ,with schematics ... http://www.raspberry-pi-geek.com/Archiv ... ffset%29/2 or here.. http://www.mosaic-industries.com/embedd ... controller
Ready made controllers here.... http://mausberry-circuits.myshopify.com/
Some just use a remote controlled wall socket switch,however that only solves half the problem.
So its time to get soldering! Thanks for all the help everyone!

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”