Metal Push Button C NC NO control button and LED separately

I'm working on a project with the above metal push button combined with Arduino, and am trying to control the LED and the button separately. I have not worked with NO/NC/C buttons before, hence why I am struggling to understand how to hook this up in a way that I can read the button and control the LED with separate pins.

The function I'm aiming to get at here is that the LED can light up based on other conditions than the button being pressed. How would I go about this?

The button you linked to has 5 terminals

3 for the switch
common
normally open (NO) - not connected to common unless the button is pressed
normally closed (NC) - connected to common unless the button is pressed

So, if you connect common to GND and NO to an Arduino pin the pin state will be LOW when the button is pressed. Using INPUT_PULLUP in pinMode() to activate the Arduino built in pullup resistor to keep the pin at a known state at all times would be a good idea

The other 2 terminals are for the LED which can be fed with 3V of either polarity to light it and the LED already has a current limiting resistor built into the pushbutton

The advertisement says that if you want to run the LED on 5V you should add an 82Ω resistor in series.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.