two questions:
Easy 1 first, I see from Macros - WLED Project that a pull up resistor is recommended for a button. But the esp8266 seem to have a pullup resistor built in . am I wrong?
Now the hard one. Button type “PIR sensor” & HC-SR501. besides “trigger MQTT message with /motion topic” how is this button type different then a push button? The HC-SR501 being an active sensor, should the include a pull down resistor?
button has one permanent state, switch has two. PIR behaves as switch. pull up/down depends on GPIO used. PIR does not need one since it is providing voltage to the input.
Blazoncek hi there, you’re saying that if a GPIO other than GPIO0 is used for a button, then a resistor is not needed? Cheers and apologies for bumping an old thread!
The use of a pullup or pulldown resistor depends on:
What kind of device you’re attaching to the GPIO - a physical contact device (push button or switch) will connect the GPIO to ground (or 5V depending on what you need). The pull up/down resistor sets the state of the GPIO when that device is not activated. A “sensor” type device - HC-SR501 or others - outputs a voltage that changes when it senses something. There’s typically no need to use the resistor.
Depending on what GPIO you’re trying to use, you may need to ensure the pin is pulled Hi or Lo when the ESP is powered up. Different GPIOs can change the start mode of the ESP if they’re pulled Hi/Lo.
No, I’m not saying that.
WLED tries to enable internal pull-up (or pull-down on ESP32) if you do not deselect that. So it may work without resistor (including GPIO0). But, if you want to be sure, add a resistor.
Thanks for your answers, I’m aware wled uses the internal resistors. My question since this is a learning process, is why “it may work without but better to add one external pull up/down” since the internal resistors are already there? An on board status LED would definitely need a resistor to my understanding as it pulls considerably more power and might stress the GPIO pins? My goal for the status LED is to have it lit when neopixels are off. Would it work if I connected it between any GPIO pin (or do I need GPIO12) and 3.3v with an appropriate resistor in the middle? I’d appreciate detailed answers so it helps me learn. Thanks again.