Automatic gradual dimming with multi-LED controllers
Here’s how you can control independent LEDs with a driver that focuses on gradual dimming
BY MICHAEL BAIRANZADE
ON Semiconductor
Phoenix, AZ
http://www.onsemi.com
Today’s drivers with two or more independent LEDs (ILEDs) can control a portable system’s fun light (multiple light sequences with several colored LEDs to make a phone, say, more attractive to a user). Not only is the ILED’s peak current fully programmable, but each LED can be dimmed to any value between 0% and 100%.
Moreover, the embedded gradual dimming function, operating in both upward and downward directions, provides an easy way to generate the special illumination sequences requested by the end customer. This article shows the behavior of such a driver with a focus on the gradual dimming, based on a typical application. In addition, the associated software is provided as an example.
Basic analog operation
Generally speaking, the LED driver provides a constant current to bias the LED in the appropriate condition. If you consider the portable system, the power source is a battery with an output voltage ranging from 2.8 to 4.2 V (assuming you use a standard Li-ion battery). Since the forward voltage of the modern, low-power LED varies between 2.8 and 3.5 V, depending on the bias current and room temperature, an interface is necessary to make sure the LED is properly biased during the normal operation. This is the purpose of the driver IC. The first block to consider is the voltage span of the current control system.
At this point, we can consider connecting the LED in parallel or in series: both structures have advantages and drawbacks (see table ).
Comparison of parallel and series LED connections
Structure | Converter | I-LED modulation | PCB Routing | Current matching | Efficiency | EMI |
Series | Boost | Common, not easy to setup separate LED | Simple | intrinsic | Good if Nbr of LED >3 | Careful inductor selection and PCB layout mandatory |
Parallel | Charge Pump | Independent: | ||||
LED by LED | Complex | Needs accurate current mirrors | Medium to good | Good ceramic capacitor and PCB layout | ||
The key point is the capability to independently and dynamically adjust the brightness of each LED in a color application. Although it is possible to use a boost structure, with switches connected across each LED to control them, the series arrangement is not the preferred solution and a parallel structure is easiest to implement.
The charge pump is the most appropriate dc/dc converter to generate a low voltage together with a minimum of EMI issues. On the other hand, using multimode operation (1X, 1.5X, 2X ) provides a net efficiency improvement, making the system capable of saving as much energy as possible when running in portable devices.
Besides the dc/dc converter, the second key parameter is the current matching between the LED belonging to a common bank: an RGB structure cannot accommodate the bias current difference between the LED because it will translate into color rendering in the video and photo displays. The problem is solved by using a set of accurate current mirrors.
To achieve an accurate and stable forward bias condition in the LED, a reference current is generated by means of the external resistor associated to a constant voltage sourced from a band-gap reference. Transistor Q1 (see Fig. 1 ), associated to the operational amplifier U1 , yields a constant output voltage at the Vref pin.
The external resistor, connected across Vref and ground, creates a constant current flow through transistor Q1 and Q2 . This current is now mirrored and amplified by the set of transistors Q3 to Q7 , each current being connected with switches S1 to S5 , and summed by transistor Q8 .
Finally, transistor Q9 copies the reference current into LED1 . Such a structure is duplicated for each LED, the layout of the chip being carefully analyzed to optimize the matching between each LED.
Fig. 1. Typical independent PWM control.
As a consequence, every LED shares the same ILED peak, and extra electronic circuits are necessary to independently control the brightness of each LED. Such a function is achieved by using an independent PWM modulation for each LED.
Switches S6 to S8 , controlled by the digital signals PWM1 to PWM3 , turn on/off the associated current mirrors, thus generating a brightness control of the associated LED. The net advantage is a constant-peak current in the LED, making sure the color rendering is not downgraded by the brightness control the operating point of the LED stays in the reference color defined by the color map (see Fig. 2 ).
The waveforms, coming from an industrial application, shown in Fig. 2, illustrate the behavior of the three PWMs embedded into the selected device. The three LEDs are controlled by a common low-frequency clock with a duty-cycle setup to cope for a given application. Obviously, one can reduce or increase each of the PWMs independently, ranging from a 0% to 100% duty cycle, with the ILED peak remaining constant.
A more complex circuit can be designed to get a full independent control of the LED. For example, both the ILED peak and the PWM can be digitally programmed, yielding an almost infinite color range and brightness since the ILED peak moves in the color map.
Fig. 2. Typical industrial PWM operation.
Digital control
The standard I2 C port is used to preset the ILED and the PWM, using software to program the functions built inside the controller. In order to better illustrate the gradual dimming, the NCP5623 controller will be used as a reference example to depict the operation of the functions.
Before the pulse-width modulation can take place, the ILED peak current must be set up by sending the appropriate code to the chip as defined in the NCP5623 data sheet. To create a smooth illumination ramp up, the software should send the total usable steps with the driver: in this example, there are 31 steps. A simple loop can be implemented in the MCU to handle such a task, but the ramp might be polluted due to the priority interrupts associated with the real-time system.
The NCP5623 has a built-in sequence, avoiding the need for a real-time operation of the MCU. The gradual dimming, either upward or downward can be launched with a very limited software effort and no influence from the high-priority interrupts.
Basically, two internal registers need to be preset:
The target and direction of the gradual dimming:
UPWARD = %101x xxxx the last bits [B4:B0] contain the upward final ILED target
DWNWRD = %110x xxxx the last bits [B5:B0] contain the downward final ILED target
The timing and start condition:
GRAD = %111x xxxx the last bits [B5:B0] contain the timing per step
The ILED current will increase smoothly from zero to 5.5 mA, the total sequence timing is equal to the content of the GRAD register bits [B5:B0] multiplied by the number of steps defined by the UPWARD register. Using the example above, the sequence timing is
T = GRAD [B5:B0] * UPWARD[B5:B0]
T = 64* 26 = 1664 ms
The waveform given in Fig. 3 illustrates the upward gradual dimming; the downward operation is achieved by programming the DWNWRD register appropriately.
Fig. 3. Typical NCP5623 automatic upward gradual dimming with 8 ms/step.
As you can see, the ILED current increases with a quasi exponential curve, which is good enough to compensate for the sensitivity of the human eye. The opposite direction is easily implemented by using the appropriate code in the high three bits of the data register, the rest of the sequence being identical.
The built-in registers make possible the dynamic control of the gradual dimming to emulate various visual effects. For example, one can repeat a sequence created by a digital modulation of the up and down period.
It is also possible to create a saw tooth like waveform by combining one of the gradual dimming with an abrupt variation for the opposite side of the waveform.
Finally, a fairly complex light sequence can be created by combining the gradual dimming with the PWM embedded into the chip and a modulation of the ILED peak by means of the IREF pin. Now you have a fun light system that is built with a minimum of passive parts around the main controller.
For more information on LED controllers, visit http://www2.electronicproducts.com/AnalogMixICs.aspx.
Learn more about ON Semiconductor