Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LED driver LM317 schematic

Status
Not open for further replies.

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
Hello I need to build a variable driver for a led lamp using the LM317.
The lamp can operate from 2.7v @ <10mA up to 3.1v @ 400mA for full brightness.

Can you suggest a suitable adjustable voltage driver using the LM317, but I need to make sure that 3.1v will not be exceeded, so that the leds can be driven safely.
 

xenos

Full Member level 4
Joined
May 9, 2015
Messages
212
Helped
82
Reputation
164
Reaction score
81
Trophy points
28
Location
127.0.0.1
Activity points
1,182
Use lm317 as a constant current source for max current and add potensiometer or pwm to control brightness
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating

SunnySkyguy

Advanced Member level 5
Joined
Sep 26, 2007
Messages
6,983
Helped
1,709
Reputation
3,416
Reaction score
1,697
Trophy points
1,413
Location
Richmond Hill, ON, Canada
Activity points
51,543
Depends greatly on your heatsink thermal resistance how much current and heat rise to say 70'C

I succesfully use 4S on 12V on AWG18 with 30AWG drops for Rs equalization of 0.1Ohm or 6S on 18 or 19V or 8S on 24V or 24S on 48V. So no loss on regulator and adjust supply drop with long wire suitable guage for 100% voltage matched between supply and ESR of load with multiples of 3V. If you have lossy LEDs (poor wirebonds or undersized chips) then Vf is >3V at rated current

See example here
https://www.edaboard.com/blog/1946/
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
15,153
Helped
4,943
Reputation
9,907
Reaction score
4,754
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
128,697
The 3.1V is Vf @400mA so if you prevent the current going higher than that the voltage will not be able to rise higher. It's a current limiter, not a voltage limiter you need.

You can use the LM317 or a fixed voltage regulator in constant current configuration but beware that the output current passes through the current limiting resistor. If you use a variable resistor make sure it can handle the current. Probably an op-amp monitoring the voltage aross a current sensing resistor would be a better solution and it makes it possible to set the current with a variable control voltage which makes it more versatile.

Brian.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,284
Helped
2,141
Reputation
4,276
Reaction score
1,968
Trophy points
1,393
Location
Toronto area of Canada
Activity points
58,417
Nobody makes an LED with a voltage rating like you say. For 400mA the forward voltage of your LED Might be 3.1V (typical) but it also might be 2.8V (minimum) or 3.4V (maximum) or anywhere in between. The forward voltage of an LED also changes when its temperature changes.
Please post the part number or datasheet of the LED so we can show ya.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
Nobody makes an LED with a voltage rating like you say. For 400mA the forward voltage of your LED Might be 3.1V (typical) but it also might be 2.8V (minimum) or 3.4V (maximum) or anywhere in between. The forward voltage of an LED also changes when its temperature changes.
Please post the part number or datasheet of the LED so we can show ya.

I don't have it. I have taken them out of an old led lamp. 23 leds are connected in parallel and max brightness without heated too much occured at 3-3.1v
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,284
Helped
2,141
Reputation
4,276
Reaction score
1,968
Trophy points
1,393
Location
Toronto area of Canada
Activity points
58,417
I also have a very cheap Chinese flashlight with 24 white LEDs in parallel and the internal resistance of the 3 AAA cell battery limits the current. They buy millions of LEDs, test them all and make groups with exactly the same forward voltage.
 

SunnySkyguy

Advanced Member level 5
Joined
Sep 26, 2007
Messages
6,983
Helped
1,709
Reputation
3,416
Reaction score
1,697
Trophy points
1,413
Location
Richmond Hill, ON, Canada
Activity points
51,543
I cut my 4 series power LEDs out of MCPCB boards with 18 in series.

I drive all mine with a fixed voltage in strings of 4,6,8 depending on what surplus PSU I have and how much illumination I need as shown in Blog. & some have been running for 4 years.

Can you define your thermal design and choices of power sources and min/max current you need?

my concept for home of the future is central feed of 48V thruout house and Buck adjustable current boards for each application with a BOM cost about 0.5 to $2 for each. Thus eliminating need for wallwarts.
 

kam1787

Advanced Member level 3
Joined
Jul 5, 2010
Messages
928
Helped
167
Reputation
340
Reaction score
168
Trophy points
1,323
Location
English
Activity points
5,825
As AudioGuru implies putting LEDs in parallel is a BAD idea unless they are perfectly matched.

But I would disagree with him, that the factory matches the Vf exactly. Usually they rely on the batch or lot having the same Vf. {so they are not always having exactly the same Vf}

Yours worked because the small batteries limited the current.

They will probably start to fail with a more substantial power supply,

If you insist, use a 7805 wired as constant current [ https://www.eleccircuit.com/7805-current-constant-for-battery-charger/ ] and vary the resistor R1 in the link between appropriate max current and min current.

Max current will likely by 23 * 20mA

Min current [low enough so the LEDs are barely on] could be 23 * 1 mA
 
Last edited:

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
As AudioGuru implies putting LEDs in parallel is a BAD idea unless they are perfectly matched.

But I would disagree with him, that the factory matches the Vf exactly. Usually they rely on the batch or lot having the same Vf. {so they are not always having exactly the same Vf}

Yours worked because the small batteries limited the current.

They will probably start to fail with a more substantial power supply,

If you insist, use a 7805 wired as constant current [ https://www.eleccircuit.com/7805-current-constant-for-battery-charger/ ] and vary the resistor R1 in the link between appropriate max current and min current.

Max current will likely by 23 * 20mA

Min current [low enough so the LEDs are barely on] could be 23 * 1 mA

I have conencted mine in a homemade lamp I have made as shown, using an external variable voltage PSU.
They can operate from 2.4 (dim) to 3.1v @ 400mA, above that they become quite hot to the touch so I do not want to push them further.

Now I am thinking of using this as a PSU https://www.hamburg-highend.de/LM317_Slow-Turn-On.htm
The slow turn on is a good feature for the lab.
I may be able to do a slow turn off as well if using a very gigh value electrolytic at the input of the regulator.
 

Attachments

  • DSC00105.JPG
    DSC00105.JPG
    37.9 KB · Views: 19

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,284
Helped
2,141
Reputation
4,276
Reaction score
1,968
Trophy points
1,393
Location
Toronto area of Canada
Activity points
58,417
To change the brightness of an LED you are supposed to change the current, not change the voltage fed to it.
The forward voltage of an LED decreases as it heats up. Then if you feed it a steady voltage its forward voltage drops which increases its current which makes it hotter which makes the current increase more which makes it hotter which makes the current increase more which makes it hotter which makes the current increase more which makes it hotter .... This is called "thermal runaway" and can destroy the LEDs.

Instead you feed it a variable current to change its brightness. A current source can simply be a resistor in series with the LED. When the resistor has some voltage across it then the current does not change much when the LED heats and its forward voltage drops. You want your paralleled 23 LEDs to have a maximum total current of 400mA so each one is about 400mA/23= 17.4mA (20mA is normal for a bright 5mm diameter LED). Then use a resistor that is about 1V/400mA= 2.5 ohms (use 2.7 ohms) rated at (400mA squared x 2.7 ohms x 2=) 1W.
Feed the series resistor and LEDs a variable voltage from 2V or 3V to 4.2V.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
To change the brightness of an LED you are supposed to change the current, not change the voltage fed to it.
The forward voltage of an LED decreases as it heats up. Then if you feed it a steady voltage its forward voltage drops which increases its current which makes it hotter which makes the current increase more which makes it hotter which makes the current increase more which makes it hotter which makes the current increase more which makes it hotter .... This is called "thermal runaway" and can destroy the LEDs.

Instead you feed it a variable current to change its brightness. A current source can simply be a resistor in series with the LED. When the resistor has some voltage across it then the current does not change much when the LED heats and its forward voltage drops. You want your paralleled 23 LEDs to have a maximum total current of 400mA so each one is about 400mA/23= 17.4mA (20mA is normal for a bright 5mm diameter LED). Then use a resistor that is about 1V/400mA= 2.5 ohms (use 2.7 ohms) rated at (400mA squared x 2.7 ohms x 2=) 1W.
Feed the series resistor and LEDs a variable voltage from 2V or 3V to 4.2V.

Thank you, this has been very helpful!
So basically I can use this circuit https://www.hamburg-highend.de/LM317_Slow-Turn-On.htm with a series resistor at the output as you say?
I think that the LM317 can be used as a current source as well, see page 12 of this datasheet https://www.ti.com/lit/ds/symlink/lm317.pdf
But I do not know is slow start up (a desirable feature) could be applied to it.

Another idea would be to use two lm317 in series, the first as a voltage adjust and the second as a current limiter?
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,284
Helped
2,141
Reputation
4,276
Reaction score
1,968
Trophy points
1,393
Location
Toronto area of Canada
Activity points
58,417
You do not want an LM317 current limiter because a simple resistor in series with the LEDs limits the current and converts changing the voltage into changing the current.
The circuit you found uses a 2k ohms trimpot. Then when the trimpot is set to halfway the output voltage from the circuit is 6.9V. Turn it down so the voltage is about 4.2V for maximum brightness when the series resistor is 2.7 ohms.

The slow turn on circuit will not immediately light the LEDs dimly but instead the LEDs will not turn on until the voltage has risen to about 2.4V, a long delay time. You probably want the LEDs to immediately light dimly then slowly get brighter. Then the transistor in the circuit must be part of a voltage divider so that the output voltage starts at about 2.4V. Add a 220 ohms or 270 ohms resistor in series with its collector.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
You do not want an LM317 current limiter because a simple resistor in series with the LEDs limits the current and converts changing the voltage into changing the current.
The circuit you found uses a 2k ohms trimpot. Then when the trimpot is set to halfway the output voltage from the circuit is 6.9V. Turn it down so the voltage is about 4.2V for maximum brightness when the series resistor is 2.7 ohms.

The slow turn on circuit will not immediately light the LEDs dimly but instead the LEDs will not turn on until the voltage has risen to about 2.4V, a long delay time. You probably want the LEDs to immediately light dimly then slowly get brighter. Then the transistor in the circuit must be part of a voltage divider so that the output voltage starts at about 2.4V. Add a 220 ohms or 270 ohms resistor in series with its collector.

Thank you very much!
I will try these points and let you know.
 

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
You do not want an LM317 current limiter because a simple resistor in series with the LEDs limits the current and converts changing the voltage into changing the current.
The circuit you found uses a 2k ohms trimpot. Then when the trimpot is set to halfway the output voltage from the circuit is 6.9V. Turn it down so the voltage is about 4.2V for maximum brightness when the series resistor is 2.7 ohms.

The slow turn on circuit will not immediately light the LEDs dimly but instead the LEDs will not turn on until the voltage has risen to about 2.4V, a long delay time. You probably want the LEDs to immediately light dimly then slowly get brighter. Then the transistor in the circuit must be part of a voltage divider so that the output voltage starts at about 2.4V. Add a 220 ohms or 270 ohms resistor in series with its collector.

Just to let you know, I have tested a 20R 25W wire wound resistor before the LEDs. This gives a nice smooth light variation from about 2.4v to 12v. At 12v the TOTAL consumption (inc resistor) is 440mA and the LEDs operate as if they were operating at 3.1v, same light and heat.

I like the fact that now I can use 12v without series LEDS (I do not like series leds, because if one fails, the lamp fail) and that I can vary the brightness in a smooth way.

I used 25W resistor only in order not to get significant amount of heat out of it.

I may now use the LM317 circuit with the changes you proposed to see if it can me smoothly start and also variable brightness.
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,284
Helped
2,141
Reputation
4,276
Reaction score
1,968
Trophy points
1,393
Location
Toronto area of Canada
Activity points
58,417
Your resistor value and voltage are so high that your circuit wastes a lot of power making heat.
The resistor heats with (0.44A squared x 20 ohms=) 3.9W. But if you use 2.7 ohms then it heats with only (0.44A squared x 2.7 ohms=) 0.52W.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
Your resistor value and voltage are so high that your circuit wastes a lot of power making heat.
The resistor heats with (0.44A squared x 20 ohms=) 3.9W. But if you use 2.7 ohms then it heats with only (0.44A squared x 2.7 ohms=) 0.52W.

But then I could not apply 12v to the leds right? So the brightness adjustment would be narrow.
Not a requirement, but it is goot to have it.
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,284
Helped
2,141
Reputation
4,276
Reaction score
1,968
Trophy points
1,393
Location
Toronto area of Canada
Activity points
58,417
You are not applying 12V to the LEDs. Instead you are applying 12V to the 20 ohm resistor in series with the LEDs so that the maximum current is 440mA.
If you use a 2.7 ohm resistor in series with the LEDs and feed it enough voltage that the current is 440mA then the LEDs will be exactly as bright as when you used 20 ohms making a lot of heat and 12V.

The voltage across the 2.7 ohm resistor is calculated with Ohm's Law: V= 440mA x 2.7 ohms= 1.188V. The maximum (brightest LEDs) output of the LM317 will be the LED voltage (3.1V) plus this 1.188V= 4.288V. For the dimmest LEDs you want the output of the LM317 to be about 2.4V so the resistor in series with the voltage-control pot should be 200 ohms. For the brightest LEDs the output of the LM317 should be 4.288V so the pot should have across it (4.288V - 1.25V=) 3.04V. If you use a pot with a total resistance of (1070 ohms - 200 ohms=) 870 ohms (use a 1k ohm pot) then you will have plenty of adjustment range.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating

neazoi

Advanced Member level 5
Joined
Jan 5, 2008
Messages
3,842
Helped
13
Reputation
26
Reaction score
10
Trophy points
1,318
Location
Greece
Activity points
34,831
You are not applying 12V to the LEDs. Instead you are applying 12V to the 20 ohm resistor in series with the LEDs so that the maximum current is 440mA.
If you use a 2.7 ohm resistor in series with the LEDs and feed it enough voltage that the current is 440mA then the LEDs will be exactly as bright as when you used 20 ohms making a lot of heat and 12V.

The voltage across the 2.7 ohm resistor is calculated with Ohm's Law: V= 440mA x 2.7 ohms= 1.188V. The maximum (brightest LEDs) output of the LM317 will be the LED voltage (3.1V) plus this 1.188V= 4.288V. For the dimmest LEDs you want the output of the LM317 to be about 2.4V so the resistor in series with the voltage-control pot should be 200 ohms. For the brightest LEDs the output of the LM317 should be 4.288V so the pot should have across it (4.288V - 1.25V=) 3.04V. If you use a pot with a total resistance of (1070 ohms - 200 ohms=) 870 ohms (use a 1k ohm pot) then you will have plenty of adjustment range.

Thank you very much audioguru.
Just a final question, if I do it like you say and feed the regulator with a 12v input, the regulator will also be headed up too much wouldn't it?
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,284
Helped
2,141
Reputation
4,276
Reaction score
1,968
Trophy points
1,393
Location
Toronto area of Canada
Activity points
58,417
if I do it like you say and feed the regulator with a 12v input, the regulator will also be headed up too much wouldn't it?
Does "headed up" mean heating up?
Can't you simply calculate the heating power? (12V - 4.288V) x 440mA= 3.4W and a medium size heatsink is needed. The minimum input to the LM317 can be 4.288V + 1.8V= 6.088V and the heating will be 1.8V x 440mA= 0.8W and if you use the TO-220 package and the LM317 is not enclosed then no heatsink is needed. I would use a 6VDC/500mA wall-wart then the LM317 does not need a heatsink.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top