Advertisement

Using small MCUs for color control of LED lighting apps

Using small MCUs for color control of LED lighting apps

A sensor, required MCU resources, and software all play a role

BY STEVE BOWLING and JON MARTIS
Microchip Technology, Chandler, AZ
http://www.microchip.com

The adoption of LEDs for general lighting is just around the corner. LEDs offer many advantages in general illumination systems, including longer lifetimes and greater efficiency, but they present some challenges as well.

One challenge has to do with the generation of high-quality white light. A white LED is constructed using a blue LED and a phosphor to shift the light output to other parts of the spectrum. Many white LEDs cannot yield a high color-rendering index (CRI), which is a measure of the ability of the light source to faithfully reproduce all colors.

MCU peripherals

Systems with a better quality of white light can be created by mixing the light from two or more LED colors. In these multicolor systems, the light output from each color source drifts with age and temperature. A light sensor and a small microcontroller (MCU) can be used to maintain a specific color or correlated color temperature (CCT). In this article, we’ll take a closer look at the sensor, required MCU resources, and software.

Small, cost-effective light sensors are available that provide information to an MCU for processing. Typically, the sensor has selectable color filters to measure red, green, blue, or white (no filter) light.

The light sensor output interface can connect to the MCU using a variety of methods. Light-to-voltage sensors use voltage outputs that are connected to an A/D converter.

Light-to-frequency sensors provide a variable-frequency output, where the frequency is proportional to the amount of light. The pulse output from these sensors can be accumulated in a MCU timer to determine the light level. Light-to-digital sensors typically have a serial digital interface, such as I2 C.

Each type of sensor interface has unique advantages and requires different MCU resources. The system block diagram (see Fig. 1 ) illustrates the many MCU peripherals that are useful in a tunable color LED lighting design.

Using small MCUs for color control of LED lighting apps

Fig. 1. MCU peripherals are useful for LED color-control systems.

In a complete closed-loop color-control system, the MCU must read the component colors from the light sensor, calibrate the light sensor output, and adjust the output of the individual LED drivers to achieve the desired color. The LEDs require constant-current drivers to maintain a consistent light output.

A variety of driver technologies may be used, including linear and switch-mode solutions. The final choice depends on factors such as efficiency requirements, input voltage range, and the number of LEDs used.

Different methods may be used to control the driver output. First, the MCU can generate an analog reference voltage using a D/A converter or a digital potentiometer. The reference voltage varies the driver output between zero and a maximum current level.

The MCU can also provide PWM signals that are used to modulate the driver output. The PWM signal can enable/disable the driver itself, or it can control a switch that disconnects the LEDs from the driver output. If PWM control is used, the PWM frequency is chosen to be high enough so that the human eye cannot detect any flickering.

The designer must decide how much control resolution is required in a color control system to select a MCU with the proper peripherals. For a light-to-voltage sensor, the measurement resolution of the ADC on the MCU will be important.

A light-to-frequency sensor requires an MCU timebase that can be incremented using an external clock. Light-to-digital sensors will require an appropriate serial communications interface peripheral.

An MCU with multiple PWM peripherals is useful for controlling the individual LED drivers. In high-resolution color-control systems, a PWM peripheral with 16 bits of control resolution or better is preferred. Serial communication peripherals, such as UARTs, SPI, I2 C, LIN, and USB to name a few, enable input/output control and display functionality.

Using small MCUs for color control of LED lighting apps

Fig. 2. A MCU with multiple PWM peripherals is useful for controlling the individual LED drivers.

As examples, a device like the PIC24FJ16GA002 (see Fig. 2) is a good candidate for the MCU in a color-control system. The PIC24 device comes in small 28-pin packages with program memory ranging from 16 to 64 Kbytes. It provides serial communication interfaces, 10-bit ADC and five PWM channels in one device. The 16-bit MCU core easily handles the mathematics associated with the sensor calibration and color control.

The sensor data output must be calibrated against a reference in order to provide consistent results. The calibration process uses a chroma meter to mathematically correlate the output of the different color LEDs and the spectral response and sensitivity of the light sensor to a standard color-coordinate system, established in 1931 by the International Commission on Illumination (CIE), the CIE XYZ color space. The calibration process generates a matrix of coefficients that must be stored in nonvolatile memory with the luminary system and will be used to determine the difference between correlated and the desired output each pass through the control system.

Once calibrated, the MCU can compare sensor data against desired coordinates on the CIE chromaticity plot and make adjustments to the output channels until desired CCT is achieved. A PID control algorithm for each output channel adjusts sensor data with the calibration values, evaluates the difference to target setpoint and adjusts the output channels.

The PID runs continuously to reduce the error until the output CCT matches the setpoint CCT. PID coefficients can be tuned to maximize the response of the system, but how quickly the PID algorithm can converge on the target is also a function of the MCU’s efficiency in processing the mathematical demand. Some color-control systems may require faster processing and response time than others. For example, general illumination systems are less demanding than a local dimming system for HDTV panels.

User control requirements

Systems that require an adjustable light source or one with high CRI can have a wide range of user control requirements. A medical device with a graphical LCD may have a tunable LED backlight requiring the MCU to communicate to the LCD over SPI, as well as a touchscreen interface for adjusting the CCT and brightness.

General illumination lighting for a commercial display case may require control from a central panel or computer to automatically adjust brightness, CCT, and on/off control based on the time of day. Communication between these devices may be implemented using hard-wired serial bus protocols such as DALI or DMX512, while others may use a custom interface over USB or Ethernet. In an existing building, installing a hard-wired infrastructure may not be feasible, requiring wireless communications and a protocol such as ZigBee for control. An MCU with flexible peripherals is an ideal host to implement the communication and user interfaces for these types of lighting applications.

The candle, kerosene lantern, and incandescent light bulb are light-source technologies that replaced previous technologies and enhanced people’s lives. The adoption of LEDs as a light source is just around the corner and is expected to enrich our lives more than any other light source.

The LED provides energy efficiency, compact size, portability, durability and long life. Multicolor LEDs under the control of a small MCU will tune the light output, providing a very pleasant light that is suitable for the illuminated space. The MCU intelligently controls the driver circuit maximizing efficacy, monitors conditions, and maximizes energy efficiency and life expectancy. MCU color-controlled LED lighting systems are expected to enable people to see things in a light unlike any other.

For more information, refer to Microchip Application Note AN1257, “Closed Loop Chromaticity Control: Interfacing a Digital RGB Color Sensor to a PIC24 MCU.” The application note and more information about “MCU Peripherals Useful for LED Color-Control Systems” can be found under “Color Control Solutions” at Microchip’s online Intelligent Lighting Design Center, http://www.microchip.com/lighting. ■

Advertisement



Learn more about Microchip Technology

Leave a Reply