Back in November 2012, I wrote about using the
WS2801 RGB LED driver, and shared how I was able to
deploy it in a big "Hollywood" creation built by my friends
at Steve Wang's Biomorphs. The League of Legends
display was built for Riot Games, and is a crowd favorite at
gaming conventions across the country.
For review, the WS2801 is an RGB LED controller that
acts like a shift register, accepting 24 bits (eight bits for
each color channel), then allowing additional bits to pass
through to other devices in the string. A brief low period
on the clock line causes the device to reset and accept
new data. Being SPI-like with separate clock and data
lines, it's very easy to use — any controller of any speed
can send data to a WS2801. Figure 1 shows a segment
from the WS2801 LED strip.
Note the size of the LED that is right in the middle of
that strip; it's tiny — just 5 mm x 5 mm. Now, imagine if a
vendor could jam that driver chip on the left side of the
segment into the body of the LED. There's no need to
imagine; they've done it. It's called the WS2812.
Let me clarify just a bit. The WS2801 is a two-wire
(clock and data) device. There is a similar device called a
WS2811 that uses a single wire and different protocol. It is
the WS2811 that is packed into an RGB LED to form the
WS2812. Being a single-wire device, the WS2801 code
won't work with WS2811 chips or WS2812 LEDs. It's time
for some new code.
So far as I can tell, one of the best places for
hobbyists to get WS2812 products is from Adafruit in
New York. That said, if you want help using the WS2812
with the Propeller, you're basically out of luck since they
specialize in Arduino. They have a nice driver that works
with most Arduino variant,s but suggest if you're using
something else, Google is most likely your best friend.
Well, there's no need to entertain basement-dwelling
government employees with another Google search — the
WS2812 datasheet is available on the product page for
the LED (raw form). For initial experiments, I recommend
their NeoPixel (version 1, #1312) modules. For about
eight bucks, you get four WS2812 modules. Note that
they don't come with pins installed for use with a
breadboard. Wearable electronics is a popular topic at
Adafruit, so the NeoPixels come without pins; this makes
them easier to sew onto fabric. It takes just a few seconds
Full Color With One Wire
There's no denying that the ubiquitous
blinking LED demo is the "Hello, World!"
of embedded programming. In fact, many
microcontroller boards — like the Propeller
QuickStart and the Arduino — come with
pre-installed LEDs so that we don't have to
connect anything to get started. With cheap
and easy LCDs — and even the ability to do
video with some micros — LEDs seemed to
fall out of favor for a while. You know the
saying, though: Everything old is new
again. LED manufacturers are creating some
really neat products these days, and with a
small matter of programming, we can have
a lot of fun with them.
50 September 2013
■ BY JON MCPHALEN THE SPIN ZONE
Go to www.nutsvolts.com/index.php?/magazine/article/
september2013_SpinZone for any additional files and/or
downloads associated with this article. You can also
discuss this topic at http://forum.nutsvolts.com.
■ FIGURE 1. WS2801 segment.