PWM on LED too slow

Hello everyone,

I wanted to make a simple circuit for controlling a 10W COB LED. O have hooked everything up (see the picture in attachment), but when I try to PWM the led - for dimming purposes, it flickers a lot until around 40% of the duty cycle. Then it starts to shine at full brightness at any level until 100%. My circuit skills are quite miserable, so I have no idea what did I do wrong. Is it because of the optocoupler? Or because of a bad power supply?

(Just a note: the "In+" leads to the power supply and "Out+" leads to the LED)

Thanks everybody in advance
M.

see the picture in attachment

Where?

Hi,
You don't really need the opto-isolator? I use a small N channel 2N7000 FET (but I don't drive 10W, works for 3W) with Source to gnd, Drain to LED cathode and the Arduino pin to the Gate, Gate tied to Gnd via a 10-100K resistor, to keep it OFF until Arduino take it HIGH, no voltage loss, so brighter.

You could still use the opto with the FET, just to be extra safe.

I don't notice any flicker at all, your program must have a delay in it to step through the PWM process, try altering this delay, make it smaller, experiment a bit.

Hope it helps.

Regards

Mel.

Thanks Mel,

yes, the optocoupler isn't necessary, but I wanted to use it just.. well, for some extra safety. So is it the problem with TIP120? I have some FETs lying around, so I can try. But I just don't understand why it does not work this way.

Also what I thought that I would need a pulldown while the input from arduino is LOW, but somehow it works reliably even without. I have, also, no idea why..

M.

The problem is that you can not drive a 10W LED without some sort of current control. You appear to have none.
You need a constant current source.
There are lots of designs one is attached.

Well, I have a LED driver in front of it, not just "some power supply". it is supposed to deliver 280mA.. Do I really need to controll the current?

Thanks. M.

I have a LED driver in front of it,

This is why it is important to say exactly what you have. What driver? Link to data sheet please.

It is most likely that the driver does not respond quickly enough to having the whole of the power supply removed. You normally apply PWM control further down the line than just a top switch.

