Help! n00b with 4-pin, integral LED arcade button: wiring...

Argh, sorry folks! Really simple, I’m sure....

I have one of these buttons (LED illuminated): https://www.adafruit.com/products/492

I can get the LED to light (not sure if I need a resistor in there, though), but I can’t get the Arduino to register a button press (I’m honestly not sure which wire to put where). :(

THANKS IN ADVANCE!

If there is no built-in resistor (that page doesn’t mention one) then yes you need one, the value of which depends on the voltage drop. If you are using 5v a 50 -150R resistor will do, in series with the LED.

The switch has a COM (common) connection, a NO (normally open) and a NC (normally closed) pin (all marked on the body). One of the pins should be (NO or NC) should be connected to an Arduino pin, the other to 5v or ground depending on your logic.

Frankly, if this is stopping you then you need to understand a bit more about the Arduino - get one, upload the blink program and move on from there. Read up on ‘pinMode’ and ‘digitalRead’ which you will need too. All documented on the Arduino.cc web site reference.

Hi,

see attached picture.

Button connectors should be clear now.
LED:

  • start with 1k resistor (current will be ca. (5V-1,6V)/1k = 3mA - this should already light the button LED
  • you can then lower it down to ca. 220 Ohm (5V-1,6V)/220 = ca. 14mA

The calculation is not exact as I don’t know the exact value of the LED forward voltage.
Based on long year experience you should not fry your LED with those values.

The only hurdle is to find out anode/cathode side of the LED - if you have a 5V power supply, connect two wires to the +/-, one wire should have the 1k resistor soldered at its end and then just test what is what.
If you connect the wrong way - it won’t hurt; just change the pins and the LED will be lit.

After that, mark the “+”-side of the LED and test the brightness by lowering the resistor value )as I said, don’t go far below 220 Ohm - the lifetime of the LED will thank you.

LED Illuminated Pushbutton - 30mm Round ID_ 492 - $3.95 _ Adafruit Industries, Unique & fun DIY electronics and kits.jpg

rpt007: Hi,

see attached picture.

Button connectors should be clear now.

Perfect, thanks so much!