1
\$\begingroup\$

Hi everyone and apologies if this is a really dumb question.

I'm following this to control the GPIO on a raspberry PI: Circuit Diagram

I bought a starter kit which has 2 mini push buttons, but I've no idea if they can be used?

breadboard

If not there's nowhere round here I can buy a switch so it'll be a day or two, is there any way to DIY a suitable switch?

Any help would be great and sorry about the question. You're probably sick of raspberry pi questions but I have no one to ask.

\$\endgroup\$
4
  • \$\begingroup\$ That looks like a suitable momentary switch, assuming that it's normally-open. \$\endgroup\$
    – pjc50
    Nov 20, 2012 at 16:03
  • \$\begingroup\$ Don't forget the key-bounce! \$\endgroup\$
    – Tony Ennis
    Nov 20, 2012 at 16:04
  • \$\begingroup\$ @pjc50 this is where I sound really stupid - the switch they use has 2 connectors, where the one I have has 4. I don't know what to do with it... \$\endgroup\$
    – noeleo
    Nov 20, 2012 at 16:08
  • 1
    \$\begingroup\$ "You're probably sick of raspberry pi questions but I have no one to ask." -- I bet raspberrypi.stackexchange.com isn't sick of them. \$\endgroup\$
    – Jim Paris
    Nov 20, 2012 at 17:59

2 Answers 2

3
\$\begingroup\$

It should work. They have 4 pins for structural strength, since they are meant to be soldered on a pcb. It has two pairs of pins, where each pin in a pair is electrically connected to the other, as illustrated in the following diagram (taken from google images):

enter image description here

As you can see, pins 1 & 2 are connected, and so are 3 & 4.

If it is normally closed instead of normally open, you can still make it work as expected by tweaking the software (may be as simple as inverting the logic).

\$\endgroup\$
1
  • \$\begingroup\$ ahh, thankyou I'll look into that \$\endgroup\$
    – noeleo
    Nov 20, 2012 at 18:52
0
\$\begingroup\$

You can get a button like that from Radio Shack for a buck or two. There's nothing magic about it. The mini buttons look momentary. Wire one up to an LED and see.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.