Controlling RGB LEDs For Next-gen Lighting


Modern architectural lighting and video displays deal with millions of colors and brightness levels. Flashing the LEDs is simply not enough. Designers are looking for a solution to accurately mix adequate combinations of red, green and blue to create a wide range of colors. RGB LEDs are simple, great devices for such design needs and open up a number of possibilities for lighting applications such as traffic signals, general lighting systems, automotive lighting, advertising signs, LcD backlights, and more

Pulse Width Modulation

Confused what RGB lighting means? In RGB, the “R” stands for red, the “G” stands for green and the “B” stands for blue.  These three colors when combined, and varied in intensity, have the ability to produce millions different colors!


An appropriate mixing proportion of red, green and blue can create a color out of endless colors available in the RGB spectrum. To create a color to use, an efficient and simple method is Pulse Width Modulation (PWM) which controls average current flowing through each LED (red, green and blue) of a RGB LED between 0% and 100%, which varies its brightness level from zero brightness to full brightness.

To believe this, let’s take an example of a display with 12-bit resolution. Each pixel in a color display is composed of three LEDs (red, green and blue) and all three LEDs can use any of the 2^12 or 4096 different levels or shades, making a RGB cluster with  68.7 billion colors (4096 × 4096 × 4096 = 68.7 billion).

PWM Duty Cycle

If, over a time duration, we turn on the LED for 50% and off for 50% of the time, the LED will appear half as bright since its total light output is only half of the maximum output. The percentage of time period for which the LED is ON during one cycle (50% in this case) is known as duty cycle. By varying (or ‘modulating’) the PWM duty cycle or ON time of pulse, we can effectively control the LED’s brightness. Hence the term “PWM” or Pulse Width Modulation.


PWM Speed and PWM Resolution

When using PWM, the switching speed of LED or PWM frequency should be generally greater than 100 Hz to keep the user from seeing the LED turn on and off. Flicker is eliminated above 100 Hz and the observer can only see a constant brightness. Another important factor in PWM is “PWM resolution” which affects the total number of colors available in a video display. PWM resolution dictates the number of brightness levels which can be displayed between 0% and 100%.

ON Semiconductor's Connected Lighting Platform For Smart LED

In a high-quality, full-color video display, the PWM resolution is number of brightness levels available for each of the RGB LEDs that make up a single pixel in a overall display. For instance, 12-bits of resolution provides 2^12 o or 4096 shades or brightness levels for each LED. With each pixel in a color display composed of three LEDs (red, green and blue), each of these LEDs can be driven to any of these 4096 levels rendering a RGB cluster capable of a billion of clusters (4096 × 4096 × 4096 = 68.7 billion colors).

Generating PWM signals Using MCUs and LED Drivers

Increasing number of RGB LEDs in handsets, portable consumer devices and architectural lighting systems creates many challenges for the designers. The most significant challenge is how to drive all of these LEDs efficiently, cost-effectively, and in the smallest solution size. Others are power consumption, control interface/programmability and EMI.
Intelligent RGB lighting is “intelligent” since it uses some sort of controller to handle the color changes. MCUs (microcontroller)  optimise space, cost and time, and also add flexibility to monitor and control the LEDs with user interfaces on a personal computer.
It is sometimes convenient to use the dedicated PWM modules of the MCUs for generating the PWM signals to drive the RGB LEDs. Since MCUs have limited PWM peripherals, additional PWM signals may be generated using software and I/O pins. Three MCU pins can drive one RGB LED. However, more sophisticated control is required in applications which involve a large number of RGB LEDs and smooth transitions between different colors. 
For complex LED lighting designs, designers of displays are moving towards high-end LED drivers with integrated PWM functionality to provide thousands of brightness levels. Modern LED drivers using PWM dimming overcome the color-shift problem of conventional LED drivers which used analog dimming. PWM LED drivers often come with multiple PWM channels (for example, 12, 16 or 24 channels) controlled by some controller via serial interface. Multiple drivers may be combined to meet an application’s requirements.
RGB lighting applications such as architectural lighting, gaming and portable devices normally leverage a single 2-wire I2C bus to connect a large number of components. Complex lighting sequences are written on the internal memory of the LED drivers which can be started using an external trigger pin or I2C write. Communication via I2C also results in smaller and less-expensive PCBs by offering flexibility for controlling an LED driver by a controller via only 2 wires.

The following section discusses interesting reference designs on RGB LEDs controlled by microcontrollers and LED drivers along with complete documentation. Take a look!

  • Low-cost RGB LED Solution with GUI control: This reference design presents a low-cost solution to add fully-controlled RGB LEDs into any type of design. Complete control over RGB LEDs parameters including – color, blink rate, brightness and breathing (turn on/turn off speed) is allowed. Using an SPI interface and software GUI, users can control all four RGB LED control functions from a MAC or Windows PC via a USB cable. Documentation with schematics, user guides, and more is available. Hardware evaluation board options are available to test and evaluate the RGB LED reference design. More on this Reference Design
  • RGB Fun-lighting with LED Driver and MCU: This reference design uses the ADP5520 LED Driver to drive up to 6 LEDs in series and a RGB LED. A microcontroller sends the signal to the LED driver ADP5520 using the I2C bus to show backlight fade in/out, backlight dim, ambient light sensing, and RGB fun-lighting features. More on this Reference Design
  • RGB LED Driver for a Portable Projector: This is a reference design for a 6A step-down LED driver for a portable projector. The LED driver uses the MAX16821, a PWM HB LED driver to step-down a 10V to 15V input supply voltage to drive a constant current to an LED with a 4.5V to 6V forward voltage. This circuit drives a single LED and three MAX16821 devices are required to drive RGB LEDs. This design requires the LED current to rise/fall within 1µs during PWM at a 6A LED current. The design includes the circuit specifications, circuit schematic, and circuit description and performance. More on this Reference Design
  • LED Lighting Control for Architectural Lighting: This reference design describes a multi-color LED lighting control solution by using the MC9S08AW60 Microcontroller. The MCU allows easier development of code for LED control applications, architectural/entertainment lighting or LCD backlighting. The system consists of a MCU control board and a LED driving board. The separated LED light-box with driving circuitries is also available as a whole demo kit to demonstrate how to do the color mixing and see the visual effects on changing different type of parameter settings. The MCU is responsible for controlling timer channels for the RGB LED color PWM output and communicating with the host PC for receiving command and data input/output. More on this Reference Design
  • RGB LED Indication Control by MCU: Here is a reference design that offers a solution to control a RGB tri-color LED. The design can be used where multi-colored LED indication is required. The design uses P-FETs to source LED current directly from VCC supply. Other features included are an independent control of color and brightness, support for 512 unique colors and 50 brightness levels, and a serial interface to externally control the RGB LED. The design uses software PWM generation using the MSP430G2553 MCU from TI. More on this Reference Design
  • Generating multicolor light using LED Driver and MCU: This reference design can drive super high brightness multicolor RGB LEDs with current up to 700 mA per LED. Different colors can be generated by controlling the power to red, green and blue LEDs. In this application, the microcontroller ST7FLITE09Y0M6 from ST Microelectronics provides three software PWM signals for LED drivers STP04CM596 so the color can be regulated. The LED over temperature protection is designed to limit power delivered to the LED automatically to prevent LED overheating. More on this Reference Design


Please enter your comment!
Please enter your name here

Are you human? *