0
\$\begingroup\$

I have a microcontroller (ESP8266) which has one GPIO pin configured as "INPUT" with enabled internal pullup resistor. If I check the voltage of this pin using an oscilloscope I can see that it's near VCC (3.3v) 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. 2v) 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.

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.

I would like to know, is the approach (fixing it with a cap) correct? And why does touching the open end of the wire cause a pulled-up GPIO pin to go crazy? Is this an EMI issue or whats the explaination for this?

Btw: The microcontroller is powered by a switching power supply. Schematics of the power supply are available in this document on page 2: Schematics

Any comments are greatly appreciated! Thanks

\$\endgroup\$
  • \$\begingroup\$ Capacitive coupling of power noise ??? And 10 cm wire acting as antenna? \$\endgroup\$ – user3219492 Feb 27 '17 at 6:32
  • \$\begingroup\$ What exactly is the reason for having an "open end" like that? What's the purpose of this "input" pin? (Internal pull-ups are weak.) What is supposed to drive it? Anything? Or do you intend it as an antenna or a discharge post? \$\endgroup\$ – jonk Feb 27 '17 at 7:23
  • \$\begingroup\$ Normally this wire is connected to a sensor (HC-SR501 PIR) so the problem should not occur, but I would like to make sure my MCU does not false trigger the interrupts, if the user unplugs the sensor or the wire gets damaged. In other words: In case of an open end, the pin should somehow keep a value (I thought using the pullup) \$\endgroup\$ – John Feb 27 '17 at 7:28
1
\$\begingroup\$

If the input is unstable, then the internal pullup is either not enabled or too weak. You could measure the current flowing from this pin to ground to check that the pullup is actually enabled.

I would stabilize this pin with a stronger external pullup (eg. 4k7).

\$\endgroup\$
0
\$\begingroup\$

The behavior you're describing is consistent with the pullup not actually being enabled, or being extremely weak.

Make sure that the pullup is enabled. If you're sure it's on, it's possible that the pullup circuit within the microcontroller has been damaged. Try using another pin, or replacing the microcontroller.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.