Powered by Invision Power Board


Forum Rules Forum Rules (Please read before posting)
  Reply to this topicStart new topicStart Poll

> Led Drivers
millwood
Posted: August 11, 2009 12:50 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




I often saw people asking about how to drive LEDs so I thought I would put together a small collection of LED drivers I have tried.

the simplest LED driver is a linear LED driver. It is usually done with a BJT as a switch and controlled by a mcu (3.3v to 5v typical), as see below.

user posted image

two design considerations:

1) the current drain on the mcu: most MCUs can output 2ma from their GPIO pins, some can go as high as possible. LEDs are typically around 20 - 30ma with some much higher (350-700ma for example). so you want to make sure that when the mcu goes high, the switcher doesn't drain too much current out of the mcu.

the current drain out of the MCU is limited by the base resistor R2.

Vin=Iin*R2+Vbe, where Vbe is the voltage drop off the b-e junction of the switcher, typically 0.7v for a singleton, 1.3v for a darlington, and around 2v for a logic level mosfet (4v for a regular mosfet).

Vin depends on the MCU's power supply but it is usually 3.3v - 5v. so R2=1k means a base current of (3.3v-0.6v)/1k=2ma, give or take a little.

2) the current going through the LED, If: when the switcher is on / saturated, the current going through the LED is determined by

Vcc=If*R1+Vf+Vce(sat).

Vf needs to be checked out of your LED's datasheet, usually 2v - 3.5v. Vce(sat) from your switcher's datasheet but typically 0.1 - 0.5v. so for high Vcc, the current going through the led is roughly If=(Vcc-Vf)/R1. in this case, it is about 200ma for R1=110ohm.

the minimum better requirement for the switcher at these current levels is If/Iin=100. you will need to check the datasheet to make sure that that works.

This circuit has the advantage of being very simple: a switcher, and two resistors. it works reliably and the switcher dissipates very little heat: when the LED is on, the switcher dissipates only Vce(sat)*If, and since Vce(sat) is very small, not much heat is dissipated.

the circuit also has two distinct issues:

1) it requires a power resistor in R1. the power dissipation over R1 is roughly (Vcc-Vf)*If, and in this case, it is about 20v*200ma=4w when the LED is on. it will be difficult to find power resistors matching the resistance and power requirement, and tough to heatsink those resistors.

2) the current going through the LED depends on Vcc, or Vf. so if you want to run the driver at different Vcc, or you want to string in more LEDs or use different LEDs with different Vf, you will need to recalculate R1. or you risk ruining your LEDs. a pain in the rear.

PMEmail Poster
Top
millwood
Posted: August 11, 2009 01:05 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




one way to address those issues is to create a driver that sinks constant current, regardless of supply rail and the number of LEDs to be driven. that can be done by adding one more small signal transistor, as see below.

user posted image

the circuit works like this: when Vin goes up, Q2 begins to conduct, and If goes up and builds up a voltage over R3. As that voltage, If*R3 approaches Q3's Vbe, Q3 is turned on and it diverts current from Q2's base, in order to maintain a constant current.

so Vbe=If*R3 will determine the on-current going through the LED, regardless of the number of LEDs used or the rail voltage.

in this case, If=0.7v/3.3=200ma, give or take a few.

the advantage of this circuit is a) its flexibility: you can use the same circuit to drive as many LEDs (limited by their cumulative Vf and Vcc), or to run the driver at any rail voltage you wish.

the driver also delivers the same amount of current through the LEDs even when their Vf goes down as the LEDs heat up. that will help prolong the leds' life.

it does not use a power resistor but you will need to heatsink Q2. thankfully heatsinking power transistors is much easier than heatsink power resistors, smile.gif
PMEmail Poster
Top
millwood
Posted: August 11, 2009 01:09 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




both circuits suffer from one serious issue: inefficiency. large amount of energy is wasted by the resistor or the transistor.

