Hello,
I have a microcontroller (ESP8266 or Atmega328p) which has one GPIO pin configured as "INPUT" with external 4k7 pullup resistor.
If I check the voltage of this pin using an oscilloscope I can see that it's near VCC (5v) with very low ripple/noise.
A wire with open end is connected to this GPIO pin. Once I touch the open end of this wire, the GPIO pin "goes crazy".
The oscilloscope shows very high noise (peak to peak approx. 4v) and this behavior continues as long as I'm touching the wire.
Wire with open end? Yes, normally there is a sensor connected, but the user might unplug the sensor...
I assume the (common mode) noise has something todo with the (cheap) power supply I'm using. Nevertheless, it's not a solution to replace this psu, because it's mounted in the ceiling. My circuit has to deal with it.
Here is a quick video demonstration of the behavior:
https://youtu.be/QMgDTJJYQGgI tried to solve this interference by putting an 100n capacitor across the GPIO pin and GND. The oscilloscope showed, that there is no more interference.
As an alterantive, I found out, that a very strong pullup of 220R also solves the issue, but of course the quiescent current is way too much...
I would like to know, if the approach (fixing it with a cap between gpio+gnd) is correct? Or how would you get rid of these interferences?
Any comments are greatly appreciated!
Thanks