4
\$\begingroup\$

I am working on a hobby project involving controlling LED strips (working at 12 volt and drawing up to 5A). The light intensity of the strip is controlled using a single MOSFET transistor (specifically FDA8440) connected to the MCU. I am controlling the light intensity with the microcontroller using PWM.

The project is powered by a Mean Well LRS-100-12 power supply. The problem is that I hear an audible and bothersome noise when the LEDs are not fully off or fully on, which comes from the transformer inside the power supply unit.

Other that the LEDs, the PSU is also powering the PSU (an ESP32) trough a buck converter (a circuit based on the XL4015 chip ). At the moment the wiring is done over a breadboard.

enter image description here enter image description here

The amount of audible noise depends on both the frequency and duty cycle of the PWM signal (the frequency of the sound seems to be very roughly that of the PWM somehow scaled down by the duty cycle). If I set the frequency at around 100 Hz I hear a more or less constant amount of noise. Decreasing the frequency from there reduces the noise but then LEDs start to perceptibly flicker, which is not ideal. Increasing the frequency above 100 Hz makes the problem worse and the amount of noise I hear acquires a dependency on the duty cycle: It seems to pick two or three resonant frequencies between 0% and 100%. If I try to escape the audible range by setting the frequency at something like 50 kHz, I still hear loud noises when the duty cycle is about 30%. This also makes lower duty cycles (10% or so) not work well as I observe LEDs flickering substantially.

I note that if I add some constant and high enough load (a resistance), then the PSU is quiet. How could I make it quieter? Maybe some kind of capacitor bank would help making the transformer vibrate less?

\$\endgroup\$
24
  • \$\begingroup\$ "... setting the frequency at something like 50 kHz, I still hear loud noises when the duty cycle is about 30%. This also makes lower duty cycles (10% or so) not work well as I observe LEDs flickering substantially." There's something odd there. Are you sure you're maintaining PWM frequency at low duty cycles? \$\endgroup\$
    – Transistor
    Commented May 23, 2021 at 17:48
  • 1
    \$\begingroup\$ btw - the way you've drawn your circuit makes it look like the MOSFET drain is connected to the power supply negative terminal (ground). The MOSFET source should be at ground and the drain terminal connected to the cathode (negative) end of the LED. \$\endgroup\$
    – ErikR
    Commented May 23, 2021 at 17:56
  • 1
    \$\begingroup\$ I would like to see a complete schematic, It appears the MOSFET mayo not be fully enhanced. \$\endgroup\$
    – Gil
    Commented May 23, 2021 at 18:13
  • \$\begingroup\$ @Transistor I think I am setting the PWM frequency at the controller output. I think the flickering has to do with non ideal properties of the transistor/setup (not sure which ones though). I also observe flickering with very low duty cycles (as 1/2000) with frequencies of 500 Hz. I should mention that at the moment the transistor is connected to a breadboard. \$\endgroup\$
    – Zah
    Commented May 23, 2021 at 18:46
  • 2
    \$\begingroup\$ If the noise is from the PSU, this is really easy: put a decent size cap on the PSU output, well before the PWM and LEDs. That way the PSU never even sees the noisy load. Start with 10,000u or so, increase if needed. Also, is your FET getting hot? 3.3v is often a bit low. Might use a level shifter as a poor man's FET driver. \$\endgroup\$
    – dandavis
    Commented May 24, 2021 at 4:16

2 Answers 2

2
\$\begingroup\$
  1. The PWM frequency is too low. More typically it'd be in the 1-100kHz range.

  2. There are no decoupling capacitors.

  3. That mosfet floating in the air on long wires is waiting to either self-destruct or to destruct the MCU or the LED strip. MCU, MOSFET, R1 and C1 (see below) should be as close together as possible!

The connections should look approximately as follows:

schematic

simulate this circuit – Schematic created using CircuitLab

  • C1 sources load AC current to the LED-MOSFET circuit. It should be a "bulk" capacitor in the 100-5000uF range, in parallel with 100nF
  • C2 sources gate AC current to the MOSFET
  • C3 shunts the AC current from the LED loop - the AC current doesn't do any useful work other than warming up the LEDs, so it might as well be kept inside the box
  • R1 limits the bandwidth of the gate current
  • GPIO1/GPIO2 are a short path through which most of the AC gate current circulates. They should be connected directly across M1 through R1 as shown.
  • GPIO2 should be set to a fixed 0 (low) output
  • GPIO1/2 should be both set to the highest drive strength available (this depends on what a particular MCU provides)
  • C1 to PSU should be a separate pair of wires, going directly from PSU terminals to C1 terminals
  • BUCK to PSU should be a separate pair of wires, going directly from PSU terminals to the BUCK in/gnd terminals
  • C2 should be ceramic and connected as close to MCU pins as possible
  • The solderless breadboard is likely to perform poorly in this design, due to large parasitics.
  • Attention must be paid to minimize the areas of the five AC current loops indicated. LOOPs 3,4 should be twisted pairs. LOOP 5 should be either very short (1" or less), or also a twisted pair. LOOP 2 must be as short as possible. LOOP 1 is long but should be narrow due to the design of the LED strip. Never connect to the LED strip on opposite ends, always connect only from one end. The wires from M1/C1 to the led strip(s) should be a twisted pair if it's longer than 1".
  • The components in the dashed box should be close together.
  • The bottom of M1, C1, and the two wires that connect to it, should be a single point "star ground".
\$\endgroup\$
3
  • \$\begingroup\$ Thanks for the very detailed answer. What is the advantage of using GPIO2 versus the ground pin of the MCU? Is it that it improves the drive strength? \$\endgroup\$
    – Zah
    Commented Mar 24, 2022 at 14:07
  • \$\begingroup\$ @Zah Depending on the MCU pinout and how you placed the decoupling capacitors, it may decrease the loop area by routing the VCC and GND currents nearby. In any case it'd have a small effect, but the effect would be localized induction into various other nodes on the MCU. So this little loop, if too large, could induce interference into lots of other signals, just increasing the EMI footprint of the system. Not a big deal if the MCU doesn't do much else, but in larger systems with unshielded internal cabling it makes a measurable difference. \$\endgroup\$ Commented Mar 24, 2022 at 15:29
  • \$\begingroup\$ Why should the LED strip never be connected on opposite ends? (This seems to contradict with the answers at /questions/364980) \$\endgroup\$
    – BillyNate
    Commented Sep 20, 2022 at 8:33
0
\$\begingroup\$

The operation of the schematic would be a bit hit and miss if the grounds of the 12V PSU is not connected to the Ov of your PWM source.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Tip: '0 V' (zero volts) as opposed to 'Ov' (oh-vee). \$\endgroup\$
    – Transistor
    Commented May 23, 2021 at 19:20
  • 1
    \$\begingroup\$ I believe the buck converter I use to power the MCU internally connects the grounds. It passes a continuity test. \$\endgroup\$
    – Zah
    Commented May 23, 2021 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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