I want to dim some LEDs, using the PWM output from a microcontroller. There are some more LEDs than in the schematic, already wired, so that they need nearly 12 V to give maximum light at about 50 mA.

The power adapter will give 12 V so I needed to minimize the voltage drop in the reference resistor R22. This is done with the voltage divider R24,R25. The 0 .. 5 V control voltage, generated by the uC's PWM is set down to approximately 0 .. 120 mV on R25.

Problem 1: For lower voltages, the LED's brightness won't be stable. When e.g. switching a devices with larger power consumptions near the circuit, the LEDs will flash very bright. I think this is a current induced somewhere in the regulation circuit and I will have to think about some filter.

Problem 2: When e.g. switching the status LED15 on, the brightness of the LED array is reduced for the whole time LED15 is on. This is a problem, I don't understand. The 5 V supply is a power supply for laboratory use. It shows a bigger current consumption when the status LED is on, but the displayed voltage does not change up to the digit for 0.1 µV. I don't think, there is no voltage glitch, but it should be stable at the same voltage as before after some time. But the LEDs are constantly darker when the status LED is on.

The question(s): (1) Does anyone find an explanation for the brightness change, when the status LED is on? And (2) do you know of approaches to make such a regulation circuit more EMI resistant?

Edit: I uploaded an erroneous schematic. The voltage divider is connected wrong. Added the correct schematic.

wrong circuit

The correct schematic:

enter image description here

  • \$\begingroup\$ LEDs in parallel like that are a Very Bad Idea™ unless you like your LEDs deep fried. \$\endgroup\$
    – Majenko
    Jan 12 '15 at 15:15
  • \$\begingroup\$ yeah, this is a hard wired china led light. I have a lot of these. They seem to work well. \$\endgroup\$ Jan 12 '15 at 15:18
  • \$\begingroup\$ As long as the LEDs are well balanced they may be OK for a while. If one LED should blow, though, the whole lot goes pop. They may have added a resistor to each branch to aid the balancing. \$\endgroup\$
    – Majenko
    Jan 12 '15 at 15:20
  • \$\begingroup\$ nope, they did not :) \$\endgroup\$ Jan 12 '15 at 15:26

First you should monitor the current with an oscilloscope. The circuit you have is prone to oscillation, and that's probably what's happening to make the LEDs go bright. You should stabilize the circuit. I'll add a schematic in an edit in a bit.

Secondly, you should check the voltage at pin 3 of the op-amp- you've probably got a firmware problem of some kind that is affecting the PWM.

Edit: If you look at the datasheet, you'll see that loads in excess of 100pF can negatively affect stability. Obviously the MOSFET gate is more than 100pF, and the 2.34 ohm resistor is almost a short.

So, here is a way to deal with that:


simulate this circuit – Schematic created using CircuitLab

  • \$\begingroup\$ I am also suspecting oscillation. I tried to add a Filter to the feedback voltage like in your drawing (R1 = 100 Ohm, R2 = 10 kOhm, C1 = 10 nF). It slowed down the rising and falling edge of the synchronous brightness change of the LEDs with the status LED. But the effect was not lessened. Did you calculate the values? According your second note: The PWM is definitely not a problem. I monitored the voltage with an oscilloscope and I even tried to put a voltage from another power supply on pin 3. It made no difference. \$\endgroup\$ Jan 12 '15 at 14:30
  • \$\begingroup\$ And the voltage across R22? The status light is not even connected to the power circuit. Maybe your grounds have some voltage drop- perhaps you have a resistor or inductor that is not shown. \$\endgroup\$ Jan 12 '15 at 14:33
  • \$\begingroup\$ The only additional part is a 16 MHz ceramic oscillator with build in capacitors. Hmm yes, there is a 165kHz square wave oscillation across R22 with 300 mV amplitude. When I go down to 1 nF with C1 this is gone for nearly all input voltages. But the problem with the brightness is still there. But there is also a 16 MHz frequency in +- 50mV range (16 MHz the frequency, the µC is running at). When the status LED is on, it seems like there is some phase shift or something. I will try to filter this 16 MHz on the ground. \$\endgroup\$ Jan 12 '15 at 17:27
  • \$\begingroup\$ @PascalRosin Note that the observed oscillation is 128mA in amplitude at the LEDs, which is not small. \$\endgroup\$ Jan 12 '15 at 17:38
  • \$\begingroup\$ @PascalRosin 100 ohms may well not be enough to isolate the output of a wimpy op-amp like that one. That's why I used a higher value. No, I didn't need to calculate it. \$\endgroup\$ Jan 12 '15 at 17:40

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.