this can be a real issue if you are designing for high powered LEDs or lots of LEDs in close proximity to each other.

so a better way is to run those drivers digitally.

one way to do it is to use PWM drivers.

PMEmail Poster
Top
millwood
Posted: August 11, 2009 01:34 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




there are two basic topologies for pwm led drivers: boost / step-up or buck / step-down.

they all follow one basic feedback mechanism: those chips work to generate one constant voltage on its feedback pin. the levels of that voltage may change from chip to chip, but that basic principle always holds.

so by using a resistor from the feedback pin, you essentially gain the ability to program the current going through the LEDs -> a constant current LED driver.

in a step-up configuration, the output voltage has to exceed the input voltage to the driver so it allows you to drive many leds in serial.

in a step-down configuration, the output voltage cannot exceed the input voltage so it allows you to drive a limited number of LEDs.

here is an example of a boost CCS LED driver.

user posted image

the mc34063 is a pwm controller that has a built-in 1.5a 40v switch, and maintains a 1.25v feedback voltage on its CINV (comparator inverting) pin. so the current going through R10, thus the LED string, would be 1.25v/R10 = 40ma.

so the chip will generate whatever voltage required to produce a 1.25v voltage drop on R10.

in this particular example, the power source is a 10v +/- 2v rectified DC, and the output voltage is about 20v, and the current going through the LEDs is just shy of 40ma.

we are using an external switch in order to be able to run at higher current levels.

PMEmail Poster
Top
millwood
Posted: August 11, 2009 04:08 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




obviously, you don't have to have an external switcher if you aren't running the circuit at high current levels.

and you can add bells and whistles to the circuit.

for example, here is an example of digital dimming / intensity control.

user posted image

the Vdim pin comes from a mcu, a pwm signal. the signal goes through a low pass filter formed by R5/C3 to form an analog signal, which's amplitude is proportional to the duty cycle of the pwm signal. that analog signal then is summed up with the feedback signal and then applied to the CINV pin, thus allows you the ability to control the output of the LEDs digitally.

Obviously, replace R5/C3/Vdim with a pot connected to Vcc and it will work as well.

PMEmail Poster
Top
millwood
Posted: August 11, 2009 04:10 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




the same principles apply to other pwm chips and you can utilize it to form CCS drivers for your LEDs.

I have one built around KA3843 / UC3843, a pwm controller used in many computer power supplies.
PMEmail Poster
Top
millwood
Posted: August 11, 2009 04:19 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




the same thing can be done with a 555 timer, as seen below.

user posted image

in this case, the current through the LEDs can be programmed by R1: Iled = 700mv / R1.

the feedback is applied to the CV pin. But you can also apply it to the RESET pin, making it a gated oscillator.

you also can ignore the external switcher, for low current applications.

PMEmail Poster
Top
millwood
Posted: August 13, 2009 03:32 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




here is an example of a CCS LED driver using a step-up topology.

it is built around ncp3065, which is identical to mc34063, except the voltage on the feedback pin. This particular one uses internal 1.5a switch and runs at around 20ma.

user posted image

it works down to 4 nicad battery (approximately 5v).
PMEmail Poster
Top
millwood
Posted: August 13, 2009 03:35 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




here is a real driver based on 555. The chip in use is 556 (dual version of 555) built by Fairchild (KA556). the right side is the LED driver. the external switcher is a fairchild FDP3672. the small signal transistor used for error amplification is a 2n5551. the output can drive 10 LEDs (about 20v) using a voltage source down to 4.5v. the programmed current is 17ma, regardless of how many LEDs are driven.


user posted image
PMEmail Poster
Top
millwood
Posted: August 13, 2009 03:38 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




the left side of the ka556 is a pwm controller. it uses a irf540 as a switcher, and its duty cycle is controlled by a pot.
PMEmail Poster
Top
Sch3mat1c
Posted: August 14, 2009 06:11 am
Reply to this postQuote Post


Forum Addict ++
Group Icon

