Note: This is part two of a three-part guide.
Part 2 - Building a White LED Lamp (you are here!)
I needed some lighting for my lab, and having played with Infineon’s I was confident high quality lighting could be achieved with it. This short post is a consolidation of the earlier findings put into practice to build an LED lamp.
In brief, the Infineon RGB LED shield is spectacular for LED lighting. It is a complete, low-cost programmable board that can directly control up to three groups of LEDs with no additional components required. The LEDs can be driven with a combined power of up to around 100W – perfect for home, commercial and industrial lighting applications.
The shield costs about the same as an Arduino, can be plugged on top of an Arduino, or can be used completely standalone. It really is as simple to use as described in the diagram here – note there is no need to use RGB LEDs as the name of the shield may suggest, single color ones can be used if desired:
There is also a wealth of practical information from the recent Enchanted Objects Design Challenge concerning the board.
Here it is, in a lab simulation (there is a video showing the dimming effect near the end of the blog post). At full brightness the LED module is blindingly bright – about the same brightness as a 100W light bulb but consuming a quarter of the energy. Three of the modules can be controlled from a single Infineon RGB LED Shield.
Why might I need the RGB LED Shield for lighting LEDs?
LEDs are specified to operate at a particular current but the exact voltage required for that current to flow is a parameter that can be different from one LED to another due to production methods in use today. By using a fixed voltage DC supply alone, it is hard to set the current through the LED to a defined value. If there are multiple strings of LEDs, the current through each string can be slightly different; this results in uneven lighting. One option is to use a series resistor with a value high enough to minimise the effect of the LED forward voltage tolerance however in general a series resistor is not an option for high power LEDs due to the wasted energy as heat.
One solution is to dynamically modify the average voltage supplied to LED strings in order to maintain a certain current through the LEDs (i.e. a constant current), and the RGB LED shield can be used for exactly that. The board uses a buck converter topology with no resistor needed apart from a tiny resistance used for current sensing for a feedback loop.
Another topic of interest when it comes to high powered LEDs is how to dim them. One option is to pulse the light rapidly between on and off states, and the ratio between on and off time will determine how bright the light appears. In effect, the average current can be controlled using such pulse width modulation (PWM).
There are other LED projects on the Internet that rely on PWM but often they are not designed for high quality lighting. The Infineon RGB LED Shield offers extremely granular (4096 level) dimming capability per channel – surpassing some commercial offerings like LIFX. For smooth lighting effects a minimum of 10-bit resolution is needed (anything less and the transition steps become visible), and this is not met by many low-cost LED lamp products in the market whereas the RGB Shield offers 12-bit resolution.
To summarize, if high powered LED lighting is required then the RGB Shield is a useful option because it will provide higher efficiency, cooler operation and high quality effects capability for dimming and color transitions.
Note that some commercial LED lights incorporate sophisticated features such as color mixing to generate the ideal color temperature, and temperature measurement of the LEDs in order to more precisely control the brightness as the LEDs get hot. These bits of functionality are not part of this current project but could be incorporated by those who desire it, with some additional thought.
Design and Implementation Notes
The RGB LED shield is designed to provide a constant current (configurable in software) up to around 780mA. Some of the most popular high power LEDs are typically designed for continuous operation at either 350mA or 700mA depending on the particular device. I decided to use 700mA LEDs. They can get hot and so they require a heat sink. To get heat away from the LED, often metal core PCBs (known as MCPCBs) are used. It is easiest to just purchase a module that contains LEDs already soldered to a MCPCB. I chose a incorporating nine cold white LEDs (cold color temperature LEDs usually emit more light than warm color temperature LEDs; bathrooms may be better with cold color temperature lighting as an example. For now, I chose cold).
The heat sink was a low cost part from eBay, available from sellers in China. Four holes were drilled to secure the LED module, and a recessed hole in the center was drilled for creating a mounting point.
Due to surface imperfection some sort of thermal interfacing is needed between the LED module and the aluminium heat sink. Heat Sink Compound is one option. Instead I used some from Farnell. Here is is applied to the underside of the LED module:
The Vishay LED module contains three sets of three LEDs in series, brought out to solder pads. I decided to chain all three sets together to form a single set of nine LEDs in series. Here is the LED module all wired up for testing:
The yellow wire is an input signal, which I wired up to a potentiometer (check out the comments in the getting started blog post which lists the pins available). The LED shield contains an ARM Cortex-M0 processor and it is possible to modify the demo code in order to read input signals from switches or potentiometers. The steps on how to program the board are in the getting started guide blog post too. The white wire that is connected to an oscilloscope probe is discussed further below.
Here is what the heatsink and LED module look like from the other side (the longer center bolt can be used to either suspend the lamp or to fit it to a holder):
The white wire mentioned earlier is connected to the current sense resistor on the board; it was connected to an oscilloscope so that the configuration parameters of the LED shield could be optimised.
In brief there are two main parameters; one parameter sets the peak voltage level at which the microcontroller will switch off the buck converter and the other parameter is used to insert a delay between cycles for the buck converter. Again, it is possible to refer to the getting started guide for more information on these parameters and example oscilloscope traces.
Since there were nine LEDs in series, around 36V is needed to control them according to the LED module datasheet. A 48V power supply was selected. With the supply connected up, the voltage across the current sense resistor was observed with an oscilloscope. The two configuration parameters were adjusted to ensure that the current through the LEDs did not exceed the datasheet specified maximum value and to reduce the ripple so that the average current through the LED was close to 700mA. The final result is shown in the trace below. It can be seen that when the buck converter MOSFET is switched on, current through the 0.2 ohm sense resistor (and the LEDs) rises. At a peak value (188mV in the trace below which corresponds to 0.94A of current flowing through the resistor) the MOSFET switches off and current will continue to flow due to the energy stored in the inductor (this is not visible on the trace since the current sense resistor is now not part of the current flow path until the MOSFET is switched on again. It can be seen from the trace that when the MOSFET is switched on, the current will again rise until the 188mV peak. The average current is very close to 0.7A (by observing the minimum and maximum voltages on the ramp in the oscilloscope trace), and the peak is within the safe limit of 1A the LED module is rated for. For those interested in using the same LED module, the parameters I used were: CURRENT_RED/GREEN/BLUE=0x80, OFFTIME_RED/GREEN/BLUE=0x09.
It was decided to provide manual dimming capability using a variable resistor; there is in-built analog to digital conversion (ADC) capability within the microcontroller so all that was required was to connect up the variable resistor to an analog capable input pin. The ADC conversion is 12-bit - far higher resolution than is required for a manual dimmer control. To prevent flicker due to ADC noise and variable resistor noise multiple measurements are made and a moving average is taken; another trick to minimizing potential flicker is to only update the brightness level if the ADC conversion result is larger or smaller by a certain amount compared to the previous set brightness level. I'm still experimenting with finding the optimum method but it currently works reasonably well using the strategy outlined.
The short (20 second) video below shows the project being tested:
Summary and Next Steps
The Infineon RGB LED shield makes it easy to control high power LEDs and produce very good quality dimming and transition effects if desired. The fact that it has an in-built ARM Cortex-M0 processor means that no Arduino or other microcontroller board is needed for standalone projects.
Another two LED modules will be connected to heat sinks so that all three channels of the RGB LED Shield are utilised – this should provide an extreme amount of lighting for a home lab! (equivalent brightness as 300W of incandescent light bulbs). An enclosure for the lamps and heat sinks will be fabricated next – the plan is to use a breakfast cereal bowl as a mold if it works out.
Special thanks to Element 14 for providing the excellent Infineon RGB LED Shield and therefore sparking the interest in LED lighting.