Can I dim a constant-current LED driver with MOSFET + PWM?

TDLR; Can I dim a constant-current LED driver by driving PWM to a MOSFET? I've seen no's and I've seen yesses and my trials give me mixed messages too.


I have a few LED stars connected in series to a constant current power supply of 350ma, which varies its voltage between 3V-36V. My use case is a computer vision application and to get things just right I want the ability to dim the LEDs.
I see that there are LED drivers with specific dimming options like 0-10V analog dimming or pwm but I'm wondering if it isn't possible to dim the output side of my LED driver with PWM myself, with the driver that I have here.

From what I've gathered so far it appears smart to use a MOSFET rather than a BJT transistor for fast switching and little internal resistance (Rds). Ideally a logic level MOSFET which saturates at Arduino's 5V-level output (Vgs) to do away with the necessity of a transistor driving circuit where an Arduino-driven PNP transistor would do the work of switching the MOSFET.
I hope I'm using the right wording here :slight_smile:

The image below displays which wiring I came to and which MOSFET I selected. I wrote an Arduino sketch that allows me to switch between different outputs for my selected Arduino pin #3. Switching on and off seems to go fine. Blinking on and off appears to go allright although sometimes ever so swiftly, it seems like the onset of the 'on' state overshoots or something. The final state if a PWM sweep going up/down between values 0-255. This has a strange result. It certainly fades out at some point but I see a kind of sinusoidal bouncy response rather that a linear one (see image below).
This doesn't seem right to me and I'm not confident that this is a healthy solution.

I suspect that the constant current power supply, which varies its voltage depending on demand, doesn't exactly allow dimming as we expect dimming to happen and maybe I'm even damaging it or the LED by trying this. What wisdom do you have? Is it feasible to dim a constant-current LED driver with a MOSFET?

My electrical diagram

Difference between the linear PWM rise/fall and the odd visual behavior of the LED

That ought to work. The question is how the constant current device will react, and controll the current at some 490 Hz pulse frequece without running into oscillations.
.

There is an other possible option - That's wiring the MOSFET to "short out" power supply. If it works, the voltage should drop to nearly zero as it continues to "push" 350mA through the MOSFET. (You'd never do that with a "normal" constant voltage power supply.)

Either way, is hard to predict how the power supply will react to either extreme because it's not designed to work that way.

Using a rather low pulse frequency like some 50 Hz could be a way to go. Nobody is disturbed by the mains frequency feeding the bulbs.....

Railroader:
That ought to work. The question is how the constant current device will react, and controll the current at some 490 Hz pulse frequece without running into oscillations.
.

I also wondered about this. I'll try changing the timings!

DVDdoug:
There is an other possible option - That's wiring the MOSFET to "short out" power supply. If it works, the voltage should drop to nearly zero as it continues to "push" 350mA through the MOSFET.

Ooh!... I find that a bit exciting to do. In my mind one never wants a short. What would happen when the MOSFET is open then? Then it's just a parallel load doing essentially nothing?

I've never heard of shorting stuff like that. How would the over current regulator handle that plenty of times per second? I wouldn't think about it.

Which LED driver (post a link or a picture).

If it's a switching LED driver (you mentioned "Chain of LEDs"),
then you can most likely just connect it's DIM pin to an Arduino pin,
or add (solder) a wire to the DIM pin of the chip if DIM isn't broken out.
Leo..

@Wawa: this is the driver: https://uk.rs-online.com/web/p/led-drivers/7362368/. Does this make things clearer for you?
When you say dim pin, does that imply cracking open the case and looking for it?

Railroader:
I've never heard of shorting stuff like that. How would the over current regulator handle that plenty of times per second? I wouldn't think about it.

I'll hold off on that then :slight_smile:

That's an IP65 rated (dust/splash proof) mains powered LED driver, not designed for dimming.

Find another driver if you want dim capabilities.
Leo..

You cannot dim a constant-current driver unless it has the "dimming" pins (so six terminals to the unit), either by applying PWM to the input, interrupting the output or shorting the output.

If you "pop" open this device - not difficult actually - you will find it has an electrolytic capacitor across the output terminals! This may be a trifle surprising for a constant-current source, but the (LED) load is not expected to vary its characteristics over any short interval and the capacitor is required to stabilise the switchmode converter against the length of wiring on the output.

Since the input to the converter also has an electrolytic capacitor across it, "chopping" the input will simply charge the capacitor fully (and draw more current) during the "on" times. If you were to interrupt the output circuit, the capacitor would charge to a higher voltage during the "off" times and deliver heavier current pulses when the "chopper" turns on, maintaining the same average current as determined by the constant-current driver.

And if you short the output, you will be dumping the capacitor into the short circuit and it will not have time to charge sufficient during the "off" times to even light the LEDs - all the constant-current will be dumped into the shunt. :roll_eyes:

And if you were to remove the capacitor, all hell may ensue! :astonished:

Shortening the output capacitor... Whar currents will that FET face? Arbitrary but high I guess.
As You say, go for another powersource.

Thank you all for your answers. I enjoyed learning about the theoretical ways to achieve dimming but ultimately the answer is no for the LED driver that I have at my disposal. I'm going to source a dimmable one now. I'm glad that in the meantime I learned a few things about transistors. It surprises me every time what a rabbit hole that is!

1 Like