good_life
Posts: 5
Joined: Mon Jan 05, 2015 6:54 pm

Why are power switches so complicated

Fri Jan 16, 2015 11:36 pm

Read a lot on power switches, and seen the addons cards for setting up power switches.

Why are they so complicated?.

Can't I just have a gpio switch that triggers "sudo shutdown" (with -h or -P) for shutdown and turn it back on with switch connected RUN?

plugwash
Forum Moderator
Forum Moderator
Posts: 3630
Joined: Wed Dec 28, 2011 11:45 pm

Re: Why are power switches so complicated

Fri Jan 16, 2015 11:46 pm

Depends on the application.

Your proposal will mean

1: when the Pi is shut down it won't actually be turned off. While the Pi draws less power in this state than when fully operational the power it draws is still non-negligable in battery powered applications.
2: the USB devices will remain powered (at least on a model A, B or A+, not sure about the B+), this may be an issue in some applications due to power consumption, annoying lights, devices that don't cleanly come back if the host resets without power-cycling the USB device etc.
3: the "ON" button will also be a reset button. This may be confusing to users.

W. H. Heydt
Posts: 12784
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Why are power switches so complicated

Sat Jan 17, 2015 12:31 am

Part of the complication is because SD cards are in use. SD cards do wear leveling activity all on their own and a sudden power drop can corrupt the data on the card. So...it's a really bad idea to just cut the power. The "power switches", when properly designed, have a delay to let the SD card finish anything it might be doing. In addition, since the Pi has no real time clock, it write the current time to the SD card when told to shut down...which is more SD card activity.

All of that is why, when you issue a shut down command, good practice is to wait a bit--say 5 to 10 seconds--*after* the system has completely halted before removing the power from the board.

good_life
Posts: 5
Joined: Mon Jan 05, 2015 6:54 pm

Re: Why are power switches so complicated

Sat Jan 17, 2015 3:20 am

Good to know. Thanks!

Return to “Beginners”