Advanced search FAQ Register Login

It is currently Mon Jan 22, 2018 1:37 am


Postby f3rn4nd0d » Wed Apr 13, 2016 3:40 pm ... rch=switch


I'm planning to add a button as the one mentioned in the link to shutdown gracefully the Raspberry Pi, and I'd like to use the led part of it to show if it is operative or not. Maybe two switches would be even better, one to turn it on/off completely the Raspberry Pi and the other to start the "Shutdown -h now" process and then press the other button. Has anybody used these kind of switches for this particular reason? Any tutorials or ways of wiring them to the GPIO would be great. Thanks!

BR / Fernando


Posts: 1

Joined: Wed Apr 13, 2016 3:33 pm

Postby BMS Doug » Thu Apr 14, 2016 8:42 am

I haven't used those particular switches but all switches function in the same way.

To connect a switch or a button to the raspberry Pi you should use two resistors, one current limiting resistor (to stop the GPIO pin burning out if it accidentally gets set as an output instead of an input) and one Pull up or pull down resistor (so that when the switch isn't activated the voltage doesn't "Float", causing false activation signals.

I frequently use this tutorial as an example of how to connect buttons or switches.

I hope this helps.

BMS Doug

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London


Volunteer Moderator.

Postby Jake » Thu Apr 14, 2016 10:47 am


There is also this switch available, which works via the micro USB & GPIO: ... pberry-pi/

Similar tutorial here:

-- Jake


User avatar

Posts: 1396

Joined: Thu Aug 27, 2015 3:57 pm

Forum Administrator & Technical Support

Who is online

Users browsing this forum: No registered users and 1 guest

Board index

The teamDelete all board cookies • All times are UTC [ DST ]