Questions about noise on power and gnd from LED PWM dimming. - Page 1
Forum section: electronics / beginners

author: warpigs330
author_rank: Contributor
timestamp: May 22, 2021, 06:57:19 pm
content: I am working on a synthesizer module for the eurorack format. My module is microcontroller based and has 13 leds that I am dimming with pwm. The way eurorack works is that there is a central power source that feeds +-12v and GND to all the modules. My module doesn't actually make sound, but it shares power with a whole system designed for high quality audio (relatively, the noise floor is still fairly high). Right now I am doing things fairly naively on the programming side, just using the default arduino stuff for pwm dimming. I noticed that when my prototype is plugged in I can hear the effect of the PWM signals in the background noise of the system as a high-ish pitched whine. I haven't done too much testing but I am assuming that this is coming over the power connection and not radiated, because when I take the module out of the case but it is still connected to power the noise doesn't really change. I wonder what tips y'all have around this.Right now I have 10uf electrolytic bulk decoupling caps on my +-12v rails. The prototype I am working with is using a teensy, though I am moving to an STM32 and will have all the decoupling caps as indicated. 7 of my leds are red and in buttons and are powered directly by the microcontroller, the other 6 are white and powered with 12v and use a npn transistor to switch them. All of them are small low power leds (3mm) that are just for indicating things on the front panel. For what it is worth I am using a 4 layer board with the middle layers being gnd and a mixed power plane.As far electrical solutions, should I put decoupling caps near the transistors? I assume for the ones powered directly by the microcontroller the decoupling caps for the microcontroller handle that but for the ones switched with transistors, would that have an effect?I was also thinking that for audio rate specific solutions it would probably work to speed up the pwm frequency to above audible rate, so any induced frequency would at least be inaudible.Would love to hear any ideas for reducing noise from digital electronics in a mixed rack audio system with a shared power bus.

author: TimFox
author_rank: Super Contributor
timestamp: May 22, 2021, 07:01:31 pm
content: Increasing the PWM frequency to ultrasonic is a good idea, but is there a good reason not to use DC on the LEDs? My LED bench light is near my THD and spectrum analyzers (on shelves next the bench), and must be shut off when measuring.

author: warpigs330
author_rank: Contributor
timestamp: May 22, 2021, 09:15:42 pm
content: So I need to be able to dim the buttons for part of the interaction with the module. I can probably get away without dimming the white leds, but I wanted the user to be able to control the max led brightness because I know some people are sensitive to bright leds.

author: TimFox
author_rank: Super Contributor
timestamp: May 22, 2021, 09:21:29 pm
content: So these are power LEDs? How much current do they draw?

author: warpigs330
author_rank: Contributor
timestamp: May 23, 2021, 02:41:00 am
content: They aren't, just standard 3mm white leds. Just 12ma per white led and 20ma for the red buttons.

author: TimFox
author_rank: Super Contributor
timestamp: May 23, 2021, 02:48:47 am
content: It’s politically incorrect to use analog dc drive when pwm is fashionable, but absent a true need for efficiency (e.g. battery power), I dislike mixing switch-mode power and low-noise audio.

author: warpigs330
author_rank: Contributor
timestamp: May 23, 2021, 02:54:22 am
content: For my situation I am using a linear regulator to avoid power switching noise, I just don't know how to dim leds with a microcontroller any way other than PWM. I can probably avoid PWM for the white leds, but at least 5 of the button leds need to be dimmable.

author: David Hess
author_rank: Super Contributor
timestamp: May 23, 2021, 04:25:22 am
content: Quote from: warpigs330 on May 22, 2021, 06:57:19 pm10 microfarads may be low; I would start with 100 microfarads or maybe more depending on how much current is being switched.I have had exactly the same problem with noise from LEDs dimmed with PWM and I had to include like a 100+ microhenry series inductor as well to keep the switching noise from the power connections.The switching frequency should always be above or below the audio band.QuoteThe rule is to minimize the "area" of the high current loop of wiring which would mean attaching the capacitor between one side of transistors and the other side of the LEDs, but that probably is not strictly necessary here.

author: warpigs330
author_rank: Contributor
timestamp: May 23, 2021, 07:19:59 am
content: So I did some tests and you are right on the money about 10uf being too low. I tried it with a 470uf and it basically got rid of the noise.

author: Siwastaja
author_rank: Super Contributor
timestamp: May 23, 2021, 09:28:40 am
content: Slowing the edge of the PWM is easy and solves the EMI at some cost in efficiency.Assuming you use low-side N MOSFETs to drive the LEDs, it may be as simple as increasing gate series resistor value. Although if the LEDs are small and hence the MOSFETs are small as well, they may have so little gate capacitance you want to add some explicitly, like a 10nF part in parallel with G-S, so that gate resistors stay in low double digit kilo-ohm range.Experiment looking at the voltage rise and fall waveforms with a scope.

author: David Hess
author_rank: Super Contributor
timestamp: May 24, 2021, 03:51:04 pm
content: Quote from: warpigs330 on May 23, 2021, 07:19:59 amIt isn't necessarily the capacitance which is too low but the ESR which is too high, and increasing the capacitance will lower the ESR. With a better capacitor, like a polymer aluminum electrolytic, less capacitance will be needed, but a larger common aluminum electrolytic is likely still the most cost effective.

author: Zero999
author_rank: Super Contributor
timestamp: May 24, 2021, 04:51:44 pm
content: Quote from: Siwastaja on May 23, 2021, 09:28:40 amIt won't cost any efficiency in this case, as the LEDs are being powered by linear regulators.Quote from: warpigs330 on May 23, 2021, 02:54:22 amWhat sort of linear regulator? Are you just connecting the LEDs to the 12V via resistors? Are you sure you need that much current? How about driving them directly from the MCU?