BTW: I’d love to see a how-to section started.
(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.
- 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.
- 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.
- 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.
- 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. (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.
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.