Hi all,
I’ve messed around with esphome a bit, but am brand new to breadboards and wiring things up. I’m trying to set up what I think is a simple circuit to detect if a button is held or not.
I’m using an esp32, not an adruino but the simulator didn’t have one of those. But I hooked 5volt to positive on the breadboard, ground to negative and GPIO5 to the input side of the button.
I got the basic setup working using this code.
binary_sensor:
# Test GPIO Binary Sensor
- platform: gpio
pin:
number: GPIO5
mode:
input: true
pullup: true
inverted: true
name: "$name_of_board Test GPIO Pin"
and this wiring
If I press the button, I can see the sensor change state.
However, if I try to put an LED inline for some sort of visualization for the button, the sensor stops updating.
and the led comes on very dim.
Why is the sensor not reading the state change now, and why is the light dim?
Lastly, I wired the circuit using a jumper from the 5volt right to the input side of the button and unplugged the GPIO5 cable and the led came on super bright (probably should have put a resistor in ).
I also wired up the switch again like the second image, except the wire going from the switch output to the led was replaced with a resistor. I then tried putting the GPIO pin parallel with the input side of the switch (H6), and my binary_sensor doesn’t update when I push the button. I put it on the outside (H8), and the led turns on dim, and when I push the button the led lights up normally, but the binary_sensor doesn’t turn on.
Ideally what I’m looking to get out of this is to have a binary sensor that can read if the led is on or off, and then also have a switch in esphome that can turn the led on and off. Right now I’m just stuck at the first part. Can someone please assist?