Group: Moderators
Posts: 19,467
Member No.: 73
Joined: July 24, 2002




You're using awfully large toroids. Is that because they're just what you have on hand, or is it to save turns, or what? Ungapped black ferrites don't store much energy.

Similarly, the transformer used in this inverter,
http://webpages.charter.net/dawill/tmoranw...c_Pulse1_lg.jpg
is black ferrite only out of laziness.

Tim


--------------------
Answering questions is a tricky subject to practice. Not due to the difficulty of formulating or locating answers, but due to the human inability of asking the right questions; a skill that, were one to possess, would put them in the "answering" category.
PMEmail PosterUsers Website
Top
millwood
Posted: August 14, 2009 02:46 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




a reader suggested that we talk about voltage regulator based LED drivers because of their simplicity.

Here is one such an example, using a LM317 and a 7805 - other (linear) VRs work similarly.

user posted image

linear voltage regulators work by holding its Adj. pin below its output pin by a certain amount, Vf. for LM317, Vf=1.25v. so the current going through the LED and the resistor R1 is If=Vf/R1=1.25v/10=125ma, regardless of supply voltage Vin (in this case, it swings from 19v - 21v). the power dissipation on R1 is Vf^2/R1=1.25^2/10<0.2w.

if you use a 7805, Vf=5v, and If=Vf/R2=5v/47ohm=110ma, and the power dissipation on r2 is Vf^2/R2=5^2/47=0.5w.

you can also use 7809 or 7812, except that you will need resistors rated at higher power.

PMEmail Poster
Top
millwood
Posted: August 14, 2009 02:47 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




a simplier way, to me anyway, for the above is to connect the LEDs on the output, like the following. the analysis is the same.

user posted image
PMEmail Poster
Top
millwood
Posted: August 14, 2009 02:51 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




if you don't have access to a voltage regulator but only transistors, you can also make similar arrangement. remember that a BJT transistor is very much like a voltage regulator, except that its equivalent Vf (Vbe for a BJT and Vgs for a mosfet) is just 0.6v.

so here is one such example.

user posted image

the output current is fairly steady regardless of input voltage fluctions, or the regulators used: the current going through the LEDs is about 120ma when the regulator is a bjt (tip122, a darlington), or a mosfet (irf510).
PMEmail Poster
Top
millwood
Posted: August 14, 2009 02:52 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




QUOTE (Sch3mat1c @ August 14, 2009 01:11 am)
You're using awfully large toroids. Is that because they're just what you have on hand, or is it to save turns, or what? Ungapped black ferrites don't store much energy.

tim, they are just what I have.
PMEmail Poster
Top
MacFromOK
Posted: August 14, 2009 05:03 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 14,051
Member No.: 5,314
Joined: June 04, 2006




FWIW... IMO it's better to current-regulate LEDs rather than voltage-regulate them.

They can usually withstand slight variations in current, but any overvoltage (if voltage is the regulation method) will destroy 'em in a heartbeat. beer.gif


--------------------
Mac *

"Basic research is what I'm doing when I don't know what I'm doing." [Wernher Von Braun]

* is not responsible for errors, consequential damage, or... anything.
PMEmail Poster
Top
millwood
Posted: August 14, 2009 06:02 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




QUOTE (MacFromOK @ August 14, 2009 12:03 pm)
FWIW... IMO it's better to current-regulate LEDs rather than voltage-regulate them.

yes. that's why all the LED drivers discussed here, with the exception of the very first one, are "constant current" types.
PMEmail Poster
Top
MacFromOK
Posted: August 14, 2009 06:38 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 14,051
Member No.: 5,314
Joined: June 04, 2006




I've no idea why the current regulator circuit below isn't mentioned more often. It's extremely accurate, even if shorted. I've used it to regulate a 0.5mA constant current in a circuit that varied from 12V to 33+V. beer.gif

CODE

