High-power LED problem

This was originally posted in THIS forum.

Alright. I have read this forum and I understand it, relatively. I have a similar problem of my own, and I need to solve it quickly for a robotics club event. Using an Arduino Pro (ATmega328) I am driving six 1-Watt green Luxeon LEDs, using a 2N2222 NPN for each. I have 4 LD1117V33 3.3V regulators (supposedly rated at 800mA), two driving just one LED, and the other two driving two LEDs each. As I analyze the transistors I've used, I think I made a silly mistake, maybe? The problem is: the LEDs are not running at full brightness based on lumen output (I can tell). These are also rated for 350mA each. When I drive them with 50% PWM, they are fine. But when I turn them completely on, something weird happens. They shine extremely bright for about 1/2 sec, then they go very dim, and stay that way until I reset the Arduino. To test if this is a brownout issue in the AVR chip, I set the code to keep an LED lit (pin 13) when running; when this issue happens, the LED does not flicker. Another tip: I forgot (bad, I know) to add 1W resistors (10-Ohm in this case would be necessary) from the output of the 3.3V regs to the LEDs. I have 1k-ohm resistors going from the arduino's PWM outputs to the 2N2222 switching transistors. What is going on and how can I fix it? I tried to gain an understanding for what could be happening by reading this post, but I think I still need some help.

Thanks in advance :)

Led's require a constant current source, not a constant voltage. With lower powered led's this is done with a current limiting resister, however you may want to consider using a LED driver.

Whats the forward voltage drop accross the LED's? Your supply voltage needs to be above that.

Are you wiring them in series or parallel?

Thanks for the reply. Take a look at this thread: http://forums.parallax.com/forums/?f=5&m=421529&g=421577#m421577

The LEDs that are doubled up with a voltage regulator are in parallel. I'm not sure if that matters at this point though.

It looks like the voltage drop of the 2N2222's is approx. 1V in this case, and the forward voltage of the each LED is ~3.4V-3.99V. This goes at least 1V above the voltage regulator's output. Can you help answer my last question on that forum? Thank you!!

You have a few problems with using the 2N2222 --

  1. Your base drive current is too low. At 350mA output the gain of the 2n2222 is in the 40-50 range. You would need about 7-8mA of base current. With a 1K resistor you are probably getting around 3-4mA max. Could be less.
  2. At 350mA the saturation voltage of the transistor is probably around 700-800mV. You have 700-800mV drop across the 2N2222 combined with the 350mV drop across the resistor.
  3. You probably have a thermal problem when you drive the LEDs at 100% due to the large power dissipation in the 2N2222.

2N2222 is not the right transistor for this function. You would be better of with a different transistor preferable a MOSFET.

(* jcl *)

www: http://www.wiblocks.com twitter: http://twitter.com/wiblocks blog: http://luciani.org

I think I have worse news. I have the circuit set up with 3.3V regulators (4 of them, two paired with two LEDs each, in parallel), remember. So, visualize this: 3.3V regulator--->LED--->2N2222--->GND (transistor is sinking the current). The LEDs currently have no resistors on them. I think I have gotten lucky with not 'over-currenting' them thus far.

You are lucky that the magic-smoke didn't come out of the 2N2222's ;)

With (1) the voltage drop across the 2N2222, (2) the low gain at high currents and (3) the low base current you are unlikely to get 350mA. I am not sure if the LEDs require a heatsink or not.

(* jcl *)

Short answer. Yeah it sounds like your bottle neck is with the 3.3v regulator. Your supply voltage needs to be greater than the forward voltage drops of the components in your circuit, in this case the transistor and the LED.

However you really need to be regulating the current through the circuit, not the voltage in this case 350mA.

Do you have a schematic of your circuit?

Amidst this mess, I have calculated they are only drawing about 150mA when on, full power.

Here's the odd thing:

I have ran this for a half-hour at a time and the ONLY THINGS that got hot were the 3.3V regulators...!! Note that I have a heatsink on them, as well as a cooling fan. The 2N2222's have no heatsinking save for the PCB traces of solder that hold them in. The LEDs get warm and a heatsink is recommended for them, but I think that in this case they don't need them because they are running at low power (although they're still SUPER bright).

I don't know what to do :(. I guess I'll have to tear this all apart and re-design it.

"150mA" did you measure that in your circuit or what numbers did you use to calculate it?

I havn't looked at the data sheet for the 2n2222s but from the above posts you could have a problem with those in addition to the voltage regulater.

Okay. I just measured 100mA on the dot with my multimeter.

This thread talks about driving this type of LED.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234273497

Okay; I will be replacing the 3.3V regulators with high-current 5V one(s). I will also add the appropriate resistor to each LED, rated for 3W just to be safe.

What is the ideal transistor type to use in this situation? High-gain, low power dissipation? All I want to be able to do is drive six of these LEDs using transistors, and still have the most current possible left over for other things, keeping in mind that I only have ~40mA to spare of driving capability from the ATmega328.

This should be preferably one from radioshack (even though they charge you an arm and a leg plus another leg). I need to have this project completed soon and I can't deal with more snail mail. I see that they have this one: http://www.radioshack.com/product/index.jsp?productId=2062618&filterName=Type&filterValue=Transistor (IRF510 MOSFET). What would you recommend out of what they have? I.e. what would be best for this situation?

Thank you all for helping and offering your time to assist me! :)

