Wiring a button

Hey All,

I made a simple box with 4 buttons. These buttons have two solder pins. I connected one pin to ground and the other to a digital input and it worked perfect. The button functions as ON/OFF

Now, I have purchased some buttons with 5 pins (the button contains an internal LED)

Which pin would i solder to send signal to the digital input for On/Off

I understand one pin is + and one is - (i solder these pins to the power and the LED lights up.

I am now left with 3 pins and i dont know which one to connect to send a simple on/off signal to arduino.

Thank you

Without a link to your switch we cannot help you.

You might damage something if you connect the light directly to power.

Do you have a DVM.
.

Measure resistances between the pins with digital multimeter, when button is and is not pressed. Likely there's a common, an NO (normally open, ie, off, connected to the common when pressed), and an NC (normally closed, ie, connected to the common when not pressed, disconnected when pressed).

Or it could be two leds sharing a common pin (these are quite common, normally two LEDsof different colors in one package with 3 pins - red/green ones have been around for decades ) with a simple 2-pin button.

Hey,

I have made a mock diagram of how i picture the system would work. Ideally, i want all four buttons to be constantly lit up (no matter if they are pushed in or not). All four buttons would send a simple on or off message. It seems that the buttons only have 4 pins and not 5. Sorry about my mistake. In my diagram the buttons have 5 pins but one is unused

Please see diagram i drew to figure out if it would work?

Screen Shot 2016-09-14 at 1.35.57 AM.png

Your picture doesn't make sense to me.
Are you focusing on how to power the LEDs or is that something like your idea of how to wire them for function?

No idea what the specs are for the internal LEDs, maybe they already have resistors in there for each LED.
If they're going to be on all the time, then you can just wire them all up, power and ground to each. Not sure if you have enough voltage to run 4 in series.

For function, put a ground line to them all. Then each button gets its own wire to a different board IO pin. You should pinMode these to INPUT_PULLUP. Your original setup I think in a crosspost had your inputs floating.

Im having such a terrible time trying to explain what im trying to do and its frustrating for you guys and for me also.

ok here it is in very very simple terms. I have four buttons with internal LED's I want all the buttons lights to always be on (When the teensy is connected to the computer via USB). I want all four buttons to send a signal into 4 digital inputs on the teensy.

I have already set up 4 buttons to send signal into the digital inputs and it works fine. That parts is completely functioning.

I simply want to know the best possible way to connect the four buttons internal LED's when the teensy is connected vi USB. i do not want to use any other external power apart from USB. I dont care if the LED's are slightly dimmer due to the fact that i only have the USB to power them

I have no idea how to wire these four buttons to have all the lights on all the time. The teensy has one VCC power pin. How do i connect all four buttons to that pin so that when i plug in the USB, all four buttons light up?

I feel like this should be so so simple, but maybe its not?

I want to plug the usb into the teensy and have four buttons light up and stay on, thats all i'm trying to do

The 4 LEDs will each need power and ground. Either series or parallel, no one can help you since no one knows what voltage the LEDs drop and what you're working with.

Just try them in series first and see if they even light. Vcc to anode, cathode of that one to anode of the next, etc, last cathode to GND.

Repeating yourself over and over again about what you want to do is not helping. It doesn't magically tell us the specifications of what you're working with. It really is a simple task. But that task is you actually giving us useful information.

I understand, and thank you. I guess i dont really know the specs of the LEDs within the buttons because they did not come with any paper work at all. Just four buttons in a box.

Ill work on it and see what i can come up with.

Thanks

I assume you want to press the button that will turn on the LED and generate in input to the Arduino.

Each switch has a changeover contact set and a LED with the anode connected to the comm of the switch (there are only four pins so you have shown a five pin switch with internal connection).

You could connect the N/O contact to 5v, common to the input and the LED cathode to gnd via 270 ohm R.

When you press the button, 5v is connected to the LED and input.

You program would look for a HIGH on the input.

Weedpharma

@LarryD (in reply#1) asked for a link to the switches (with the LEDs) that you bought. Please provide that information.