Tuesday, February 24, 2009

constant current LED driver thoughts (LM334)


I was experimenting on how to mount surface mount LEDs in wood and made this little arch to test out ideas.

All the LEDs are in series. But the question was how to drive them? I could connect them to a wall wart transformer and put in a resistor, but that would mean that the resistance of the resistor would have to be tuned to the wall wart transformer. Since I was just going to grab a transformer from my junk pile of dead electronics I didn't want to do that. Instead I settled on this constant current circuit shown in discover circuits:

http://www.discovercircuits.com/DJ-Circuits/constantcurretled1.htm


This circuit is really strange because the current from the LED goes through R1 along with the current from the LM334's current selection. Was it a typo? Should the LED current really just go straight to ground?

Also, I popped up the LM334 spec. The LM334 basically has 3 pins: Positive, ground, and a third "current selection" pin. You just connect a resistor across the current selection pin and the ground pin to choose what current you want. So it turned out that the LM334 is a constant current driver itself, so why have the extra transistor?

And In fact, the naked LM334 circuit what I ended up using. But the issue kept bothering me and so I finally decided to think about it.

I decided to try 3 simple circuits. Let's call the simple one "A":




So basically the current from the LEDs runs through the LM334, and so, regardless of the input voltage, is regulated by the size of the resistor connected between pins 2 and 3.

I guess the problem is that all the current is passing through the LM334...







And then a "simplified" discovercircuits, call it "B":


The LM334 is used as suggested by the spec. But the LM334 only controls the current that flows out of the base of the transistor, so current through the transistor and LED will be about 100 times (or whatever the amplification of your transistor is) what is going through the LM334.

This turns out to be very useful if you want to use the relatively low current LM334 chip to control a much larger current. Or if you only have larger value transistors lying around.





This one from discovercircuits "C":

As I previously said, "C" is really strange because the current from the LED goes through R1 along with the current from the LM334's current selection.

The LM334 holds is middle pin at 68mV above the bottom. So without doing any math, you can see that current going through the LED wil have to "share space" through the resistor. As the current through the LED rises, the current sensed by the LM334 goes down. This therefore is equivalent (to the LM334) like putting a bigger resistor across its pins. End result: the LM334 lets a lower current pass through itself (i.e. out of the transistor's base). You actually end up with a stable situation.

As with the second circuit (B), the advantage is that load is going through the transistor, not the LM334. An additional advantage is that the resistor values to make it all work are similar to that in the LM334 spec, and you don't have a 100x multiplication of the current (which may or may not be an advantage)

Another disadvantage of B is that it is very sensitive to the exact amplification (beta) of the transistor. But I guess transistor betas used to vary pretty widely within the same part due to small fabrication differences (I am not sure how accurate they are nowadays)... So while B is great for home use where you can test the exact beta of the transistor and choose a resistor to match, this circuit might be a bad idea to use in a production circuit board.

However, a big disadvantage of C is that the load (from the LED) is going through the resistor, so you do waste more power than in B and most importantly will have to use a high-watt (bulky, expensive, don't have it in your basement) resistor. Or of course a bunch of normal resistors in parallel...but that is also pretty ugly.

11 comments:

  1. could I use the LM317 instead of the LM334

    ReplyDelete
  2. I only used the LM317 in the more typical variable voltage regulator configuration. However you are right it is usable as a current regulator (check the spec).

    With the 317's greater amperage you would not have to use the power transistor as described above. However you do need a big high-watt resistor inline with your load so that the LM317 can sense the current.

    ReplyDelete
  3. Found this via a post on the Arduino forums. Very helpful for brainstorming some ideas and understanding constant current circuits more clearly. Thanks!

    ReplyDelete
  4. I am designing a light source for my company. I have 5x5 array of leds. there are 5 branches, each branch has 5 leds.the branches are connected in parallel. hence 25 leds. each branch carries 0.06 A current. the following link shows the circuit I have designed for driving this array of leds.

    http://www.glowfoto.com/static_image/15-044438L/2333/jpg/12/2010/img4/glowfoto

    Is this circuit good enough.I want to know your comments on this. how stable and efficient is this circuit. Also I am trying to go for SMD components. I am not able find SMD package for TIP transistors. could you also draw me a circuit for this array of leds using LM 334.

    ReplyDelete
  5. I'm pretty confused by what you are doing here. I think you are trying to have a light turn on depending on the input of a variable resistor. But is there more to it than that?
    Perhaps you can teach me something! A few points:

    1. LED Array:
    You have 5 series strings of 5 LEDs. These strings are in parallel. Putting these in parallel is dangerous as a small change in the voltage drop over one of the LED strings (as they age) will cause a divergence of the voltage drop across each parallel chain. This will result in the string with the lowest voltage drop sucking a disproportionate amount of current and potentially burn it out. Now you'll have 4 strings carrying the current of 5, so they will be over driven and burn out sooner -- and so on until all are dead.

    2. It looks like you are sending the entire current that is powering the LEDs through a light sensitive variable resistor. This might work... but why be that inefficient and require a bigger variable resistor?

    3. What's the point of Q1 on the left? Just having a Vbe voltage drop to match the Q1 on the right?

    ReplyDelete
  6. The name of the picture in section "b" is 'LM334c.jpg' & the other one in section "c" is 'LM334b.jpg'. So which is which? :)
    Other way, your post is quite interesting.

    ReplyDelete
  7. Heh heh... you're right! Please ignore the image names. When I uploaded, I was planning a different order of presentation then what I finally settled on.

    That little light sculpture that introduces the article has been running about 50% of the time since 2009 (nightlight) by the way.

    ReplyDelete
  8. Nice post. The photos you have shared this is most useful and helpful for a person. Thanks for sharing the information about constant current LED driver. I am collecting the information of LED driver. Last time I have visited:- www.aceleds.com for collecting information. They are also providing good information. Keep sharing the information.

    ReplyDelete
  9. Well information of constant current LED driver. Thanks for sharing this article.

    ReplyDelete
  10. LED light is giving more brightness than traditional light with using so much little voltage.

    ReplyDelete
  11. You say: "big disadvantage of C is that the load (from the LED) is going through the resistor, so you do waste more power than in B and most importantly will have to use a high-watt (bulky, expensive, don't have it in your basement) resistor"

    But there is only 0,065V on this resistor in all situations! For usual LED 20mA x 65mV = 0.0013W of lost power. (And you need resistor 0.065/0.02=3.25 ohm.)
    Even if you need current 1A, it is 1x0.065=0.065W .
    The smallest SMD resistor you can buy can survive this. (In this case you need resistor 0.065/1=0.065ohm. You probably can't buy such resistor and I am not sure if circuit based on such resistor would be stable enough, but definitely there is no problem with "bulky" resistor and big power loss. I like "C" version, because source voltage can be only about ?<0.5V? above the LED voltage.

    ReplyDelete