HB LED drivers

Hello all,

I would like to use an Arduino to drive high brightness LEDs, or at least control drivers for HB LEDs. I'm talking about LEDs that are generally 3w each, like the Cree XR-E or Luxeon Rebel.

The approach that I'm assuming I'll take is to use PWM outputs from an arduino as dimming inputs on LED drivers. I can get or make LED drivers, but was wondering if there were other options?

Can the Arduino be set up as a constant current driver itself? Clearly it cannot drive 3w LEDs directly from the output pins, but am I missing any options here?

For instance, the rainbowduino. I see people using that to drive little grids of LEDs, but nothing as powerful as what I'm looking for. . .

Hi,

no, the Arduino can not drive HB-LEDs directly, the max. current you can sink into or source from an pin is 40mA (absolut max. rating), normally it is only 20mA.

Mike

Indeed that is true. I guess my thought about "controlling directly" was to use a PWM pin to turn a transistor on and of rapidly, based on feedback provided via an analog input pin - you'd have to smooth the transistor's output, but would it be possible to do this? You'd basically be emulating a switching DC-DC voltage converter. . .

Or, are there off-the-shelf options I'm missing?

I've built a few HB LED drivers (based on the NCP3066 chip from OnSemi) that can take a PWM input signal, but I'm wondering if there are other options out there.

you'd have to smooth the transistor's output,

If you smoothed the PWM output then you would not get much control over an LED. This is because you need about 2V to turn it on. PWM gives you always 5v or 0V and so the LED is either hard on or full off. With a varying DC voltage you would only get control over a small region.

For a high powered LED you NEED a constant current supply or regulator, google around for one of those.

For a discussion about this see:-
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234273497

Mike, thanks for the info. I realize that driving directly from the Arduino is probably a lost cause, I was mentioning it more or less as a daydream.

I've built a bunch of constant current drivers that can do this already, and even take a PWM signal from an arduino to control dimming, but I'm interested in exploring more "prepackaged" options targeted at arduino.

For instance, the rainbowduino. I'm a bit confused by the specs published for it, since it seems to list two different sets of specs. 24 constant current channels of 120mA each, and then 8 "super source driver channels" at 500mA and 12v max each. The 120mA channels would be useless to me, but if it can drive 8 channels of LEDs, up to 12v per channel, at 500mA, I would be all set. And at $19, it would be much cheaper than building my own drivers. Right now, I'm using drivers based on OnSemi's NCP3066 chip, which is a constant current switching converter that can do buck or boost.

Can anyone help me interpret these specs? I sent seeedstudio a note but I don't think they understood my question, so I've just sent them another. . .

Hi,

the Rainbowduino has additional drivers for the pins, so it can indeed drive higher current. 8 outputs can drive up to 500mA each and 8 outputs can drive adjustable current from 5 to 120mA. May be this is sufficient for your needs.

Mike

Attaching a transistor to the output of a PWM to drive high brightness LED's works fine, you get brightness control, full bright, whatever you want. Just remember to calculate the current through the transistor so you don't smoke anything. 2n4401's are cheap, to92 case, pretty decent gain, and have an Ic of 600mA. You should be able to drive a watt or two through your LED's depending on their forward voltage on one of those. If you need the full 3W you'll probably have to go to something in a to220 case for enough Ic. If you want examples of how to hook it up, just ask, lots of peeps have schematics for situations like this.

Mike,

Thanks for the info. 8 channels at 500mA and up to 12v each sounds very attractive.

Currently, on my home-made drivers, I am running 8 LEDs per driver at 500mA. 8 of these LEDs is a forward voltage of about 26v. So, to play it safe, I could put three of them on each of the eight 500mA channels of a rainbowduino. That would make for 24 LEDs per rainbowduino. I need exactly 24 LEDs!

To stick with my current plan, I need an arduino to provide PWM signals to each of my three drivers, plus the drivers themselves. If I use an RBBB for the arduino, that's $12. The drivers will cost me about $6 each. So that's $30 for the whole project. Compared to $19 for the rainbowduino. So I'm saving $11.

