Button with Integrated LED - Dim Light When Off

I'm building an ESP32 project that uses an I2C LCD and a push button with a built-in LED. A key requirement is that the LED and the button must be connected to the same pin. The intended behavior is:

  • Button Not Pressed: LED completely off.
  • Button Pressed: LCD displays "hello," LED turns on brightly for 30 seconds.

Currently, the LED has a faint glow when the button is not pressed. When I press the button, the LED's brightness increases as expected, and the LCD displays "hello."

My current wiring setup:

  • LED Positive (+) connected to a 10k resistor, then to ESP32 pin 33.
  • LED Negative (-) connected to GND.
  • One leg of the button connected to GND.
  • The other leg of the button connected to ESP32 pin 33.

I tried adding a resistor between GND and pin 33, as suggested by ChatGPT, but this did not fix the dim light issue. Could anyone offer advice on how to eliminate the dim light when the button is not pressed?

  • Why have you not asked ChatGPT to fix this ? :thinking:
  • Why can you not use two different pins ?



  • Show us your wiring schematic.

Ask for a connection and wiring diagram too.

1 Like

i ask because maybe was a faster answer at that moment
i need to connect like 12 buttons with lights and another stuff and just starting from that
and hear is the schematic on wokwi: pruewba boton led - Wokwi ESP32, STM32, Arduino Simulator

  • There are port expanders that can be used.
    Input 74HC165
    Output 74HC595



  • However, this works on an UNO, should work on ESP too.

  • See this post:

Example circuit for UNO

thanks that is what i am looking for amazing

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