Ver 2.0 Manual
High Power RGB LED Shield Ver 2.0 Manual
Description
High Power RGB LED Shield for Arduino will drive power LEDs. The shield provides three independent channels which is ideal for RGB LED to make beautiful colors. Of course, you can connect white LEDs to shine your room as well. High Power RGB LED Shield can drive various power LEDs such as Philips Luxeon, Philips Lumiled, Cree XP-E, Cree XP-G, OSRAM Dragon, OSRAM Ostar, power LEDs from dealextream, and many others.
The shield can be powered by broad range of voltage (6 – 42V) and can power up 100 – 700mA LEDs. It supports two different dimming methods to control brightness of LEDs. Analog dimming has best energy efficiency while PWM dimming is better for RGB color mixing. The shield can be stacked as many as you want (up to 64) while it use only two pins from Arduino regardless of number of the shield stacked. The shield can be operated without Arudino.
Features
- 700mA 3 channel LED driver based on lt3496 (buck configuration)
- I2C controlled 3 channels PWM for dimming leds
- 12 bit PWM, adjustable PWM frequency
- Dynamically adjustable current output (can be used for analog dimming as well)
- 42V input, 36V output. Drive up to 40W LEDs
- 5V switching power supplier (up to 42V input)
- Many shields can be stacked and only use two I2C pins (A4, A5) from arduino
- Optional temp sensor for monitor led temp and PCB temp
Application
- Interactive High Power LED lighting
Getting Started
The shield needs to be connected to the Arduino to set maximum current to LEDs and operation frequency. Then connect your power LEDs and power the shield.
Shield Layout
Connecting to Arduino
The shield designed to be stacked on top of the Arduino as any other shields for Arduino. When single shield is used, user may use regular 0.1 inch spaced header pins to stack on top of Arduino. When multiple shields are stacked on the top of each other, it is recommended to use stackable pins (http://www.sparkfun.com/products/10007). The shield can be stacked up to 100.
When the shield is used separate from Arduino, Analog In 4, 5, and GND need to be connected to Arduino for I2C communication. You can supply 5V power from Arduino, if the shield is not connected to power adaptor.
The shield use standard I2C communication protocol for entire operation. Any microcontroller or computer that has I2C master function can be used with shield. Once the shield is configured, the shield may operate as stand-alone.
Setting for Basic Operations
The proper maximum current to LED needs to be set depending on LEDs that the shield drives. Manufactures of LEDs have specification for maximum operation current for a LED. Generally, so called 1W white LED and 3W RGB LED have 350mA operation current. Philips Lumiled, Cree XP-E , and Osram Gold Dragon have 700mA maximum operation current. For details, please check the datasheet of the LED from the manufactures.
Download the shield version 2.0 library from the Google code(http://code.google.com/p/neuroelec/downloads/list) and install it to your sketch directory. You will find an example file that has the example for maximum current settings for each channel and operation frequency as follow. For the frequency, please check “Input Voltage and Operating Frequency” section.
1: #include <Wire.h>
2: #include <HPRGB2.h>
3:
4:
5: HPRGB ledShield; // default mcp4728 id(0) and default PCA9685 id(0)
6:
7: void setup()
8: {
9: ledShield.begin();
10: ledShield.setCurrent(350,350,350); // set maximum current for channel 1-3 (mA)
11: ledShield.setFreq(600);// operation frequency of the LED driver (KHz)
12: ledShield.eepromWrite();// write current settings to EEPROM
13: delay(100); // wait for EEPROM writing
14: }
15:
16:
17: void loop()
18: {
19: ledShield.goToRGB(255,255,255); delay (3000); //go to RGB color (white) now
20: ledShield.goToRGB12(4095,4095,4095); delay (3000); //go to 12bit RGB (white) now
21: ledShield.goToRGB(255,0,0); delay (3000); //go to RGB color (red)
22: ledShield.goToRGB(0,255,0); delay (3000);//go to RGB color (green)
23: ledShield.goToRGB(0,0,255); delay (3000); //go to RGB color (blue)
24: ledShield.goToHSB(0,0,255); delay (3000); //go to HSV color (Hue, Saturation, brightness)
25: }
Connecting LEDs to the Shield
Connector to LEDs are labeled as R (red, channel 1), G (green, channel 2), and B (blue, channel 3). When White LEDs are connected, just channel number is matter. Each channel has label for polarity (+,-). Right port of the channel is the GND. Connect the LEDs properly, otherwise you may damage LEDs.
When multiple LEDs connected to a channel, LEDs are recommended to connect in series. If multiple LEDs are configure as parallel, LEDs in parallel have to be exact same types of LEDs. Slight differences in voltage drop of LEDs may cause damage, so parallel connection of LEDs is highly undesirable.
Total 10 LEDs per channel can be connected to the shield depending on types of LED. The Input Voltage to LED is required to be higher than total output voltage to LED. “Input Voltage and Operating Frequency” section has detailed information for input voltage ranges.
Once LEDs are securely connected to shield, you can connect the power to the shield.
Power supply for the shield
The shield has a standard power connector (2.1mm pole) which should fit with majority of AC wall adaptors. The shield has on-board 300mA, 5V switching power supply and can be powered by 6-42V DC wall adaptor. Optionally, users may connect power adaptor to Arduino power jack, if input voltage is lower than 12V. The shield will get power from VIN pin of Arduino.
To protect Arduino from high voltage, the shield has a protection diode. VIN in the shield is not available in Arduino while the shield supplies 5V (about 200mA) to Arduino. Users may override protection diode for stacking shields using a jumper (JP1) next to the VIN pin. When the jumper is connected, users may consider bending or cutting VIN pin to Arduino for protection.
Dimming LEDs
The shield supports two dimming methods (analog and PWM dimming). User can choose one of them based on needs.
For general dimming such as RGB color mixing, PWM is recommended. The PCA9685 on the shield functions as an I2C PWM controller. The shield library support most PCA9685 functions such as 12 bit PWM and PWM frequency change. You can find detailed information of PCA9685 from NXP http://beta.nxp.com/products/interface_and_connectivity/i2c/i2c_led_display_control/PCA9685.html
Basic PWM commands are goToRGB and goToHSB. Both of them take 0-255 level dimming which is corrected for human brightness perception. You can directly use 12bit PWM with goToRGB12.
Input Voltage and Operating Frequency
LED driver part of the shield is buck switching regulator which requires higher input voltage than output voltage. Please find proper input voltage and operation frequency based on LEDs (Vf = 3.0 – 3.65).
Following table has recommended input voltage and recommended operating frequency based on number of LEDs in series per channel
If higher input voltage is used than recommend input voltage, operation frequency may require being higher than recommended operation frequency. Users can calculate exact operation frequency from the spreadsheet.
|
Current Rating |
Number of LEDs |
Input Voltages |
Recommanded Input Voltage |
Recommanded Operation Frequency |
|
350mA |
1 |
6-42V |
9 (>0.8A) |
600KHz |
|
350mA |
2 |
8-42V |
9 (>1.2A) |
600KHz |
|
350mA |
3 |
12-42V |
12 (>1.2A) |
600KHz |
|
350mA |
4 |
16-42V |
18 (>1.0A) |
800KHz |
|
350mA |
5 |
21-42V |
24 (>1.0A) |
1200KHz |
|
350mA |
6 |
26-42V |
28 (>1.0A) |
1300KHz |
|
350mA |
7 |
31-42V |
32 (>1.0A) |
1500KHz |
|
350mA |
8 |
36-42V |
36 (>1.0A) |
1700KHz |
|
700mA |
1 |
6-42V |
9 (>1.2A) |
330KHz |
|
700mA |
2 |
8-42V |
9 (>2.0A) |
330KHz |
|
700mA |
3 |
12-42V |
12 (>2.2A) |
330KHz |
|
700mA |
4 |
16-42V |
18 (>1.9A) |
400KHz |
|
700mA |
5 |
20-42V |
24 (>1.8A) |
600KHz |
|
700mA |
6 |
24-42V |
24 (>2.1A) |
600KHz |
Efficiency and Thermal Consideration
The shield has very efficient LED drivers which normally has 85-95% efficiency. Even though it is driving power LEDs at high efficiency, it will still dissipates heat. For example, when the shield power 30 watts of LEDs, it dissipate about 3 watts of heat from the shield at 90% efficiency. The shield gets warm or slightly hot (120-140ºF, 50-60ºC) which is completely normal. If users want to connect more than 40W of LEDs to the shield, shield require a heat sink on the top or bottom of the LED driver chip and temperate of the chip need to be monitored (should be lower than 100ºC). Since operation frequency of the LED driver effect heat dissipation, low operation frequency has to be used.
Stacking Shields
The shield is designed for easy of stacking. Regardless of the number of stacked shield, the shield use only two pins from the Arduino. Up to 8 shields can be stacked when analog dimming is used. When analog dimming is not required, 64 shields can be stacked theoretically. For stacking shield, I2C addresses of the chips need to be changed. There are two I2C chips, PCA9685 and mcp4728 on the shield.
Changing address of PCA9685 is done by changing jumper on back of the shield. Default device id of PCA9685 is 0. All jumpers are connected to –(GND) for device ID 0. There are 6 jumpers (A0-A5). Device ID is set by binary code of (A5-A0). For example, A0 = +, A1-A5 = – is 000001 (device ID = 1). A0,A1 = +, A2-A5 = – is 000010 (device ID =2).
Changing address of mcp4728 requires jumper for address change command. As in the image, LDAC jumper is normally connected to – (GND). For the address change command of mcp4728, the jumper needs to connect to + (pin D8). After changing LDAC jumper, load address change example from the shield library. It will let you change the address of mcp4728. Once address change is done, LDAC jumper need to be – (GND) again for normal operation.
Temperature Sensing
If you have the shield with temperature sensor(TMP421), users can acquire PCB and remote temperatures. TMP421 is located close to LT3496, so local temperature is co-related with LT3496 temperature (about 5-10 Celcius degree lower than LT3496 temperature). The shield come with five remote temperature sensors (2N3906). As in figure below, tie base and collector and connect it to “N” of the shield. The emitter of 2N3906 is connected to “P”. It is recommended to put resistors (50 ohms) and a capacitor(100pF) as a filter. For detail, please check the datasheet. The shield library has couple of commend to acquire temperatures, please check “temperature example” from the shield library.
Online Resources
- Shield Library
- Shield Design Explanation
http://neuroelec.com/2011/02/designing-rgb-led-shield-1-led-driver/
http://neuroelec.com/2011/02/designing-rgb-led-shield-2-dimming-leds/
http://neuroelec.com/2011/02/designing-rgb-led-shield-3-power-and-temp-sensor/
- Shield Schematics and Design
http://code.google.com/p/neuroelec/source/browse/#svn%2Ftrunk%2FHP_RGB_LED_Shield_V2
Manual Revision History
5/2/2011 Initial manual for version 2.0 shield
I got the shield a few weeks ago and now I got it connected to two 10W RGB LEDs. I’m pretty happy that I now can have colored lights in my room.
Today, I ran the following code on my setup. It’s supposed to produce gradual hue and saturation change, but what I found was lumpy saturation change — the color jumps from one color to another every few seconds. I looked at the definition of HPRGB::hsv_to_rgb() and saw that precision is being dropped on the saturation value, by dividing it by 16 before doing anything else with it. I’m not sure why they do it that way, but if (R, G, B) does no change smoothly w.r.t. S, then it seems that the conversion has a bug. 16 out of 256 possible values is a lot of precision to lose. Is this a known issue?
int16_t hue = 0;
int16_t saturation = 0;
const int16_t hueFactor = 10;
const int16_t saturationFactor = 77;
void loopHsv() {
ledShield.goToHSB(hue / hueFactor, abs(255 - saturation/ saturationFactor), 255);
++hue;
if (hue == hueFactor * 256)
hue = 0;
++saturation;
if (saturation == saturationFactor * 255 * 2)
saturation = 0;
delay(10);
}