I found that when my Pro Micro powered by some devices' USB port (for example, Nintendo switch Dock), the ripple on GPIO can be very big (nearly 0.8V Vpp)
But noise between GND and Vcc is very small (nearly 0.12V Vpp)
Why and How to solve it?
Thanks!
And when I touch the GND, the ripple on GPIO can be reduced from 0.8V→0.4V...
Capacitors are used to reduce ripple. That is why your body (a capacitor)
Thank a lot! But where should I add capacitor? If GND and Vcc has ripple, maybe I can add capacitor between GND and Vcc. But in my case ripple was in GPIO to GND.
How are you measuring the ripple? Using for example a scope how is your scope grounded? What frequency is the ripple? If you are seeing 50 or 60 Hz ripple component I would be looking at your power source as being faulty. How many different power sources cause this?
Yes, normally a filter cap would be Vcc to Ground but since this now appears to be on a GPIO again I ask how are you measuring? A schematic would help of exactly what you have.
Ron
How are you measuring the ripple?
-- I measured by a oscilloscope. Alligator Clip connected to Pro micro's GND, and Probe connected to a GPIO Pin. The Pro Micro was powered by USB during the test.
How is your scope grounded?
-- Alligator Clip connected to Pro micro's GND.
What frequency is the ripple?
-- Sorry, I didn't record it, I'll get back to you after the next test.
How many different power sources cause this?
-- One at a time. For PC USB Port, Vpp≈20mV. For NS Dock, Vpp≈800mV. For NS console,Vpp≈40mV.
This is strange because any ripple component on DC has to be coming from the power source unless somewhere a faulty ground exist and you are somehow picking up mains frequency on a digital out pin but not seeing it on the power in between Vcc and Gnd.
Ron
Yes, I think it's weird, too.
And I tried to buy a USB isolator to see if I could fix the problem when I received it.
Ripple or noise ?
One more information. If scope' alligator clip is connected to GND and Probe isn't connetted to anything, Ripple also can be detected.
I think it's ripple, because it's cyclical.
Utterly normal, and safe to disregard. You're using a very sensitive antenna, effectively. An older generation(mine) would refer to this by the four-letter-callsign of the local rock-and-roll station. A slower, usually uglier waveform would be referred to by the four-letter-callsign of the local country and western station - or more simply, any suitable four letter word.
YMMV (your music may vary)!
The ripple is 50 Hz
But when Pro micro's USB was connected to PC the ripple was less and nearly cannot be detect (measured by the way mentioned above).
How is gpio connected?
Why is the ripple unwanted?
What do you really want to measure?
On a gpio set to input, a lot of ripple will always be present.
Add a cap from gpio to gnd. 100nF should do.
And prevent the pin from floating (add 100kohm to gnd or 100 kohm to vcc or both....).
Connected like picture above.
I'm trying to make a electronic drum by piezo.
Ripple make the drum triggered itself automaticly.
The piezo is 26nF. And I had added 1MΩ resistor.
What is known is that the powered USB port has a significant impact on ripple.
I learned a noun "Common mode noise ".
It looks to me like a ripple was introduced between the USB ground and the Earth ground.
How long are your cables?
Are they shielded?
Did you try 100 kohm instead of 1Mohm?
This may be part of your problem. But should not cause 0.8V ripple...
USB cable is around 10cm.
I think they are shielde.
May be I will try it thanks!