I feel like I’m losing my mine and hope one of you lovely people may be able to help. I have an ESP8266 running ESPHome that I’m powering by 5v. I have a simple momentary push putting that I’ve connected to D5 and ground. When I push the button it fries the board and is no longer usable. I thought it was a dodgy board so swapped it out and also measured the voltage on D5 which was showing at 3v which I believe should be in range.
Can anyone help me understand what is happening here? I’ve used the same board with sensors, relays and LED strips without issue.
The button is a simple doorbell with two connectors and the wires come straight from the door to the ESP8266. I tried adding a 1k resistor to the GPIO which stopped it frying when the button was pressed but the button presses weren’t detected.
Not really…Vi pin is intended for such voltages. Base board has switching voltage regulator below esp board, input voltage can be up to 24V, while regulator then outputs 3.3V
It looks all ok. I would check with continuity meter/ohmmeter if D5 on outside board is indeed connected to D5 on esp module… just in case.
What steps did you use to determine that the board is “fried”?
Remove the NodeMCU from the motherboard and simply plug in a micro-USB cable to your PC. Run the “blink” example sketch from the Arduino IDE. If this works then the ESP is probably OK. You would need to change the GPIO numbers because the example sketches use pin numbers for the Arduino Uno. The “button” sketch can also be used to verify that the GPIO pin is working.
It should be 3.3V, so this is what you should see.
edit: Your code is fine. I just flashed a NodeMCU board here and the button works as expected.
That would short the 3.3V pin to ground, likely smoking the regulator on the board. That would also put Vin on D0 (GPIO14) likely destroying the I/O register and the eight GPIO pins connected to it.
It’s definitely the right way around. it’s easy to determine the correct orientation as the PIN numbers are listed on the side of the ESP8266 so you at least know they are facing the right way.
I added a delay off of 350ms and also added a 10k resistor to the GPIO. I’m not getting any more issues for now but will keep an eye on it to see if anything odd happens (I tried a 1k resistor again and it was fine in the day but as it’s heading towards night it is bouncing from on to off and the 10k seems to have stopped this).
If match the pin labels to the pins in your pic you are connecting ground to ground , not D5. Perhaps you just drew the green line in the wrong pin and your actual lead goes to next pin that sits slightly closer to label D6. It’s not unusual for some boards to be labelled wrong anyway. Perhaps the black line that appears to go to gnd could also be labelled wrong. Can you check them with multimeter?
Yeah good point. It is definitely going to D5 and I’m now detecting the button presses without frying the board so the resistor on the GPIO seems to be the answer however I spoke to soon about the 10k resistor resolving the floating pin issue. I changed the 10k for a 100k and then 150k and it still seems to jump from on to off albeit not as rapidly.
Do I just keep increasing the resistor until it it stops floating?
You might be picking up noise on the wires if they are long. And going to higher resistance will lower the current, and make it more susceptible to noise. 1k should have worked better.
You could try twisting the wires together, that should help. Or use shielded cable. Or put the ESP closer to the switch.