Intelligent Control LED

WS2812B is a smart RGB LED light where the control circuit is built into the package together with the RGB diodes. In addition to VDD and GND pins, the package has only one data input pin and one data output pin. By connecting the data output pin to the data input pin of the next device, it is possible to daisy chain the LEDs.

The data to the controller logic is transferred using a single-line serial protocol. This protocol is not directly supported by any general microcontroller, but it is possible to emulate it by either bit banging the pattern or using hardware like the CCL. The data needed for each LED consists of 24 bits, eight bits for each of the RGB diodes.

The number of LEDs used in the application is by default 16 and can be adjusted in the code by changing the Number_of_LEDS variable in the application code. These LEDs draw a lot of power, especially when white light is used with high intensity. Care must be taken to ensure that the power supply can handle the number of LEDs used.

A WS2812B-16 board was used for this demo.

Figure 1. WS2812B-16 Board

There is one data line and the protocol is timing sensitive. The details can be found in the WS2812B data sheet.