I have an Arduino project where a pin is kept high until a momentary button press connects the signal directly to ground, so the code is expecting the button to be high
until the press takes it low
.
Everything works after I solder it together for at least a couple of hours, but I noticed the next day (both times I've tried this) the device acts as if it's being pressed constantly.
I measured the resistance of the momentary button and it is around 4.7 kΩ between the button studs (while still soldered to the PCB (I have not desoldered it yet, but anticipate doing so for testing it when I can clear a space to run a heat gun) when the button is not pressed.
I'm fairly certain I tested that button to have no connection between the studs and tested between the through holes on the PCB with the same result.
I tested another button from the same batch just now and confirmed that I got no connection without pressing the button.
This is the second time this has happened, so I'm beginning to suspect that these buttons just eventually start leaking current. I don't believe I am pushing too much current through it either. It's just the 5 V line from the Arduino routed through a 4.7 kΩ resistor prior to reaching the button (which, by the way, if I measure resistance from the 5 V to the supposedly unconnected stud on the button, I get around 10 kΩ resistance), then the press routes the signal to ground. Any thoughts?