+V o------o-------o
          |       |
    1-10k R1    [load]
          |       |
          |       |c
          |    b|/ Q2 NPN
          o-----|\
          |       |e
         c|       |
    Q1 NPN \|b    |
           /|-----o
         e|       |
          |       R2 (sets current)
          |       |
0V o------o-------o

Note: Make sure Q2 and R2 are rated for the load.



--------------------
Mac *

"Basic research is what I'm doing when I don't know what I'm doing." [Wernher Von Braun]

* is not responsible for errors, consequential damage, or... anything.
PMEmail Poster
Top
millwood
Posted: August 14, 2009 07:37 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




QUOTE (MacFromOK @ August 14, 2009 01:38 pm)
I've no idea why the current regulator circuit below isn't mentioned more often. It's extremely accurate, even if shorted. I've used it to regulate a 0.5mA constant current in a circuit that varied from 12V to 33+V. beer.gif

CODE

+V o------o-------o
          |       |
    1-10k R1    [load]
          |       |
          |       |c
          |    b|/ Q2 NPN
          o-----|\
          |       |e
         c|       |
    Q1 NPN \|b    |
           /|-----o
         e|       |
          |       R2 (sets current)
          |       |
0V o------o-------o

Note: Make sure Q2 and R2 are rated for the load.


because their usefulness is limited.

for low power LEDs (signal indicators for example), current accuracy doesn't really matter. in applications where current accuracy does matter, a LM317/TL431 based LED driver will out perform a transistor CCS by a long shot.

for high power LEDs, linear drivers are too inefficient to compete and you pretty much have to go with a pwm-styled LED driver.

