Is it ok to PWM before LM317s driving LEDs in constant current mode? - Page 1
Forum section: electronics / projects

author: Neutron7
author_rank: Contributor
timestamp: September 15, 2012, 02:27:11 am
content: I am building under counter LED lighting for my kitchen, there is a transformer/rectifier/capacitor then each group of 8 LEDs has a constant current driver made from LM317 and a resistor. (there are no capacitors basides the power supply one.)here is some of the projecthttp://www.thingiverse.com/thing:30470based sort of on this instructablehttp://www.instructables.com/id/Build-LED-Under-Counter-Lighting-that-ROCKS/i would like to be able to dim them, i am just wondering if i could get a power FET and chop the main output of the power supply, so i only need one.will the lm317s overshoot and kill the LEDs? or die from being rapidly turned on and off?the pwm source will be 5 volts (common ground to the led supply of course)led supply is 24v 6A transoformer (overkill but i might add more inside cabinets with switches)there are 6 strips of 8 leds each limited to 350maanyone know of any pitfalls doing that?

author: IanB
author_rank: Super Contributor
timestamp: September 15, 2012, 02:38:33 am
content: My guess is that as long as you PWM at a low enough frequency it will be fine. To avoid visible flicker, try somewhere around 100 - 200 Hz. Keeping the frequency down there will avoid annoying audible whines too.The reason I think this will be fine is that I think an LM317 can respond in microseconds.

author: David_AVD
author_rank: Super Contributor
timestamp: September 15, 2012, 03:25:21 am
content: I've done this a couple of times with no issues.

author: ftransform
author_rank: Frequent Contributor
timestamp: September 16, 2012, 12:06:23 am
content: I was just working on this and it works great!Careful not to fry your switching 5v circuit though. I did my design using lm317 driven by a PNP transistor driven by a NPN transistor switched by a 555 timer.

author: David_AVD
author_rank: Super Contributor
timestamp: September 16, 2012, 01:59:08 am
content: Ground switching is always easier and more universal with respect to mixed voltages. NPN transistors or N-channel MOSFETs are cheaper and more common too.On some LED strobes I made, I put the LM317 on the same board as the LED array. It makes no difference whether you put the LM317 CC section in the +ve or -ve leg of the LED string so long as the LM317 input is still towards the +ve side. Make sense?There were 5 LED boards hooked up (in parallel) to one controller that did the timing (flash rate & duration) of the 24V DC pulses. So the LM317 set the maximum current (for that LED array), but the controller could still PWM all of the LED boards if we required a lower light level.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: September 16, 2012, 07:56:30 am
content: Why do you guys go to the trouble to use a LM317 as a constant current regulator when you got aconstantinput voltage and set asteadycurrent for the LEDs?For simplification it would be enough to just use one resistor to set the LED current and the PWM-MOSFET...

author: David_AVD
author_rank: Super Contributor
timestamp: September 16, 2012, 09:26:27 am
content: Quote from: PSR B1257 on September 16, 2012, 07:56:30 amThe LED Vf is not constant (drops with increasing temperature) meaning that the current can spiral out of control if the overhead voltage is small and/or the supply voltage increases even by a seemingly small amount.Using the LM317 solves this problem and saves you ending up with crispy LEDs.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: September 16, 2012, 09:47:35 am
content: QuoteI know. But is this really that critical?

author: T4P
author_rank: Super Contributor
timestamp: September 16, 2012, 10:05:36 am
content: They have sharp positive coefficients, being slightly warmer doesn't kill them but can cause thermal runaway if not properly current controlled. It's crucial for maximum lifetime

author: David_AVD
author_rank: Super Contributor
timestamp: September 16, 2012, 10:55:12 am
content: Sorry, you are right about the positive coefficient. Not sure what I was thinking there.The Vf can also vary from batch to batch as well as with temperature. Using a CC source is the sensible method when driving higher power LEDs.I saw a really bad design for an LED floodlight. They used a 1 Ohm current limiting resistor. I can only presume the designer calculated the dropping resistor so low due to the near zero overhead (12V supply and series strings of 4 LEDs). A very small increase in the supply voltage increased the LED current to the point of destruction in a short time.

author: T4P
author_rank: Super Contributor
timestamp: September 16, 2012, 11:57:04 am
content: Quote from: David_AVD on September 16, 2012, 10:55:12 amSee them on cheapie flashlights. Just don't buy the ones that have rings of 5mm leds and it should be fineUnless they get so bad they actually use a resistor on the larger LED dice

author: SeanB
author_rank: Super Contributor
timestamp: September 16, 2012, 12:34:05 pm
content: I have a couple of those torches, and added resistors in series with the LED's. mostly inside the 3 AAA pack in the case replacing a link between 2 cells. Works much better now. With those lights you really have to use the OHL cells, as the internal resistance of them when new is so high that they provide all the current limiting needed. Use a good alkaline cell set and you fry the dies in short order.I saw an aquarium LED lamp today that was very charred, cheap chip diodes that were run so hot they melted the plastic cover above them and got so hot that they charred the melted plastic black in places. PCB was very brown under the white screenprint reflector over it, a lot more brown than SRBP should be. No heatsinking at all, and thin traces on the diodes as well, built to fail.

author: PSR B1257
author_rank: Frequent Contributor
timestamp: September 16, 2012, 03:18:01 pm
content: QuoteThat's very poor.I've got the exact opposite in mind (one LED across a resistor @ 12V e.g. - then even a voltagedrop of 1V at the LED (and/or at the powersupply) wouldend effect the current significantly), when I wrote, that one resistor would be fine.