FWIW, if anyone is interested, this project is for lighting on a small marine reef aquarium. I'm using this small tank as a test bed for automation and LED lighting concepts I hope to implement on a very large tank at some point in the next few years. So, while an $11 savings might not make much difference on this project, it could translate into $100 or more on that project.

If you only want to drive 8 LED's, you dont really need much more than an arduino, a transistor, and a power supply. Not sure where your $6 'drivers' come from...
If you're looking to pinch pennies, you need:
atmega168 ~$4
16mhz crystal ~$1.50
2n3055 ~$2
Your LED's $?
Wall wart PS ~$10

They are based on the OnSemi NCP3066 chip:

http://www.onsemi.com/PowerSolutions/product.do?id=NCP3066

If you're just using a transistor, how do you limit current?

With a common emitter setup (and a NPN), you'd limit current by a base resistor. Base current X Hfe (gain) = Ic (collector current)

So emitter is grounded, base goes to resistor to PWM, and collector goes to LED neg, LED pos to Vcc

I appreciate the information. Clearly, I am a newbie to many of these concepts.

Would your method require a transistor for each LED, or would it be possible to drive a (series) string of LEDs from the transistor?

The LEDs I am planning on using have a forward voltage of around 3.5v at 500mA. Looking at the equation you gave (base current X Hfe - Ic) I'm confused. If I look at datasheets for 2n3055's, I see a range given for Hfe, not a single value.

Another question - how would you determine the Vcc to supply to the circuit? Clearly it would need to be greater than or equal to the forward voltage of the LEDs, but how would you determine a value?

You could use a transistor for each LED, or one large one. If you got a 2n3055 in a TO220 case, that would provide more than enough current for your LEDs (given you have a big enough power supply). I personally would wire the LED's in parallel, this would require a power supply with less voltage. Since the forward voltage of the LEDs is low (you said 3.5V) you could use a 5V supply, this would work to power both your atmega chip (as long as its regulated) as well as your LEDs. This will require a pretty big power supply tho, if you're driving 8 3w led's, you'll need like a 7 or 8 amp supply.

The datasheet for a 2n3055 shows a Hfe (dc current gain) of between 5 and 20 minimum. This transistor may actually not work in this application, i thought they had a higher gain. In this scenereo since you'd have 8A of Ic, lets assume 5 for a gain, you'd need 1.6A on the base, which, your arduino cant provide, so you'd need yet another transistor to drive that.

A quick search on digikey turned this up - http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=2N6387GOS-ND
Its a darlington, so high gain, and pretty high Ic. With this transistor, its minimum gain with 5A of Ic is 1000... heh, more than enough to be able to drive from your arduino. Its also pretty cheap.

You were correct about the Vcc, needs to be higher than the forward voltage of the LED's, since in this example I chose to parallel them all, you'd need a pretty low voltage supply, just high current...

Also, you saw a 'range' of Hfe for a transistor, because it changes depending on how much Ic you have. If they don't graph it out, sometimes you just have to assume a high gain, and test, once you get pretty close to your Ic you can calculate with your measured gain.

Again, I appreciate the info.

My understanding of HB LEDs is all based on projects where people used off the shelf components, so designing from scratch isn't something that I totally understand yet. That said, it's convention in the examples I've seen to wire in series, so if one LED goes out, you don't ruin the rest by overdriving them.

I'm still not sure if I understand how to come up with the Hfe value for a given transistor in a given application, but I'll stare at datasheets until it makes sense.

Another question, what does the output of the transistor look like? If we go with your example - a bunch of 3.5v LEDs parallel on that transistor, running from a 5V supply - will the output be a constant, steady 3.5v? Or will it be some waveform that averages out to 3.5v? As I learned about building buck or boost converters based on chips like the NCP3066, there always seemed to be a lot of focus on designing the output side so there would be low ripple, so constant spikes wouldn't kill the LEDs. If there will be a lot of ripple, can I design it out (caps on the output?)

Another question - how stable is this solution? vs. temperature, variations in Vcc, etc.? What can I do to make it more stable?

