Wiring assistance required for 4 pin LED button

I am trying to use a button with a built in LED in my doorbell project. I can get the button to work using the NO ON pins connected to Pin2 and GND, however I want to use the LED function which lights up when the button is pressed. The instructions from the manufacturer below.

I've tried using 5V on the NO pin and joining + with ON and 10K resistor going to Pin 2 on ESP32. Since this is a PullUp configuration, I changed the code to pinMode(BUTTON_PIN, INPUT). No luck

Any suggestions welcome.

Use a DMM and measure the ohmic throughput when the button is pressed.

1 Like

IO goes HIGH when pressed

b

1 Like

Post a button link.

https://www.aliexpress.com/item/1005001683893211.html?spm=a2g0o.order_list.order_list_main.78.672918024nRB1A

I got the 3v - 6v push button. Unfortunately they don have much more technical specs.

Ideally the button power should come from the same 5V powering the board.

I think this component internally looks like this:

image

If you really mean the LED is on only when the button is pressed, did someone suggest this?


If you have another pin available and need a different behaviour, you could just use the LED/resistor part as an LED on an output pin, and read the switch on an input pin either with a pullup resistor or using INPUT_PULLUP mode.

Usually I would prefer to run the LED separately to retain flexibility and put the process in the loop so the LED is not just telling you about the button but can mean there is some "thought" behind it.

HTH

a7

1 Like

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