Continue to Site

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

Thanks a lot!
 

Next time do all in series and 8x bigger area direct contact to Copper.

You can buy boards from here http://www.sinkpad.com/

Use my method for estimating Vf on LEDs
ESR= 1/W rating thus 1W is 1Ohm 3W is 1.3 Ohm
Series LEDs add ESR
Parallel LEDs divide ESR

Series current limiter, include above in Ohm's Law for drop between source and load

A power N ch FET on low side can also regulate current
 

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.

Ok, here are the modifications to the circuit based on your points, please correct me if something does not seem right. Time for a bit of soldering...
I was wondering, if I want the circuit not only to have a slow start up but also a slow shut down, what should I do? Is it enough to replace the 470uF input capacitor with a larger one, say 2200uF, so that when power is shutdown, this capacitor slowly discharges and so the output voltage (and the brightness of the LEDs) gradually decrease?
Or is it better to increase instead the 100uF output capacitor?
 

Attachments

  • lm317t_so.jpg
    lm317t_so.jpg
    47 KB · Views: 79
Last edited:

The minimum voltage will be about 2.5V and the maximum will be about 8.1V. When the trimpot is near halfway the output will be about 5.2V.
Try using a HUGE capacitor (4700uF or more) to replace the 100uF output capacitor to power the LEDs and slowly fade them when the power is turned off.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
The minimum voltage will be about 2.5V and the maximum will be about 8.1V. When the trimpot is near halfway the output will be about 5.2V.
So I'd better use a smaller value pot in order not to exceed 4.28v? say 500R?
 

So I'd better use a smaller value pot in order not to exceed 4.28v? say 500R?
Are you using a pot as a dimmer control?
The datasheet for the LM317 shows that the 220 ohm resistor from its output to its ADJ pin has 1.25V across it then its current can be multiplied with the value of the pot (is 500 ohms available or is 470 ohms?) to calculate the voltage across the pot. Then simply add the two voltages to find the output voltage.
With a 500 ohms pot the max output voltage will be 5.2V (but the pot might actually be 20% high at 600 ohms) so the output voltage will be much too high at 5.8V.
If the pot is 470 ohms then the output voltage is still too high at 5.1V or even higher if the 470 ohms is 20% high at actually 490 ohms.

If a 330 ohm pot is available then the max output will be from 3.9V to 4.6V. It is too bad that pots with an accurate total resistance are not available.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
If a 330 ohm pot is available then the max output will be from 3.9V to 4.6V. It is too bad that pots with an accurate total resistance are not available.

Yes I am using the pot as a dimmer control and the transistor as a soft start on control, at least that is what I am trying to do.
Ok I got it, basically I will experiment with the pot value.
 

Are you using a pot as a dimmer control?
The datasheet for the LM317 shows that the 220 ohm resistor from its output to its ADJ pin has 1.25V across it then its current can be multiplied with the value of the pot (is 500 ohms available or is 470 ohms?) to calculate the voltage across the pot. Then simply add the two voltages to find the output voltage.
With a 500 ohms pot the max output voltage will be 5.2V (but the pot might actually be 20% high at 600 ohms) so the output voltage will be much too high at 5.8V.
If the pot is 470 ohms then the output voltage is still too high at 5.1V or even higher if the 470 ohms is 20% high at actually 490 ohms.

If a 330 ohm pot is available then the max output will be from 3.9V to 4.6V. It is too bad that pots with an accurate total resistance are not available.

Maybe I could use a simpler LM317 circuit in conjunction with this one http://www.next.gr/audio/stereo-circuits/in-car-lights-delay-circuit-l11714.html
Accordingly to the article this allows slow turn on and off of the lamp (intented for car use).
If it works (not tested yet) it is good because it does not require a huge capacitor.
 
Last edited:

Thats because it relies on the high input resistance of the FET to stop the capacitor discharging. During the transition from fully off to fully on, the FET dissipates all the excess power though. I've lost track of where you are up to in this project so I'm not sure what supply voltage you are now proposing but bear in mind the you want to drive the MOSFET into full conduction and if you can't lift the gate voltage high enough it will get hot!

Go for PWM, it's simpler, more efficient and easier to control the light level.

