1x 1 Channel WS2812 5050 RGB LED Module
The WS2812 is an RGB LED with a WS2811 control IC built right into the LED. This really blew our minds to see the control IC of an individually addressable RGB LED was moved into the actual LED, so we wanted to offer this amazing product to you! They’re great when you need a lot of color from not a lot of board space, now more so than ever.
- Viewing angle: 120 degrees
- Red: (620-630nm) @ 550-700mcd
- Green: (515-530nm) @ 1100-1400mcd
- Blue: (465-475nm) @ 200-400mcd
- DI: Data from a microcontroller (or another WS2812 pixel) comes into this pin
- 5V: This should be a regulated supply voltage between 5V and about 7V. More than that could harm the LED, less than 5V will either reduce brightness, or it just won’t turn on.
- GND: The common, ground, 0V reference supply voltage.
- DO: Data is shifted out of this pin, to be connected to the input of another pixel or left floating if it is the last link in the chain.
Note: this stuff is ugly, and not critical to understand if you just want to use the breakout board. (That’s what libraries are for, right?!) It’s interesting to talk about, because the interface is so unique.
The communication interface between a microcontroller and the WS2812 is weird. It’s one wire, but it’s not like a standard, UART serial interface. This interface is very time-specific. Both a logic 0 and a logic 1 require a square pulse, and it’s the length of the pulse that defines which it is.
Timing diagram for a single bit of value 0 or 1.
The data is sent in a sequence containing 24 of those bits – 8 bits for each color – followed by a low “reset” pulse of at least 50µs.
A sequence of 24 timed-bits sets the color for each channel. 8-bits per channel. Green first, then red, then blue.
The larger the value of a specific color is, the brighter it will be. If every color is set to 0, the LED will be off. If every color is set to max – 255 – the LED will be as bright and white as can be.
This is all to say that the interface is very time-specific. To run the LEDs you’ll need a real-time processor, like an Arduino; microprocessors like those on the Raspberry Pi or pcDuino can’t give you a reliably-timed pulse. Even if one bit is less than a microsecond off, that could mean the difference between purple and maroon.
Last Updated @ 5/22/2018 7:24:29 PM