-->
Page 1 of 2

ESP GPIO reading input stopped functioning properly

PostPosted: Sun Aug 27, 2017 3:12 pm
by mmrvelj
I have a project where I use "sensor" which is effectively a switch on a long wire (around 3 meter of wire). I am using ESP 07 module and GPIO12 in configuration INPUT_PULLUP, and switch is connecting the input (GPIO12) to the ground (through additional 100 ohm resistor).

Sketch:
ESP07-sensor.png


My project worked normally for a few (2-3) months, and then suddenly the reading stopped (basically reading seems to always show that the GPIO12 is connected to the ground). What could cause this behavior? What can I do to prevent this from happening?

Re: ESP GPIO reading input stopped functioning properly

PostPosted: Sun Aug 27, 2017 6:32 pm
by QuickFix
mmrvelj wrote:I use "sensor" which is effectively a switch on a long wire (around 3 meter of wire).

I'm afraid the combination of the words "effectively" and "a long wire" don't work together on a subject like this.

A "Sensor" connected to a "Long wire" (longer than ~10cm) on a microcontroller working with 3.3V logic is very likely to fail in the first place (capacitance and restance of the wire itself, electromagnetic pulses "Invading" the wire from the outside, like an antenna).

You probably don't actually have a setup like that, so it might be better to describe your setup in more details, since that may also be the place where your problem is. :idea:

Re: ESP GPIO reading input stopped functioning properly

PostPosted: Mon Aug 28, 2017 8:42 am
by eduperez
Have you tried to just disconnect the wire, and see if the input goes up?

Re: ESP GPIO reading input stopped functioning properly

PostPosted: Mon Aug 28, 2017 8:43 am
by martinayotte
Having a strong external PullUp could help ...