My understanding of HB LEDs is all based on projects where people used off the shelf components, so designing from scratch isn't something that I totally understand yet. That said, it's convention in the examples I've seen to wire in series, so if one LED goes out, you don't ruin the rest by overdriving them

Lets assume you are still using 3W leds, if one went out, there would be 1.16A of current available to the other 7, or each would see an additional .166A (~.6W). If you're over driving a 3W resistor by .6W, thats only 20% more (aka, they will probably be fine). Also note that LEDs don't generally just 'go out'. The MTBF is like 1 million hours, they generally only go out if you over drive them to start with. If you're still worried about an LED going out, design your system with 3W leds, but only drive them to 2.4W, then if one goes out, they each will only see 3W.

I'm still not sure if I understand how to come up with the Hfe value for a given transistor in a given application, but I'll stare at datasheets until it makes sense.

The Hfe value for a transistor is specified in its datasheet. However, there is generally a range between its maximum and its minimum, as it generally changes depending on how much collector current (Ic) there is. For example, in the datasheet for the darlington that I posted the first line under DC Current gain. It says Ic = 5Adc Vce = 3Vdc and its minimum Hfe is 1000. That means, if you had 3vdc between its collector and emitter, and your load was pulling 5amps, the gain would be at least 1000. That means you could have 5mA on the base (input), and you would get 5A of output, if you had 6mA on the base (input), you'd have 6A of output available. NPN transistors use base current to turn 'on'. The more base current you have, the more they turn on (the more current is available at the output).

Another question, what does the output of the transistor look like? If we go with your example - a bunch of 3.5v LEDs parallel on that transistor, running from a 5V supply - will the output be a constant, steady 3.5v? Or will it be some waveform that averages out to 3.5v? As I learned about building buck or boost converters based on chips like the NCP3066, there always seemed to be a lot of focus on designing the output side so there would be low ripple, so constant spikes wouldn't kill the LEDs. If there will be a lot of ripple, can I design it out (caps on the output?)

The output of a transistor looks exactly like what the input on the base is, just current is multiplied by the Hfe value of the transistor. So if you have 1Khz of PWM @1mA going into the base of a transistor, and the gain is 1000, you'll see 1Khz of PWM @ 1A on the output. The output voltage will be whatever the voltage between collector and emitter is, so if your supply is 5V the output is 5V, just current limited. Your LED's 'drop' 3.5V, meaning if you measured voltage across them, it would measure 3.5V (this doesnt really affect the voltage output of the transistor). There will only be ripple on your output if there's ripple on the input of the base of the transistor.

As for 'spikes', since the voltage output of the arduino is 5V, and you will have a resistor between it and the base of the transistor, the only way you'd get ripple is if somehow the arduino output voltage has ripple (not likely) or the resistor or transistor is flakey (also not likely). Again, transistors 'turn on' with more base current, so given our voltage is fixed (via arduino), and our resistance is fixed (via base resistor), input current will be fix (voltage/resistance = current), thus output current will be fixed.

Another question - how stable is this solution? vs. temperature, variations in Vcc, etc.? What can I do to make it more stable?

Pretty stable. Temperature will affect things, as it affects almost all electronics. Unless you're wanting this to work less than -20C or more than 80C I wouldn't worry much about how it affects your components. Variations in Vcc wont really affect much either, since your LED's pretty much always drop 3.5V, and the output of the arduino will pretty much always be 5V, everything else is pretty stable. If you wanted to be really paranoid with your circuit, design everything to not work more than 70-80% (only drive your LEDs 70-80% of max output, get a transistor that you will only be within 70-80% of its max current, power supply is only at 70-80% of its max current, etc) Heatsinks may be a good idea, 3W LEDs probably get pretty hot, and a little heat sink on the transistor would be fine.

you'd limit current by a base resistor. Base current X Hfe (gain) = Ic (collector current)

Using base current to limit the current through an LED connected to the collector is not going to work in practice. Each individual transistor has a different gain and that gain is also temperature dependent. This is not the basis for a good current limiting circuit.

Using base current to limit the current through an LED connected to the collector is not going to work in practice. Each individual transistor has a different gain and that gain is also temperature dependent. This is not the basis for a good current limiting circuit.

