Thundercat
Well-known member
Hi all,
I've been wracking my brain and spent untold hours trying to figure out the source of noise in a project I'm doing. It's a MIDI fader, and I've got an LCD screen and some buttons with RGB LEDs that I'm changing colors using PWM pins.
What happens is, randomly, the unit outputs MIDI values when the faders are not moving. About 10-20 events per hour. Not a deal breaker, but this is a product I sell, so absolutely not acceptable!
I'm using the ResponsiveAnalogRead library of course. And all fader pins have 150nf capacitors on them just prior to input pins. Plus careful detail to isolating the fader circuit from the rest of the unit with dedicated ground and power pins, plus ground plane and power plane - everything I could think to make this quiet.
But it's not quiet!
After countless hours, remaking the PCB multiple times, nothing was working, so I decided to do a "burn it to the ground" test. I made a copy of the code, then ripped out absolutely every routine one by one until I found what was causing the noise.
Well guess what? Using the PWM pins to change the buttons colors is causing the jitter! I know this 100% because without changing the color of the buttons using PWM, there is absolutely no noise whatsoever (no extraneous MIDI outputs, no jitter from the faders at all).
So this leads me to my question: what can I do about this?
Is it as simple as hanging some capacitance on each LED, from power to ground? If so, how much is recommended?
Or is there another way to handle this? I really don't want to make another PCB board, so a code solution would be great.
Note: I've already tried changing the PWM frequency to much lower, or much higher, but this did not seem to fix anything. Still noise.
Thank you so much for your insights.
Mike
I've been wracking my brain and spent untold hours trying to figure out the source of noise in a project I'm doing. It's a MIDI fader, and I've got an LCD screen and some buttons with RGB LEDs that I'm changing colors using PWM pins.
What happens is, randomly, the unit outputs MIDI values when the faders are not moving. About 10-20 events per hour. Not a deal breaker, but this is a product I sell, so absolutely not acceptable!
I'm using the ResponsiveAnalogRead library of course. And all fader pins have 150nf capacitors on them just prior to input pins. Plus careful detail to isolating the fader circuit from the rest of the unit with dedicated ground and power pins, plus ground plane and power plane - everything I could think to make this quiet.
But it's not quiet!
After countless hours, remaking the PCB multiple times, nothing was working, so I decided to do a "burn it to the ground" test. I made a copy of the code, then ripped out absolutely every routine one by one until I found what was causing the noise.
Well guess what? Using the PWM pins to change the buttons colors is causing the jitter! I know this 100% because without changing the color of the buttons using PWM, there is absolutely no noise whatsoever (no extraneous MIDI outputs, no jitter from the faders at all).
So this leads me to my question: what can I do about this?
Is it as simple as hanging some capacitance on each LED, from power to ground? If so, how much is recommended?
Or is there another way to handle this? I really don't want to make another PCB board, so a code solution would be great.
Note: I've already tried changing the PWM frequency to much lower, or much higher, but this did not seem to fix anything. Still noise.
Thank you so much for your insights.
Mike