Go Down

Topic: PWM on LED too slow (Read 3377 times) previous topic - next topic

MtHzR

Nov 20, 2014, 08:17 pm Last Edit: Nov 20, 2014, 08:22 pm by MtHzR
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.

larryd

Quote
see the picture in attachment
Where?
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

Cactusface

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.
Open your mind! But not too far, your brains might fall out.
Also like Photography, model building and my 300+ Cacti and Succs.

MtHzR

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.

Grumpy_Mike

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.

MtHzR

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.

Grumpy_Mike

Quote
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.

MtHzR

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 :smiley-red:. So the problem is in the driver?

Thanks M.

Grumpy_Mike

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

DVDdoug

#9
Nov 20, 2014, 10:10 pm Last Edit: Nov 20, 2014, 10:12 pm by DVDdoug
Quote
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 :smiley-red:. 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.

DrAzzy

#10
Nov 20, 2014, 10:20 pm Last Edit: Nov 20, 2014, 10:21 pm by DrAzzy
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.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

MtHzR

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.

rlogiacco

? ? ?

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....
Please, do not send me personal messages containing forum related questions: I will not answer.

I share my discoveries and thoughts at http://rlogiacco.wordpress.com

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.

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.

Paul__B

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".

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.

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.

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.

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.

Go Up