HOW TO: Use high-power LEDs with an Arduino.

BTW: I’d love to see a how-to section started. :wink:

(Standard Disclaimer: This is by no means the ONLY way to do it and maybe not even the BEST way for your project. But it works very well for my project, and it’s a pretty generic implementation that can be adapted easily. YMMV and I will not be held responsible for anything you do. Feedback, comments and expanded ideas are always welcome.)

High power LEDs require a much more controlled driver than regular and high-brightness LEDs. Anything over about 50mA probably ought to be driven with a constant current driver IC. The high power LEDs in the 1W and higher range REQUIRE constant current drivers and proper handling of heat.

The facilities available on the Arduino are great for interfacing to the LED driver ICs available from National Semiconductor and Linear Technologies (and probably others too). Both manufacturers offer ICs that can be switched on and off via logic and can be dimmed via PWM signal. Both of those signals are directly compatible with the Arduino digital pin outputs at both 5V and 3.3V.

Basic tips:

  1. It’s better to drive multiple LEDs in series if you are driving them all from one source and they require the same current. LEDs are sensitive to the current flowing through them, not so much the voltage driving them. If LEDs are driven in parallel, then you can not as easily control the current flowing through each.
  2. LEDs at or above 1W require proper heat management. Most will burn up if their junction temperature exceeds about 125-150 deg C. For us DIY folks, this means it’s best to order LEDs that are pre-mounted to a metallic core PCB or order prototype kits from the driver IC or LED manufacturers.
  3. The voltage drop of an LED gets LOWER with higher temperature. This is why constant current is so important. If you drive with constant voltage, the LED will likely burn up as a result of thermal runaway.
  4. If you can monitor the temperature of the LEDs in your project, then you should because you can overdrive LEDs up to their max current as long as they stay cool enough.

I’ve recently investigated the following driver ICs. These are step down (buck) converters with input range of around 4V-40V and LED current handling of 350mA to 1.5A. Also available are step up (boost) driver ICs for when your power supply is a lower voltage than the array of LEDs you want to drive. There are other types as well for other needs.