Brian.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
The circuit with the Mosfet has a huge delay time because when the capacitor begins to charge then the Mosfet is completely turned off. Then the Mosfet does not begin to turn on (producing very dim LEDs) until the capacitor has charged to the threshold voltage of the Mosfet which might be a long time after the switch was turned on.
The same thing happens when you turn off the switch then the Mosfet is completely turned on and there is a huge delay until the capacitor has discharged enough for the Mosfet to begin turning off.

I have a light that uses a microcontroller using PWM to dim and brighten LEDs. But the ramping obviously has digital steps and is not smooth. If it had many more steps then it would look smoother.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
I just "threw together" a PWM control for you. It took 7 components and had 'fast or slow' control. Fast followed the pot immediately, slow made it take about 5 seconds to go from minimum to maximum. It had an on/off control which went from zero (off) to full (whatever the pot was set to) working in fast and slow modes as well.

I hooked it up to a 6V 0.5A lamp as I had no LEDs to hand and it worked perfectly. No 'power' components were used at all and it ran cold. Then it all went wrong! I grabbed my camera to shoot a short video and one side of the 8-pin IC I used popped out of the proto-board. Only the Chinese could produce spring contact proto-boards where the depth of the springs under the surface is the same as the length of a standard DIL IC pin. The springs *just* grip the tips of the pins - until you accidentaly knock it with the camera and the chip gets launched. To cut a longs story short, the IC is now dead, destroyed when it's ground pin was disconnected so I can't show a demo. A still picture will have to do.
The two resistors at the bottom would in real life go to switches, one is on/off, the other fast/slow, in the prototype I just swapped them from ground to supply.

Brian.
 

Attachments

  • 20150709_160753a.jpg
    20150709_160753a.jpg
    44.6 KB · Views: 72
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Hee, hee. Aren't proto-boards fun!
I used a proto-board only one time in my entire career and hobby. NEVER AGAIN! Nothing but trouble.

The datasheet of the LM555 shows how to use it for PWM by varying the voltage at pin 5. I do not know how much range it has.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
That was an evil laugh :x

I do have some good proto-boards but they are all packed away, this particular one is a different design and is, in very un-eco friendly fashion, going to be used as landfill!

Pin 5 of the NE555 controls the oscillator current and hence the frequency, it is possible to alter the mark/space ratio of the 555 by controlling the capacitor charge and discharge path resistances but not over zero to full range.

Brian.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
I just "threw together" a PWM control for you. It took 7 components and had 'fast or slow' control. Fast followed the pot immediately, slow made it take about 5 seconds to go from minimum to maximum. It had an on/off control which went from zero (off) to full (whatever the pot was set to) working in fast and slow modes as well.

I hooked it up to a 6V 0.5A lamp as I had no LEDs to hand and it worked perfectly. No 'power' components were used at all and it ran cold. Then it all went wrong! I grabbed my camera to shoot a short video and one side of the 8-pin IC I used popped out of the proto-board. Only the Chinese could produce spring contact proto-boards where the depth of the springs under the surface is the same as the length of a standard DIL IC pin. The springs *just* grip the tips of the pins - until you accidentaly knock it with the camera and the chip gets launched. To cut a longs story short, the IC is now dead, destroyed when it's ground pin was disconnected so I can't show a demo. A still picture will have to do.
The two resistors at the bottom would in real life go to switches, one is on/off, the other fast/slow, in the prototype I just swapped them from ground to supply.

Brian.

I am a liitle bit considered about pwm. how does it actually work? I believe it continuously sends pulses to the lamp. It reminds me a bit the strobe technique used on the 7-segment displays. if the lamp is an incandescent, it really dims and stays on because of it's slow response. However, if it is LED, you rely on the eye reminance to "see" the led as continuously glowing. Unless there is a capacitor at the output that is charged by the pwm and then this drives the leds with dc, similar to the varicap drivers.
There are two things I do not like about pwm.
The first relates to the above point. This may be a bit crazy, but there might be health issues in some people about continuously turn on/off a light. The CRT works that way and it got some people nervous after a few hours of watching TV. Although TV content itself causes your head to burn out if you watch too much, not to mention the advertising :)
The second thing is more serious and relates to RF interference. In a desk bench, where distances from one component to the other are close, RFI can be easily picked up by any component. Once, I had a hard time trying to remove the RFI from switched mode jack walls from getting in the oscilloscope and affect readings.
So why not use pure dc where we can? Why another source of RFI close to you, when it can be avoided?