where it is useful is as a LED driver for microcontrollers that have limited current output capabilities (typically less than 10ma and sometimes spec'd at 2ma).

PMEmail Poster
Top
MacFromOK
Posted: August 14, 2009 07:59 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Spamminator Taskforce
Posts: 14,051
Member No.: 5,314
Joined: June 04, 2006




QUOTE (millwood @ August 14, 2009 01:37 pm)
in applications where current accuracy does matter, a LM317/TL431 based LED driver will out perform a transistor CCS by a long shot.

Since the LM317 is also linear, and the TL431 is a shunt regulator (shudder), why would their performance be better "by a long shot"?

Do they have temperature compensation or something I'm not aware of? Or is internal protection the reason? 'Cause I gotta say (again) the one I posted is very accurate. huh.gif

Btw, I do realize that linear isn't always the best solution. beer.gif


--------------------
Mac *

"Basic research is what I'm doing when I don't know what I'm doing." [Wernher Von Braun]

* is not responsible for errors, consequential damage, or... anything.
PMEmail Poster
Top
millwood
Posted: August 14, 2009 09:09 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




QUOTE (MacFromOK @ August 14, 2009 02:59 pm)
Since the LM317 is also linear, and the TL431 is a shunt regulator (shudder), why would their performance be better "by a long shot"?

a typical VR like lm317/tl431 has far higher gain than a transistor so they will hold the current much steadier than a transistor can.

you can, however, replace that small signal transistor with a tl431 and get comparable performance (tl431 has a ripple rejection ratio on the tune of 1/1000).

as to tempco, LM317 has a positive tempco and that can be to its detriment for LEd applications. BJTs have a negative tempco and that will be helpful for LEDs.

===========================
here is one example that shows how well TL431 can hold its voltage vs. a NPN.

user posted image

with the supply rail going from 5v - 15v, the current going through the regulator clamped by a tl431 (Ic1) is barely changed, and the current going through the regulator clamped by a NPN (Ic2) goes from 10.35ma - 10.9ma.

a small change but several magnitude higher than what the tl431 can do.

===========================
similarly, you can do the comparison between a lm317 and a bjt-based CCS. in the following chart, the input voltage source Vin varies from 19v to 21v. the red trace shows the current going through the bjt-based CCS and the green trace s hows the current going through the LM317.

while the variation continues to be small, the magnitude of variation is much higher with the bjt-based CCS than that with the LM317-based CCS.

user posted image
PMEmail Poster
Top
millwood
Posted: August 29, 2009 06:54 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 1,823
Member No.: 25,377
Joined: July 26, 2009




you can build a linear constant current LED driver with tl431 as well.

here is how it can be done and what kind of performance you can expect.

user posted image

essentially, tl431 is just a super-high hFE transistor.
PMEmail Poster
Top
liburno
Posted: June 27, 2010 02:31 am
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 115
Member No.: 26,085
Joined: September 08, 2009




if i have a signal that can drive 10 ma my driver is a resistor of the right value
PMEmail Poster
Top
liburno
Posted: September 06, 2010 06:31 pm
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 115
Member No.: 26,085
Joined: September 08, 2009




doh.gif To drive an LED all you need minimum forward current and suficient forward voltages meaning just current limiter from a voltage source or minimum forwars current source. all these shemes to drive an LED is just silly if toggleing is desired then an lm117 can hadle all kinds up to 30v and/or any current up to an amp/ just ground th adj pins at any time for off and release for any output. simple design just one seies resistor to limit the current as a current source or set the correct voltage either way will work thumbsup.gif
PMEmail Poster
Top
Sunnysky
Posted: July 28, 2012 03:40 am
Reply to this postQuote Post


Newbie
**

Group: Members+
Posts: 28
Member No.: 36,934
Joined: June 25, 2012




I have taken a different approach going against the grain as it were.
Most people use custom CC sources. I use CV sources from universal Laptop chargers that match the string of LED voltages at rated current and add Rs to match the ESR of the string or more to prevent thermal runaway. I have found this to be very cost-effective, cool , great performance, easy to install and stable.

Mat'ls required for driving > 10W~ 135W of LED's;

  • 1W LEDs mounted on Alum substrates
    ALum extruded tile edger in 0.5" x1" x 8' strips for heat spreader and valence light blocking
    100 ft spool of AWG24 speaker wire or CAT5
    Laptop Universal Charger, with DC voltage selector or matched to LED string*

e.g.
http://Universal-AC-DC-Laptop-Charger-NS-LC90MA-.jpg

Screw alum. substrates to alum. tile edger for desired spacing for use as a heat spreader and valence for light source, then cut to length.
Solder wires to installed strip of lights in a hidden location, such as under handrails or baywindow ceiling or fence top rail or under edge of deck stairs or under eaves.

I choose Cree LED's with 1Ω ESR@ 350mA. Some are more or less.
I have a matrix implementation of 6xN such that Total rated voltage of PSU @ rated current is close to sum of voltages incl ESR for string of LEDs.

e.g. White LEDs rated at 350mA average or 1A max with adequate heatsink or 2A worst case have an ESR of 1Ω and voltage match from the same batch of < 1%. This is important to get from same batch.

for example If I have a 85W 4.5A 19V supply. It may be 19.5V open cct. and 19V at rated load.If I divide 19.5 by Vf (nom of 3.2V @ 0.35A +/- x%), I get 6.09, so I choose a string of 6 LEDs. LED = 6x Rs of each LED. In my case 85W supply has ESR =∂V/∂I=0.5V/4.5A~0.1Ω. So I choose 6 LED's i series and choose wire resistance to match ESR of LED's (in future I'll show theory) or more.

Then I string up to 75% or rated power for margin with 6LED strings in parallel.
I get good matching of intensity between devices. Critical reasons of chosing ESR or effective series resistance of source, cable, and LED to make this efficient, simple and stable.

Here is one installation for outdoor garden fence illumination
http://dl.dropbox.com/u/6606076/my%20Fence...in%20summer.jpg

My 1st post here, when I figure how to insert photos' I'll show more detail..

Tony Stewart
EE since 1975

This post has been edited by Sunnysky on July 28, 2012 03:41 am
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


:: support us ::




ElectronicsSkin by DutchDork & The-Force