-40%
RGB LED Breakout Board, WS2812, Serial Controlled, Chainable
$ 2.61
- Description
- Size Guide
Description
RGB LED Breakout Board, WS2812, Serial Controlled, ChainableImportant Note on Shipping Delays via United States Postal Service: Currently we see significant delays in shipments via USPS, up to 3 weeks (!) to deliver within the USA. If you need your item fast, we suggest you select Fedex shipping upon checkout, instead of the standard USPS shipping.
BOB-11820
This board features a WS2812 integrated RGB LED and controller IC. The pins of the WS2812 are broken out to 0.1"-spaced headers for easy use.
The WS2812 operates on 4V to 7V DC and communicates via a unique one-wire interface. It's chainable, so the output of one LED can be connected to the input of another to create strips of hundreds of LEDs. You can chain together several of these boards to form a display or an addressable string. Each LED at full brightness can pull about 60mA, so bear in mind that means 10 LEDs can require up to 600mA.
The brightness of each color can be adjusted using pulse-width modulation to one of 256 different levels. That means there are
16,777,216
(256³) possible combinations of colors. You can produce any color from white to black (off), or salmon to sienna.
The board's pins are as follows:
5V
is the power input. Technically it can be between 4V and 7V DC. Typical use is with a regulated 5V supply.
GND
is the common ground 0V reference.
DI
is Data In from a microcontroller or another WS2812.
DO
is Data Out to be connected to the
DI
pin of another WS2812, or left floating on the last board in a chain.
There are two
5V
and
GND
pins on the board — one each on opposite sides — making it easy to chain multiple boards together from left to right. You can think of the right-side
5V
and
GND
pins as output to be connected to the left-side pins on the next board in the chain.
The figure below shows an example connection of five of these boards to an
Arduino Uno
, controlled via the Arduino's I/O
pin 4:
Data Transmission Interface
The communication interface between a microcontroller and the WS2812 is unusual. It's one wire, but it's not like a standard UART serial interface. This interface is very time-specific. Both a and a require a square pulse; it's the length of the pulse that defines which it is. See the timing diagram below:
The data are 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. The channels are in the order
Green, Red, 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 brightest white.
Because the interface is so time-specific, you will need a real-time processor like an Arduino or Propeller to run the LEDs. 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.
WS2812 RGB LED Breakout Board Resources
WS2812 Breakout Board Schematic
WS2812 Breadkout Board Design Files
for Eagle
Arduino Library for WS2812
including example code and a definitions file
Guide to Using the Arduino Library
WorldSemi WS2812 Datasheet
WS2812 Breakout Board GitHub Page
has an additional Arduino code example
logic 0
logic 1