If a configurable slow turn on/off is needed a micro with a DA or an external DA ladder, driving the base of a bjt could do the trick just right and not using pwm at all. Ok this would be more complex than the simple lm317 solution.

Yesterday I build this (attached) and it worked very favourable for slow turn off the leds. The input voltage was 5v and the supercap ensures the size of the circuit to be small. The 120R ensures the supercap is discharged all the way down to 0v after a while and it does not affect the max light intensity too much.
I am just curious it a thermistor or varistor could be added somehow to ensure slow turn on. I think of two ways, a voltage divider, with one of the elements to be a thermistor, or an inrush current limiter using a single thermistor.
It would be fun to see how this could be done without any semiconductors :)
 

Attachments

  • Untitled.png
    Untitled.png
    1.9 KB · Views: 66
Last edited:

You are right about how PWM works but typically the frequency used for LEDs is in the range of around 500Hz to 5KHz which is at least of ten times faster than TV and computer monitors work. The idea is that our perception of brightness is based upon both the real intensity of the light and how long it lasts for. Additionally, there is a slight 'afterglow' of the phosphor in high brightness LEDS that evens out the peaks and troughs of the light a little.

PWM drives the LED at full power continuously to get full brightness and to reduce the brightness it pulses the current rapidly. The frequency is usually constant but the duration it is on vs. off is changed within each cycle. For example, at 1KHz the cycle length is 1/1000 second = 1mS = 1000uS, if it was on for 500uS and off for 500uS it would give the appearance of half brightness while still pulsing at 1KHz. To get 25% brightness, it would be on for 250uS and off for 750uS and so on.

You can 'even out' the pulses by placing a capacitor across the load, it will assume the average voltage of the PWM ratio and this is exactly how many analog control voltages are generated by digital circuits. For driving a load like LEDs it isn't usually necessary to use a capacitor though.

The magic of it is that you can in theory do it without any power loss in the control circuit. In an analog regulator you balance the power to the LEDs against heat loss in the regulator, in PWM the only heat is caused by residual resistances and the small currents charging and discharging the component capacitances. It works like this, I'm using 50% brightness and 10V / 1A for the LEDs as the example:

Analog: start with enough voltage overhead for the regulator, say 3V so your supply has to be at least 13V. The LEDs need 10V and say 500mA for half brightness so the regulator continuously dissipates (13 - 10) * 0.5 = 1.5W. This varies according the current of course.

PWM: the current is switched via a transistor, MOSFETs are ideal but you can use bipolar. I'm going to assume a MOSFET with Rds = 0.2 Ohms. During the off part of the cycle, the current is zero so it dissipates (13 - 10) * 0 = 0W. During the on part it dissipates (W = I squared R) 0.25 * 0.2 = 0.05W so the average over one cycle is 0.1/2 = 25mW. That's 60 times less power loss!

If you used a bipolar transistor as the switch, say a 2N2222 with VCEsat of 1V at 0.5A the dissipation would be (V*I) = 1 * 0.5 = 0.5W averaging 0.25W so it would still be 6 times more efficient. A transistor with lower VCEsat would obvioulsy work better.

In a perfect system, where the switch transistor was a perfect insulator or conductor, the power would alternate between V * 0 = 0W and I * 0 = 0W so the only loss would be the brief period as it changed from one state to the other.

Brian.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
You are right about how PWM works but typically the frequency used for LEDs is in the range of around 500Hz to 5KHz which is at least of ten times faster than TV and computer monitors work. The idea is that our perception of brightness is based upon both the real intensity of the light and how long it lasts for. Additionally, there is a slight 'afterglow' of the phosphor in high brightness LEDS that evens out the peaks and troughs of the light a little.

PWM drives the LED at full power continuously to get full brightness and to reduce the brightness it pulses the current rapidly. The frequency is usually constant but the duration it is on vs. off is changed within each cycle. For example, at 1KHz the cycle length is 1/1000 second = 1mS = 1000uS, if it was on for 500uS and off for 500uS it would give the appearance of half brightness while still pulsing at 1KHz. To get 25% brightness, it would be on for 250uS and off for 750uS and so on.