National LM340x series (e.g. http://www.national.com/pf/LM/LM3402.html). These are simple to use and require the least number of parts to make them work. And National has a cool online tool called WEBBENCH that generates the schematic for you and you can even order the prototype right there.

Linear’s LT3474 and LT3475 are also really nice (http://www.linear.com/pc/viewCategory.jsp?navId=H0,C1,C1003,C1094). They are a little more flexible with an additional analog current control pin (called Vadj), but require a little higher voltage to be stable, more parts and are a little more expensive. (I’m using the LT3475 in my project to drive 8 1W LEDs). Linear provides LT-Spice, a very nice SPICE implementation that includes models for most of their ICs (hooda thunk?), which allows you to design and simulate the circuit. Most of their LED driver IC pages have links to example circuits that can be loaded into LT-Spice and simulated on the spot. :sunglasses: (Now you know why I went with the Linear IC)

As far as LEDs go, there’s not much to say. I personally like the Philips Lumileds and Cree LEDs. But that’s only my preference.

A manufacturer by the name of Dialight offers pre-made optics for Luxeon, Cree, Nichia and Osram LEDs. These are available from Newark/Farnell as of this posting. These optics are designed to work with LEDs that are pre-mounted to the 6-sided metal core PCBs.

Now for some more details about interfacing the Arduino to the driver ICs:

Both of the National and Linear ICs have on/off and PWM input pins. They are labeled clearly in the data sheets. It’s pretty straight forward how these work. You can connect these pins directly from the Arduino to the LED driver ICs.

If the on/off pin is taken high, the driver IC turns on the LED. If it’s taken low, the IC turns off the LED. The IC goes into a low-power state when it is off. If you don’t need this feature then tie the on/off pin of the driver IC appropriately per the data sheet. (note: this pin is not suitable for rapid on/off switching)

For the PWM input pin, the driver IC turns the LED on and off at the frequency of the PWM signal. During the off state, the IC remains active and only shuts off the LED output to keep the switch speed fast. With the Arduino PWM output, your LED will flicker at about 490 Hz, which is much faster than the eye can detect and the LED will appear to be dimmer or brighter. The advantage of PWM dimming (vs reducing the current through the LED) is that PWM eliminates color shift caused by low current. If you do not use the PWM feature, leave this pin unconnected on the driver IC.

If you are monitoring the temperature of the LED with the Arduino, you can use that info to control current flow through the LED. You can also use it to manipulate the PWM, but the results are different and it depends on your application. I use the temperature feedback to control the current because PWM is not suitable for my application. The Linear driver IC is the easiest to control current flow because it has the Vadj pin, which takes a 0-1.25VDC signal that directly controls the LED current. I’ve created a small circuit that takes the PWM output and converts it to a DC voltage level to drive the Vadj pin on the LT3475.

The DC resistance of L3 and R2 make a voltage divider. Adjust R2 so that 100% PWM yields 1.25V or less at Vadj. D7 is shown as a 1N5819, but can be any diode. Choose one that has a low voltage drop. This is a very low-current circuit so the diode and inductor can be very small.

OK, so there is my brain-dump on this subject. Enjoy!

After reading retrolefty’s reply #3 on this post: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1234751867

I’ve revised my PWM to DC circuit to the following and it seems to work just as well. This is much simpler than trying to mock a switching power supply. In fact, now I’m wondering if the coil was doing anything at all other than being a 278 ohm resistor. :stuck_out_tongue:

These values give about 570mV on Vadj at 50% PWM duty cycle (@5V) with about 35mV ripple. A larger cap will reduce the ripple, but increase the time to stabilize Vadj. A smaller cap will have the opposite effects. As configured, this circuit will pull about 6-7mA from the PWM pin when it’s high.

Your images are linked to a password protected gallery, they don't show up here and a password box pops up.

D'OH! Sorry. Fixed now. (I was still logged into the gallery so It showed up for me)

Nice write up on the safe use of high power LEDs. For those that don't want or can't roll your own drivers there are preassemble modules that will do the job for you. The example here is for 3 watt LEDs (700ma constant current) and you can drive up to five (in series connection only) depending on how high the voltage source you provide. The enable input allows the Arduino (or any TTL output signal) to either turn on or off or PWM the current.

http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&ssPageName=STRK:MEWAX:VRI&item=120354426350

Lefty

That's a bad price, Dealextreme has many 1W and 3W LED drivers with varying input ranges; some are stepup from a single 1.5V cell, others are step down or constant current regulators from higher voltages. The prices range between $2 and $4 for most.

That's a bad price, Dealextreme has........

Yea, I'm not sure what a competitive price is on LED drivers, however other things I have purchased from that vendor have been very well priced.

I looked at some of the Dealextreme drivers listed ( they sure have a ton of stuff!) however on their LED drivers I couldn't find any that would let an external TTL output signal (either on/off or PWM) control the driver? But I stopped searching after a few pages of listings, they may indeed carry something similar.

Around here it's all about being able to have our Arduino outputs controlling things. ;)

Lefty

Thanks for the great information and links. I've previously used large current limiting resistors, but these do get very hot.

I have a query. Most of these seem to be aimed at single LEDs or series or parallel LED networks. My application is using 3w Luxeon stars in red green and blue (independently controlled via arduino pwm). Do I need to use three drivers? I did find some muli-output drivers but they don't seem to be able to deliver the sort of power I'm looking at.

I'll probably power the project from a random wall wart. Do any of the drivers provide 5v or 3.3v suitable for powering the arduino, or is it more suitable to independently regulate for the micro-controller.

Do I need to use three drivers?

Yes, the voltage across each LED when on is different so you need a driver for each. If you ran them in series with the same current going through each the brightness would be different.

Do any of the drivers provide 5v or 3.3v suitable for powering the arduino,

No the drivers are constant current output not a constant voltage output which is what you need for an Arduino.

Yes, the voltage across each LED when on is different so you need a driver for each. If you ran them in series with the same current going through each the brightness would be different.

Thanks, that was already clear. My question was more whether there were alternatives to using three drivers (and the components they imply). From my brief searches I see there ARE drivers capable of driving three outputs, but these tend to be limited to 150mA or so. Are there any multi-output drivers capable of driving 1A or so per output?

Cheers for the quick reply.

I've seen drivers that will do two outputs, such as the Linear LT3475. But nothing that directly addresses a three-color grouping in a single chip. I haven't looked very hard either, so there may be something available.

I would be interested in knowing if anyone DOES discover such a driver.

EDIT: I had to go check it out. ;)

This one from Linear has three outputs that will each drive 1-7 LEDs in series @ up to 750mA with PWM and current control - which sounds like it's exactly what you need. It's SMD though.

http://www.linear.com/pc/productDetail.jsp?navId=H0,C1,C1003,C1094,P37747

Thanks for the link to the Linear chip. It does seem suitable, but this is only a side project and I won't be making a pcb for it. As such, smd is somewhat a no go (particularly with a ground pad).

It seems that most of the driver chips require a good 5 - 8 external components to work. With my three outputs, that's gonna end up as a reasonably large perfboard. Are there any other solutions? I've used current limiting resistors before, but am quite interested in doing this the correct way. I'd like to end up with a light I can leave on continuously without worrying about too much energy wastage.


The side part of this project is that it will be controlled by a touch wheel and touch buttons. I'm currently toying with making the controller wireless too, but haven't implemented that yet.

HA! I forgot one very easy way (I've been so tied up in high-efficiency circuits lately) The LM317 (http://www.national.com/mpf/LM/LM317.html) adjustable voltage reg can be used as a current regulator with very few external components. It may take some work to vary the output with PWM though. Not sure it's a suitable solution, but you might be able to experiment.

Thanks, I'd seen the 317 suggested over on instructables. My reading is that whilst this certainly provides the fixed current, it's also somewhat inefficient. With a voltage drop of 3v, I'd assume I'd want an input V as close as possible to 7V or so (the LEDs I'm using have varied drops between 2.9 and 3.4v).

Since I'd likely use a supply greater than this, would it be preferable to use a switch mode regulator to take the supply down to 7, and then use 317's to provide the fixed current?

I don't think PWM would be an issue. I can run the 317's through transistors or a darlington chip for that.