Advanced search FAQ Register Login

It is currently Wed Jan 24, 2018 2:22 am

 

Postby f3rn4nd0d » Wed Apr 13, 2016 3:40 pm

https://www.modmypi.com/electronics/but ... rch=switch

Hi,

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

f3rn4nd0d
n00b

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
31337

Posts: 273

Joined: Tue Sep 08, 2015 3:55 pm

Location: London

Doug.

Volunteer Moderator.

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

Hi,

There is also this switch available, which works via the micro USB & GPIO:

http://www.modmypi.com/raspberry-pi/bre ... pberry-pi/

Similar tutorial here:

http://www.modmypi.com/blog/tutorial-tactile-switch

-- Jake

Jake
ModMyPi

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 ]