Doesn't work in practice? How not?

Regardless of if it would work in practice or not, I'm learning a lot here, so it's ok. ;D

I guess one of the things that makes me nervous about this is that the Hfe spec doesn't seem reliable - on that datasheet, as you pointed out, it lists a "minimum" for a given set of conditions. Elsewhere in the datasheet, there is a graph showing curves of Hfe at different temperatures and currents. At 500mA, the Hfe value can triple from room temp to 150 deg. C - even if I know I can heatsink and keep it at 50 C, it still seems like a lot of variation potential.

I appreciate the concept of under-designing by a certain percent in order to prevent problems, but the issue with that is it's rather expensive. In an application where you just want to illuminate something so you can see it, I suppose it wouldn't matter. But in this particular application (providing light to sensitive photosynthetic organisms in a marine aquarium) it's important to get every lumen you can for each dollar spent. So if I had to build in a 30% safety margin, that's 30% more LEDs I have to buy (and power, and heat sink) at a cost of around $10 each (for the LED, a star to mount it, heat sink, etc- everything except the driver, basically.) On a large tank that needs 200 LEDs, that evaporates the cost difference of using a cheap transistor vs. a "more reliable" constant current driver.

Again though, I'm here to learn, and though I'd like to think I know a thing or two about this application (marine aquariums) I am absolutely not an expert at electronics, so if my assumptions or conclusions are incorrect, please let me know. Perhaps I didn't describe my intended application well enough in the first place. In a typical LED light for a marine aquarium, these LEDs are driven within inches of their life by a constant current driver (buckpuck, something DIY, meanwell LPC or ELN drivers, etc.), heatsinked like mad, and probably have a shorter MTBF than a typical LED (Cree specifies 50,000 hours for the XR-E when driven gently). Maybe this sounds like a bad approach, but that's what is typical in the aquarium hobby. (Though, honestly, LEDs have only been used in the hobby for the last year or two, so I don't know if it's fair to even claim that there is a typical approach yet.)

Mike, if this transistor approach doesn't sound viable to you, do you have a recommendation for how to proceed?

Doesn't work in practice? How not?

I am not sure how long you have been designing electronics or what practical experience you have but you reasoning sounds like it is not rooted in experience.

Well I did say that the gain of a transistor is not a stable parameter therefore you can't relay on it as a design parameter. You can only relay on the minimum value. As pointed out by the ill_switch the gain will even vary with collector current. A design that relays on an unstable parameter is not going to be reproducible or reliable. It's like saying that as you can balance a coin on it's edge it is perfectly fine to have a display of coins, all balanced on there edges on a counter of a shop in a ferry.

With high power LEDs you have to ensure the current is controlled. That usually means some form of constant current supply. That in turn involves monitoring the current and using that signal as feedback to control the voltage applied. There are many ways of doing this and in fact you can incorporate such a feedback loop into the sort of base current limiting device we have been discussing.

I am not sure what sort of solution you are after, ready made, schematic or component.

For arguments sake, (and so I and others can learn), lets take a look at the block diagram of the output of that constant current led driver.

Specifically the output, (marked by teh sweet gimp red line action). That gate is a nor gate, meaning when all inputs are 0 the output is 1, which goes directly into the base of a darlington pair output. Granted, this is only a block diagram, so there could be more/different components in there, but this is their representation of the output.
Here's a pic of a darlington

If you wanted to negate the fact that gain changes with temperature, use a swamping resistor. This is a resistor between the emitter of the output and ground (similar in the above, the resistor between emitters in the output transistors.) This limits the total amount of current, especially in 'worst case' scenarios such as high temps resulting in high gain values

For the record, this circuit does work in practice, and I have yet to blow up any LED's from it. If gain drift was such a large issue with transistors, they wouldn't be used anywhere in 'practical' uses :wink: Even looking at the datasheet for the 'constant current led driver' there are fluxuations in the reference voltage and current limit sense voltage with temperature (thus, affecting the 'constant output')Like I said, temperature affects pretty much all electronic components, even a 'constant current' led driver :slight_smile: