ST AN2531 Application note

AN2531
Application note
Generating multicolor light using RGB LEDs
Introduction
The new high power and brightness RGB LEDs are coming to be used in many different lighting applications as backlighting, general lighting systems, traffic signals, automotive lighting, advertising signs, etc. They are becoming popular mainly because it is possible to generate an easy multicolor light with special lighting effects and their brightness can be easy changed. On top of this, their long lif etime and small siz e make them the light source of the future.
This document describes how to drive RGB LEDs, how to calculate a power dissipation, how to design an over temperature protection, how to use a software PWM modulation and why over voltage protection should be implemen ted for this kind of application.
STEVAL-ILL009V1 reference board shown in Figure 1 was developed in order to demonstrate this design concept. This board was designed f o r driving super high brightness multicolor RGB LEDs with current up to 700 mA per L ED. The LED brightness and color can be very easy changed by potentiometers a nd an automatic color change mode continuously modulates the color of the LED to generate multicolor light. The LED over-temperature protection is designed on this board and therefore the power delivered to the LED can be automatically limited to prevent LED overheating.
The STEVAL-ILL009V1 is a mother board assembled without LEDs. To evalua te light effect features, it is ne cessary to order a load board (additional board wit h assembled RGB LEDs). Two load boards are available for easy performance evaluation. The first one with the OSTAR Projection Module (refer to Chapter 11, point 1) has ordering code STEVAL­ILL009V3 and the second one with the Golden Dragon LEDs (refer to Chapter 11, point 2) has ordering code STEVAL-ILL009V4. All technical information about these reference boards such as bill of materials, schematics, software, temperature protection and so on are described in the sections below.

Figure 1. STEVAL-ILL009V1 reference board

May 2007 Rev 1 1/37
www.st.com
Contents AN2531
Contents
1 Driving concept for RGB LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 How to drive many LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 How to set high current for LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Color control - software modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
5 Power dissipation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
6 Over-voltage protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
6.2 Type of solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
7 LED temperature protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
8 STEVAL-ILL009V1 reference board . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
8.2 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.3 Schematic description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8.4 Bill of materials (BOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
8.5 Design calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.5.1 LED supply voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.5.2 Temperature protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
8.5.3 SW PWM frequency calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.6 Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9 STEVAL-ILL009V3 Load board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
9.1 Schematic description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
9.2 Bill of materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
10 STEVAL-ILL009V4 Load board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
10.1 Schematic description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
10.2 Bill of materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2/37
AN2531 Contents
11 Reference and related materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
12 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3/37
List of tables AN2531
List of tables
Table 1. BOM - STEVAL-ILL009V1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Table 2. Temperature limit setting using STLM20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 3. Temperature limit setting using NTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Table 4. STEVAL-ILL009V3 bill of materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 5. STEVAL-ILL009V4 bill of materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Table 6. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4/37
AN2531 List of figures
List of figures
Figure 1. STEVAL-ILL009V1 reference board. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Figure 2. Driving concept for RGB LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Figure 3. LED driver connection - serial configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Figure 4. LED driver connection - parallel configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 5. Common drain configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 6. Software brightness modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 7. RGB LED configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 8. Over-voltage on STP04CM596. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 9. Possible over voltage protections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 10. Temperature protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 11. Components position on the STEVAL-ILL009V1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 12. STEVAL-ILL009V1 schematics - LED drivers part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Figure 13. STEVAL-ILL009V1 power sources schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 14. Send data time diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 15. Main program flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 16. Blink function flowchart - first part. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 17. Blink function flowchart - second part. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Figure 18. Manual color modulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 19. Blink function flowchart - third part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 20. STEVAL-ILL009V3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 21. STEVAL-ILL009V3 schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 22. STEVAL-ILL009V4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 23. STEVAL-ILL009V4 schematic diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5/37
Driving concept for RGB LEDs AN2531

1 Driving concept for RGB LEDs

RGB refers to the three primary colors, red, green, and blue. Different colors can be generated by controlling the power to each LED. In this application, the microcontroller provides three software PWM signals (principle is described below in Chapter 4) for L ED drivers STP04CM596 so the color can be regulated.
The STP04CM596 is a high-power LED driver with 4- bit shift register designed for power LED applications. In the output stage, four regulated current sources provide 80-500 mA constant current to drive high power LEDs.
Figure 2 shows the driving concept for RGB LEDs using an STP04CM596 LED driver. The
LED supply voltage is conn ected to anode s of RGB L ED and LEDs cathodes a re connected to the ground through constant current sources. The supply voltage value is very important due to the power dissipation on drivers (detail explanation is described in Chapter 5).
The value of the constant current is set by only one e xternal resistor for all the four driver channels. The control unit in this application is a microcontroller, which sends data through serial peripheral interface (SPI) to the shift registers inside STP04CM596. The data are shifted bit by bit to the next driv ers in a cascade with falling edge of the clock frequency (the maximum communication frequency for this drivers is 25 MHz). When all data are transmitted to the drivers through SPI, the micro sets latch input terminal (LE) pin “log 1" to rewrite the data to the storage registers and to turn on or off the LEDs. More details on timings and features are available in Application Note AN2141 (refer to Chapter 11, point 3) and Datasheet of the STP04CM596 (refer to Chapter 11, point 4).
Temperature protection is designed in order to protect LEDs and increase their lifetime. A sensor (STLM20) is assembled close to the RGB LEDs and informs the microcontroller about RGB LED temperature. If the tem perature is abov e its limit, the microcontroller decreases LED brightness (LED power) through PWM signal.
An easy and user friendly hardware interface (potentiometers and b u ttons) w as de signed t o demonstrate fe atures such as color set, brightness regulation, mode changes, etc.

Figure 2. Driving concept for RGB LEDs

IC supply
voltage
CONTROL PANEL
SPI
MODE
Micro
COLOR
STP04CM596
Control
and
logic
part
Constant
current
I - reg.
LED supply
voltage
Temperature sensor
Full color pixel
6/37
AI12675
AN2531 How to drive many LEDs

2 How to drive many LEDs

In several applications not only one RGB LED, but many of them must be driven. There are at least two possible ways to drive many RGB LEDs using the STP04CM5 96 LED driver, depending on the specific lighting application.
If the request is to control each RGB LED independently, a serial configuration (drivers in cascade connection) must be used as shown in Figure 3. The data are sent thr ough all LE D drivers via the SPI and then latched to the outputs. The main advantage is that current in each channel can be regulated by software PWM modulation, which in fact means color control of each RGB LED. The disadvantage of this solution is lower PWM resolution for a higher number of RGB LEDs, because it needs time to send data to all drivers. More information about this principle is described in Chapter 4: Color control - software
modulation.
If the request is to build up a high power light with many LEDs of the same color, drivers can be connected in parallel as shown in Figure4. Main advantages are a simpler solution and better PWM resolution, because only four bits are sent through the SPI and it takes a short time. Color is also regulated by software PWM signals as described in Chapter 4.
Note: It is also possible to mix serial and parallel config urations in order to provide se v eral diff erent
colors with high lighting power . For e xample , two diff erent colors using 10 RGB LEDs can be implemented using two STP04CM596 connected in series and five such blocks connected in parallel.

Figure 3. LED driver connection - serial configuration

SPI
Micro
STP04CM596
Control
and
logic
part
LED supply
voltage
Serial connection
SPI
STP04CM596
Control
and
logic
part
AI12687
7/37
How to drive many LEDs AN2531

Figure 4. LED driver connection - parallel configuration

SPI
Micro
LED supply
voltage
STP04CM596
Control
and
logic
part
Parallel connection
STP04CM596
Control
and
logic
part
AI12676
8/37
AN2531 How to set high current for LEDs

3 How to set high current for LEDs

The STP04CM596 is focused on driving high brightness and power LEDs and its output constant current can be set between 80 and 500 mA. In case a LED with even higher current is used, there is still a solution to control such LED using the STP04CM596. Thanks to a common drain configuration, th e outputs can be connected together as shown in
Figure 5. This increases the performance and current capability of this driver. This
configuration allows driving the whole range of HB LEDs available on the market. For example, this principle is also used in the STEVAL-ILL009V1 presented in this application note, because the board has maximum current capability of 700 mA (2 channels x 350 mA).

Figure 5. Common drain configuration

STP04CM596
I-REG
R
ext
V
o
V
f
+ V
c
V
o
V
o
AI12677
9/37
Color control - software modulation AN2531

4 Color control - software modulation

Software control modulation allows adjusting power to each channel of the STP04CM596 driver (i.e. LED brightness). Figure 6 explains the principle sho wing an example of how to set an 8% duty cycle for red, 28% duty cycle for blue, 6 % duty cycle f or green and 98% duty cycle for a fo urth LED. For one comp lete dimming cycle, the microcontroller sends a certain number of “0”s and “1”s to each LED. First, the microcontroller sends four bits in “logical 1" (i.e. 1111b or Fh) to the driver in order to turn ON all the output channels. Then microcontroller sends the same data (1111) until an output should be turned OFF (depending on desired preset color). (Each bit of the 4-bit frame controlling its corresponding output.) In this example, it is output 3 with green LED (6% duty cycle required). From that moment, the microcontroller keeps sending 1101. In the next step the output 1 with red LED (8% duty cycle) should be turned OFF and so data frame changes to
0101. This frame is sent until output 2 with blue LED (28% duty cycle) should be turned OFF and when the frame 0001 is used. Finally, the output 4 with another LED (usually second green LED) is turned OFF with 98% duty cycle, which means than 0000 is being sent until maximum time for one cycle is reached. After that, the entire period for all outputs can start again.

Figure 6. Software brightness modulation

T
SW_PWM
1111 1111 or new data1101 0101 0001 0000
DATA
T SEND_DATA
Output 1
Output 2
Output 3
Output 4
LEVELS
t
8 % Duty Cycle
t
28 Duty Cycle
t
6 % Duty Cycle
t
98 % Duty Cycle
AI12678
The resolution of the LED dimming defines how many steps are possible to change the duty cycle from 0% to 100% (e.g. 6-bit means 64 steps; 7-bit means 128 steps and so on). It is obvious that it is preferred to design the control signal with a resolution as high as possible, but several limitations should be taken into account. Limitations concern mainly the speed of the serial communication interface inside the microcontroller (SPI) and the general calculation power of the microcontroller. First, the general LED frequency should be
10/37
AN2531 Color control - software modulation
selected. This value is recommended to be above 100 Hz in order to avoid flickering as at 100 Hz and above it is not detected by the human eye and is considered as a stable light. Using Equation 1 and Equation 2, the resolution can be obtained as shown in Equation 3.
Equation 1
t =
SW_PWM
Equation 2
t
SEND_DATA
Equation 3
LEVELS
In order to have a good resolution, the time for sending data (t as possible. In an ideal case, this time takes into account the number of sent bits and the speed of the SPI clock (one bit is sent during one SPI period). As described in Figure 6, the number of sent bits corresponds to the number of driven LEDs , therefore in Equat ion 4, the number of driven LEDs is the same as number o f bits sent (BITS = LEDS).
Equation 4
t
SEND_DATA
=
BITS
f
SPI_CLK
1
f
SW_PWM
t
SW_PWM
=
LEVELS
×
SPI_CLK
1
tf
SEND_DATASW_PWM
SEND_DATA
BITSt
×==
) must be as short
The maximum number of used LEDs is (assumption BITS = LEDS):
Equation 5
LEDS
Note: The above calculation is only v alid only when the da ta are sent to the driv er throug h the SPI
without any delay. This means the data (BYTES) are sent thought the SPI and at the end of this communication the next data (BYTES) are immediately sent, etc. In case the data are sent through the SPI and then microcontroller executes some other instructions (checking temperature , checking ADC in or der to set next PWM signal, et c.), the period (t resolution.
SEND_DATA
) for sending data is longer and it decreases the real maximum
=
11/37
1
LEVELStf
SPI_CLKSW_PWM
××
Power dissipation AN2531
()(
)
(
)
+
+

5 Power dissipation

The maximum power dissipation can be calcula ted with ambient temperature and thermal resistance of the chip. The thermal resistance depends on the type of package and can be found together with maximum junction temperatur e in the datasheet. The maximum allowable power consumption without a heatsink is calculated as follows:
Equation 6
TT
P =
dmax
P
……. maximum power dissipation [W]
d max
T
……….…. ambient temperature [°C]
a
T
……... maximum junction temperature [°C]
j max
R
………. junction to ambient thermal resistance [°C/W].
thja
A high power RGB LED is in fact driven in linear mode with STP LED driver family. The current flowing through each chann el of the LED drive r is const ant and so p o wer d issipation depends on the voltage on each channel, which is the diffe rence between the su pply voltage (DC bus) and the forward voltage drop on the LEDs. Therefore it is recommended to keep the supply voltage as lo w a s possible, but alw ays abov e th e maxim um LED forward voltage.
Figure 7 shows the RGB LED connection to the driver . Total power dissipation in this case is
calculated using the following equation:
R
ajmax
thja
Equation 7
=
P
……….…….power dissipation on chip [W]
tot
I…………………constant LED current set by external resistor [A] V
………………LED supply voltage [V]
c
V
………….red LED forward voltage [V]
f_red
V
….…….blue LED forward voltage [V]
f_blue
V
……....green LED forward voltage [V].
f_green
VVI*2VV*IVV*IP
f_greenCf_blueCf_redCtot
12/37
Loading...
+ 25 hidden pages