+ Post New Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 20 of 52
  1. #1
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    LED driver LM317 schematic

    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.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!

  2. #2
    Full Member level 4
    Points: 1,901, Level: 10
    xenos's Avatar
    Join Date
    May 2015
    Location
    127.0.0.1
    Posts
    212
    Helped
    82 / 82
    Points
    1,901
    Level
    10

    Re: LED driver LM317 schematic

    Use lm317 as a constant current source for max current and add potensiometer or pwm to control brightness


    1 members found this post helpful.

  3. #3
    Advanced Member level 5
    Points: 34,790, Level: 45
    Achievements:
    7 years registered Created Blog entry Created Album pictures
    SunnySkyguy's Avatar
    Join Date
    Sep 2007
    Location
    Richmond Hill, ON, Canada
    Posts
    6,702
    Helped
    1672 / 1672
    Points
    34,790
    Level
    45
    Blog Entries
    7

    Re: LED driver LM317 schematic

    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/entry1946.html
    A good design question lists your overall requirements™ The best question deserves a better answer. ™
    ... Tony Stewart EE since 1975



  4. #4
    Super Moderator
    Points: 77,368, Level: 67
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    12,663
    Helped
    4222 / 4222
    Points
    77,368
    Level
    67

    Re: LED driver LM317 schematic

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  5. #5
    Advanced Member level 5
    Points: 49,585, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,629
    Helped
    2010 / 2010
    Points
    49,585
    Level
    54

    Re: LED driver LM317 schematic

    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.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  6. #6
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    Re: LED driver LM317 schematic

    Quote Originally Posted by Audioguru View Post
    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
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



    •   AltAdvertisment

        
       

  7. #7
    Advanced Member level 5
    Points: 49,585, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,629
    Helped
    2010 / 2010
    Points
    49,585
    Level
    54

    Re: LED driver LM317 schematic

    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.



    •   AltAdvertisment

        
       

  8. #8
    Advanced Member level 5
    Points: 34,790, Level: 45
    Achievements:
    7 years registered Created Blog entry Created Album pictures
    SunnySkyguy's Avatar
    Join Date
    Sep 2007
    Location
    Richmond Hill, ON, Canada
    Posts
    6,702
    Helped
    1672 / 1672
    Points
    34,790
    Level
    45
    Blog Entries
    7

    Re: LED driver LM317 schematic

    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.
    A good design question lists your overall requirements™ The best question deserves a better answer. ™
    ... Tony Stewart EE since 1975



  9. #9
    Advanced Member level 3
    Points: 5,107, Level: 16
    kam1787's Avatar
    Join Date
    Jul 2010
    Location
    English
    Posts
    928
    Helped
    169 / 169
    Points
    5,107
    Level
    16

    Re: LED driver LM317 schematic

    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 [ http://www.eleccircuit.com/7805-curr...ttery-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 by kam1787; 6th July 2015 at 06:25.



  10. #10
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    Re: LED driver LM317 schematic

    Quote Originally Posted by kam1787 View Post
    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 [ http://www.eleccircuit.com/7805-curr...ttery-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 http://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.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  11. #11
    Advanced Member level 5
    Points: 49,585, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,629
    Helped
    2010 / 2010
    Points
    49,585
    Level
    54

    Re: LED driver LM317 schematic

    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.


    1 members found this post helpful.

  12. #12
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    Re: LED driver LM317 schematic

    Quote Originally Posted by Audioguru View Post
    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 http://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 http://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?
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  13. #13
    Advanced Member level 5
    Points: 49,585, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,629
    Helped
    2010 / 2010
    Points
    49,585
    Level
    54

    Re: LED driver LM317 schematic

    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.


    1 members found this post helpful.

  14. #14
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    Re: LED driver LM317 schematic

    Quote Originally Posted by Audioguru View Post
    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.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  15. #15
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    Re: LED driver LM317 schematic

    Quote Originally Posted by Audioguru View Post
    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.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  16. #16
    Advanced Member level 5
    Points: 49,585, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,629
    Helped
    2010 / 2010
    Points
    49,585
    Level
    54

    Re: LED driver LM317 schematic

    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.


    1 members found this post helpful.

  17. #17
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    Re: LED driver LM317 schematic

    Quote Originally Posted by Audioguru View Post
    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.
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  18. #18
    Advanced Member level 5
    Points: 49,585, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,629
    Helped
    2010 / 2010
    Points
    49,585
    Level
    54

    Re: LED driver LM317 schematic

    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.


    1 members found this post helpful.

  19. #19
    Advanced Member level 5
    Points: 15,984, Level: 30
    Achievements:
    7 years registered
    neazoi's Avatar
    Join Date
    Jan 2008
    Location
    Greece
    Posts
    3,240
    Helped
    12 / 12
    Points
    15,984
    Level
    30

    Re: LED driver LM317 schematic

    Quote Originally Posted by Audioguru View Post
    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?
    Professional engineering is the top, but amateur engineering is more fun.
    It is when you cross the barrier between these two, that things become really fascinating!



  20. #20
    Advanced Member level 5
    Points: 49,585, Level: 54
    Achievements:
    7 years registered
    Audioguru's Avatar
    Join Date
    Jan 2008
    Location
    Toronto area of Canada
    Posts
    8,629
    Helped
    2010 / 2010
    Points
    49,585
    Level
    54

    Re: LED driver LM317 schematic

    Quote Originally Posted by neazoi View Post
    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.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

--[[ ]]--