ranger81
Newbie level 3
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 10cm 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.
This also causes an interrupt (which is enabled on this GPIO) to trigger continously, which is my problem I need to solve.
I need to "harden" my circuit, that even touching the open end of the wire does not bring any (or very low) interference into the circuit.
But why do I have a wire with an open end? Well, under normal circumstances I do not have this situation.
A sensor is connected to this wire, but maybe the user unplugs the sensor from the cable and touches the wire.
This is why my circuit has to deal with this situation.
Here is a quick video demonstration of the behavior: https://youtu.be/QMgDTJJYQGg
I tried to solve this 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...
The microcontroller is powered by a switching power supply. With a different power supply the issue does not occur! Only with the (cheap) power supply which is installed in my ceiling.
The problem: I'm forced to use the cheap power supply... The schematics of this cheap power supply is here: https://abload.de/img/psuxzlte.png
I would like to know, is the approach (fixing it with a cap between gpio+gnd) correct, it even works without the pullup resistor? And why does touching the open end of the wire cause a pulled-up GPIO pin to go crazy? Is this an EMI issue related to the power supply or whats the explaination for this?
Any comments are greatly appreciated!
Thanks
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 10cm 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.
This also causes an interrupt (which is enabled on this GPIO) to trigger continously, which is my problem I need to solve.
I need to "harden" my circuit, that even touching the open end of the wire does not bring any (or very low) interference into the circuit.
But why do I have a wire with an open end? Well, under normal circumstances I do not have this situation.
A sensor is connected to this wire, but maybe the user unplugs the sensor from the cable and touches the wire.
This is why my circuit has to deal with this situation.
Here is a quick video demonstration of the behavior: https://youtu.be/QMgDTJJYQGg
I tried to solve this 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...
The microcontroller is powered by a switching power supply. With a different power supply the issue does not occur! Only with the (cheap) power supply which is installed in my ceiling.
The problem: I'm forced to use the cheap power supply... The schematics of this cheap power supply is here: https://abload.de/img/psuxzlte.png
I would like to know, is the approach (fixing it with a cap between gpio+gnd) correct, it even works without the pullup resistor? And why does touching the open end of the wire cause a pulled-up GPIO pin to go crazy? Is this an EMI issue related to the power supply or whats the explaination for this?
Any comments are greatly appreciated!
Thanks