rated for 3W just to be safe.

If you are running a 3W resistor at 3W you are not anywhere close to the safe side. In general the resistors must be capable of standing twice what you are asking them to do. You might need a heat sink as well.

What is the ideal transistor type to use in this situation?

One with a low Vsat, that is saturation voltage. Most power transistors have about 2V from collector to emitter when they are fully on. If you change to a FET this will be better as the on resistance of these is low and so the power dissipation is low. For hints on power see:- http://www.thebox.myzen.co.uk/Tutorial/Power.html

However you should not be driving high power LEDs using a resistor to limit the current, these sorts of LEDs require a constant current supply. See these discussions:- http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234273497 and http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1258412419

The IRF510 should work well. If you can find a FET with lower Rds(on) it will work better. The IRF510 is a 100V FET and you only need 5V in your application. You trade-off breakdown voltage for Rds(on).

What is the Vf of your LEDs? With the IRF510 you will have a 200-300mV across the FET. Far lower than the drop across the 2N2222.

(* jcl *)

This is a pretty inefficient sollution but should work if you just want something quick and dirty. http://www.instructables.com/id/Super-simple-high-power-LED-driver/

It uses a LM317 adjustable voltage regulator and you set the current using a resister. Ilimit = 1.25/R where 1.25 is is the constant reference voltage of the LM317 and you choose R to set your required current.

This is going to create some heat so make sure you use a sufficient heat sing attached to the LM317.

You will still need transister to switch the LM317 on and off. This will depend on what exactly you are trying to switch. It sounds like the Vf of the LM317 is 3V? (from the instructable)? so your Vsupply will need to be at least 3V + the sum of the forward voltages of the leds you are attaching in series with it.

Im sure there will be a reason to not use this however?? Im still learning all this myself and I was researching for a few hours last night. Any feedback is greatly appreciated. :-/

Any linear solution is going to be inefficient. Although each solution may spread the power dissipation among different elements the power dissipation will always be (Vin - Vf) * If.

The advantage to an LM317 as a current source or using a FET as a current-sink is that the current through the LED is constant. The original application uses the 2N2222 as a switch (which does not work well for all the reasons stated). Using the IRF510 (or a different FET) as a switch works a lot better. It is still a switch. The Rds(on) and the resistance of the current limiting resistor will increase with temperature and the Vf of the LED will drop. The current will change but it may not affect the application.

(* jcl *)


www: http://www.wiblocks.com twitter: http://twitter.com/wiblocks blog: http://luciani.org

The IRF510 should work well.

The problem with this FET is that it needs a gate signal of 10V to fully turn it on. This means you need a transistor between it and the arduino. You would be better off looking for a logic level FET that would turn on at 4.5V.

Alright so if im understanding this, using a MOSFET like the IRF510 would just sink the current, and you would need a current limiting resistor to regulate the current, however this is susceptable to temperature and other changes.

The LM317 would actually monitor the output current by measuring the current through the resister? and would therefore adjust the output as necessary (Closed loop feedback?).

Would a NPN transistor like the BC337 work will with 5V logic to switch 7v 350mA?

If I understand correctly the max voltage it will switch is the Breakdown voltage which is 45V for this one. The maximum current it will switch is the max current collector = 800mA. The saturation voltage is the voltage required to switch them. In this case im not sure if it will work with arduino. The data sheet says 700mV @ 50mA, 500mA. Does this mean if you supply it 700mV it will draw 50-500mA depending on Ic? But if i supply it 5V will it draw 7-70mA?

Sorry if that got a little long. This is really my first foray into transistors. I also hope this info helps the original poster.

As Mike suggested the logic-level FET is better than the IRF510. The Rds(on) spec of the IRF510 (0.54Ohms) is with a 10V Vgs. It will be a lot higher with a Vgs of 5V but should still be better than the NPN transistor.

If a logic level FET isn't available a FET with a lower breakdown will have a lower Rds(on).

(* jcl *)

I was thinking of using the NPN to switch the LM317. Would it be acceptable for that?

[edit]Nm I think i get what your saying. I should use the logic level FET instead of the NPN because it is more efficient than the NPN?[edit]