You can 'even out' the pulses by placing a capacitor across the load, it will assume the average voltage of the PWM ratio and this is exactly how many analog control voltages are generated by digital circuits. For driving a load like LEDs it isn't usually necessary to use a capacitor though.

The magic of it is that you can in theory do it without any power loss in the control circuit. In an analog regulator you balance the power to the LEDs against heat loss in the regulator, in PWM the only heat is caused by residual resistances and the small currents charging and discharging the component capacitances. It works like this, I'm using 50% brightness and 10V / 1A for the LEDs as the example:

Analog: start with enough voltage overhead for the regulator, say 3V so your supply has to be at least 13V. The LEDs need 10V and say 500mA for half brightness so the regulator continuously dissipates (13 - 10) * 0.5 = 1.5W. This varies according the current of course.

PWM: the current is switched via a transistor, MOSFETs are ideal but you can use bipolar. I'm going to assume a MOSFET with Rds = 0.2 Ohms. During the off part of the cycle, the current is zero so it dissipates (13 - 10) * 0 = 0W. During the on part it dissipates (W = I squared R) 0.25 * 0.2 = 0.05W so the average over one cycle is 0.1/2 = 25mW. That's 60 times less power loss!

If you used a bipolar transistor as the switch, say a 2N2222 with VCEsat of 1V at 0.5A the dissipation would be (V*I) = 1 * 0.5 = 0.5W averaging 0.25W so it would still be 6 times more efficient. A transistor with lower VCEsat would obvioulsy work better.

In a perfect system, where the switch transistor was a perfect insulator or conductor, the power would alternate between V * 0 = 0W and I * 0 = 0W so the only loss would be the brief period as it changed from one state to the other.

Brian.

Hm... this huge power efficiency and ultra low heating, is indeed a great advantage.
I can see the circuit in your breadboard, but It would help if I can have a schematic of it to try it at the weekend.
Have you used a bjt or a fet for this?
Have you managed to slowly start up and switch off the lamp with this circuit?

There are so many things one can learn in this thread!
 

I have to leave in a few moments but I will post a schematic later. It's a PIC12F683 and I used a small MOSFET (2SK2989) but it would work with many other types.
The PIC has an ADC which I used to read the voltage from the pot and the two 24K resistors (any value or even links would do) were connected to ground or +5V. One was an on/off switch, the other set the ramp up/down speed. It would be possible to use a second pot to set the speed if you wanted to. In slow mode, when switched on, the light took about 5 seconds to reach set brightness and about 5 seconds to dim down again when switched off. In fast mode it was immediate.

Brian.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Yes that would be helpful, thank you.

Just for reference, I have found this https://electronics.stackexchange.com/questions/68223/transistor-delay Look at the second schematic with the single transistor.
Not PWM of course but it seems that it does the job just right and look at the simplicity. The components need to be scaled for different times and led current. I suppose a single pot could serve as a btrightness set when the lamp operates. In that case, where shall one put this pot, at the transistor base or at the emitter? (pot power constraint)

I also would like the led ground to be connected at the ground point (body of the lamp, so I will probably try connecting the collector directly to vcc and put the resistor/led on the emitter side, I hope this will be ok.
 

When an LED or string of LEDs are driven with PWM, something still needs to be used to limit the peak current. That "something" (a resistor?) will waste some amount of power by getting hot.
Please do not think that reducing the current or its on/off ratio in PWM in an LED to half results in half brightness. Our vision's sensitivity to brightness is logarithmic (so we can see in moonlight and in sunlight) not linear so maybe 1/10th the current looks half as bright. I am not talking about the automatic brightness control created by our iris that operates to slowly to be affected by PWM.

The extremely simple single transistor fader circuit can have the transistor at the emitter, but not more than maybe two LEDs in series. For the an LED to be grounded then use a PNP transistor with the LED and its resistor connected to its emitter and ground and change all the polarities.
A brightness control would use another transistor to vary the supply voltage to the circuit. This transistor can have the circuit at its emitter and the brightness pot at its base as a voltage divider.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
For the an LED to be grounded then use a PNP transistor with the LED and its resistor connected to its emitter and ground and change all the polarities.

Can you please post a schematic on this? I would appreciate.
You can use the online sckematic editor https://www.circuitlab.com/ or mine at **broken link removed** if you have not got one installed in your pc. Then print screen the image.
Thank you
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top