Yeah, it is one of those extremely cheap ones (http://www.aliexpress.com/item//1973332388.html). It works just fine.. unless you want to PWM it :blush:. So the problem is in the driver?

Thanks M.

You need to look at all the signals on an oscilloscope to track down where it is going wrong.

Yeah, it is one of those extremely cheap ones (http://www.aliexpress.com/item//1973332388.html). It works just fine.. unless you want to PWM it :blush:. So the problem is in the driver?

It doesn't say "dimmable" in the specs. It's trying to hold a nice constant 280mA , and you're trying to "fight it" and modulate the current...

A dimmable constant-current LED power supply is usually controlled by 0-10VDC or 10V PWM. That means you still need a 10V supply and a transistor or MOSFET to "boost" the Arduino's 5V output.

Yeah, you can't PWM the driver like that. To it, the PWM looks like a really lousy power source, and it's trying as hard as it can to get the LEDs to come on full brightness, and at around 40% in your case, the input capacitors are able to hold it over while the PWM is off, and the LED comes on full brightness (with correspondingly more current drawn while the PWM is on).

(in descending order of desirability) Either get a driver that supports PWM dimming, build one (there are lots of designs for a buck or boost driver, and chips designed expressly for the purpose), or carefully adjust the supply voltage so you don't need a constant current driver.

You can do PWM dimming on high power LEDs with just an adjustable boost (or buck, if appropriate) converter, if you adjust the voltage correctly, even without current limiting. Wire everything up, measuring the current going through the LED with your multimeter - slowly ramp up voltage until current is right, and then put some tape or nailpolish on the adjustment screw so you don't accidentally change it. Switch the power between LED and boost converter, not before it.

Thanks everybody for helping me out,

I have swapped the led and power supply and dimming works just fine, so the problem is in the power supply.

I'm just thinking: What if I put some bigger cap parallel between the TIP120 and the power supply? That should cover the time while it is not delivering the current and thus allow me to do the PWM..

Thanks again,
M.

? ? ?

By adding a big capacitor you are providing a big energy store thus further reducing your ability to PWM the whole thing.

You are perceiving that dimming at 40% duty cycle because of the circuit capacitance (including the contributes of capacitors inside your driver) and by increasing the capacitance you will have to further reduce the duty cycle to achieve the same dimming, potentially moving it so close to 0% you will not be able to get even that....

Well, that wouldn't work. Sorry for little OT, but I'm starting to get confused. Everytime I build something using arduino I order all the parts, wait a month for them, and repeat only because I thought that "in theory" it should work.

I'm trying to figure this out. I'm building a little party light sensing music using MSGEQ7 (graphic equalizer) and an arduino. Everything works just fine. Except the lights side of the circuitry. I first tried using a LED light bulb with a SSR, but it failed for reasons unknown to me (probably just too cheap SSR, tried 2, both failed the same way). Then I decided to use a driver, waited a month for it to come and now.. Now we are here. I'll probably stick with it without the PWM, but I'm still looking for another possibility.

When I tested the circuit I used a salvaged PC power supply (with 12V 10W LED instead of those 30V I'm using with drivers). And it just worked! Are there any risks of doing that pernament? I'm speaking of connecting the 12V LEDs straight to the DC12V of the power supply (and switching it with TIP 120...). (I'm having a feeling that I should connect a resistor in series with the led, but what if the voltages are equal?)

Thanks M.

MtHzR:
I have swapped the led and power supply and dimming works just fine, so the problem is in the power supply.

No, the power supply is just doing its job to the best of its ability - it is after all, a "constant current" supply, and its purpose is just that. You are trying to get it to supply less current on average, and it is desperately trying to prevent that. That is the actual "problem".

MtHzR:
I'm just thinking: What if I put some bigger cap parallel between the TIP120 and the power supply? That should cover the time while it is not delivering the current and thus allow me to do the PWM.

That would be far worse! While the PWM cycle is switched off, the capacitor charges to a higher value and then as the PWM switches on, delivers a grossly excessive current to the LED.

MtHzR:
When I tested the circuit I used a salvaged PC power supply (with 12V 10W LED instead of those 30V I'm using with drivers). And it just worked!

No doubt.

MtHzR:
Are there any risks of doing that pernament? I'm speaking of connecting the 12V LEDs straight to the DC12V of the power supply (and switching it with TIP 120...).

Various risks. You need some sort of constant load on the PC power supply to allow it to regulate, generally on the 5V supply because that is what is regulated internally. It may otherwise become unstable.

MtHzR:
I'm having a feeling that I should connect a resistor in series with the led, but what if the voltages are equal?

What you have not done so far, is explained (with a link) what the LED actually is, so that we can understand what is properly necessary to control it.

MtHzR:
Well, that wouldn't work. Sorry for little OT, but I'm starting to get confused. Everytime I build something using arduino I order all the parts, wait a month for them, and repeat only because I thought that "in theory" it should work.

Yup. Do you know about digikey? (in the US, at least) They don't have the modules and cheap chinese boards, but they've got oodles of components, and you can ship via usps for like $3, and it's really fast.

The chinese electronics vendors on ebay and elsewhere are usually cheaper, but they only have common parts, and the shipping is miserable. My strategy is to buy anything that looks neat and is absurdly cheap, that way if I decide to do something that uses it, I don't have to wait for shipping (now if only I could find my desk...)

MtHzR:
When I tested the circuit I used a salvaged PC power supply (with 12V 10W LED instead of those 30V I'm using with drivers). And it just worked! Are there any risks of doing that pernament? I'm speaking of connecting the 12V LEDs straight to the DC12V of the power supply (and switching it with TIP 120...). (I'm having a feeling that I should connect a resistor in series with the led, but what if the voltages are equal?)

Thanks M.

Yeah, you have to be a bit concerned about the PC power supply's power quality. I'm not sure how severe of a problem this is, though. You can also buy surprisingly cheap 12v power supplies... on amazon, not just ebay-from-china.

You probably do want a resistor in there - IIRC, those LEDs are happier at 10-11v than 12. I'd measure the current going through the LED (with multimeter), and compare that to the expected current, and then pick a resistor value based on that. I'd expect something in the 1 ohm or less range.

DrAzzy:
My strategy is to buy anything that looks neat and is absurdly cheap, that way if I decide to do something that uses it, I don't have to wait for shipping (now if only I could find my desk...)

Oh, how I feel for you (on both counts)! 8)

Paul__B:
What you have not done so far, is explained (with a link) what the LED actually is, so that we can understand what is properly necessary to control it.

It is just one of these There are no datasheets so all I know is that it runs off 9-12VDC and it should draw 400-450mA.

DrAzzy:
Yup. Do you know about digikey? (in the US, at least) They don't have the modules and cheap chinese boards, but they've got oodles of components, and you can ship via usps for like $3, and it's really fast.

Unfortunately I'm a high school student from the Czech Republic (central Europe) so I haven't heard of that. I usually order most things off the eBay just because it is cheaper and I usually don't have to hurry.

Thanks for trying to help me out.

MtHzR:
It is just one of these There are no datasheets so all I know is that it runs off 9-12VDC and it should draw 400-450mA.

Right, now we know exactly what it is - it is a 3 by 3 series-parallel array of LEDs with no other components. As such its voltage drop is three times that of a single high-brightness white LED.

You have your description backwards. It does not "run off 9-12VDC" and "should draw 400-450mA" at all. It runs on 425 mA which you have to control with a current controller and you may expect its voltage drop whilst doing so to be in the order of 9V. You were powering it more-or-less appropriately with the possibly deadly power supply you first cited except that it was delivering less-than-optimal current and could not of course, use PWM.

What you need to do to operate from the 12V supply is to use your TIP120 transistor - with heatsink - as the second transistor in the circuit Mike has given you to control the current while you apply the PWM signal as the circuit indicates, to the input resistor.