Category Archives: Addressable LEDs

Cheap bicycle wheel LED sign (POV)

Due to finances, about the only form of recreation I have these days is riding my bike. I like to take casual rides on the many trails here in Des Moines (Iowa is famous for it’s massive bike trail network).

A few years ago, I came across this neat LED display that attaches to a bike wheel and created images using persistence of image (i.e. lights flashing real fast as the wheel rotates, which the eye sees as a complete, though flickering, image):

http://www.ladyada.net/make/spokepov/

Go there and look at the pictures and watch the videos. It is able to display full color and even animate images (I love the Pac-Man and Ghost images they show). It works by having a row of LEDs that flicker on and off as the wheel spins. The wheel has to spin very fast to show an image, so they sell kits with multiple circuit boards of LEDs. The more on the wheel, the slower it has to turn to show an image.

It looked really cool, but it came in a kit, and I am not really that capable of an electronics person. Plus, the kit with three circuit boards was $113.

A found similar (much cheaper) devices on Amazon, though most of them just did preset patterns and didn’t let you load your own. You can find some simple LED wheel lights at Amazon for around $13 that can display short text messages:

Do some searching and you will find all kinds of cheap POV displays for bike wheels. I even found one for around $12 that was programmable via USB:

None of these are anywhere near as cool as the Adafruit SPOKEPOV kit, but they might be pretty neat for the money.

Then, I came across this one on from an e-Bay store:

http://www.ebay.com/itm/PC-Programmable-Wireless-LED-Custom-Message-Bike-Wheel-Lights-/400354534043?pt=LH_DefaultDomain_0&hash=item5d36fd629b

It had two rows of LEDs and could attach to the hub of the bike and display messages or graphics. At the time I found it, there was a seller auctioning them off, and I picked one up for $6 (shipped from the US, even). Unfortunately, the device was not like the pictures show — it was not in color, just blue (the description says this, but all the listings, including Amazon, use pictures showing one with color).

Also, the device would not fit the hub of my bike (the bolts were too short), nor the sensor on the frame (the bracket was too small). I am not sure what tiny little bikes these were made for, but my old 1998 Trek wasn’t one of them.

However, with a bit of rigging, it was easy to attach the device to the spokes of my bike (rather than clamping it around the hub) using some tape, and then I could do some quick experiments.

If I get time, I would like to experiment with a very low-cost version of this, using an Arduino-style device and a strip of the high speed LPN8806 addressable LEDs. An Arduino in a plastic enclosure with batteries could easily power two segments of 32 LEDs (wider spacing than the commercial units, though) and do full color. The only other hardware would be a magnet and a sensor so the device can tell when the led strips circle around.

Sound fun? More to come… (I already have created JavaScript code that lets me load in an image in a web browser and convert it to the format that this device would need to display it.)

Simple scrolling LED Sign for NeoPixel (WS2811) or LPN8806

  • 2014/03/16 Update: The source code to this is now on GitHub. Check the Arduino link at the top of each page of this site.

Yesterday evening, I coded up a simple scrolling message sign that uses addressable LED strips like the Adafruit NeoPixels (WS2811) or LPN8806. The code I created is built for NeoPixels, since those were the ones I had access to, but it would be trivial to make it work with the Adafruit LPN8806 library. Future versions will make this simpler.

First, let’s talk about LED signs.

The BetaBrite is a commercially available scrolling message sign that’s been around for ages. I bought one at SAM’S CLUB back in the late 1990s. The BetaBrite that I have uses an 80×7 array of LEDs. This is what I will be trying to replicate.

If you shop around (ahem, e-Bay), you can find 1 meter long WS2811 LED strips with 60 RGB LEDs for around $8-$9. If you had seven of those, you could make a 60×7 LED sign. It wouldn’t be able to show as many characters at the same time as a BetaBrite does, but it would be good enough to experiment with. (There are strips with 144 pixels per meter, but they are very expensive. And, when you get past 500 or so LEDs, you start running out of memory on the Arduino. I plan to fix this with some updates to the LED library, eventually.)

Consider this wonderful drawing as I discuss a few possible ways to present a sign made out of LED strips:

LED Sign ideas

A. At the top is an example of one of these LED strips with LED number 0 to “n”. One end hooks to the Arduino and power, and the other end can be used to daisy chain multiple strips together. The first LED will be 0, and they count up to the end of the last strip. If you have three 60 LED strips, you have LEDs 0 to 179. The green arrow shows the direction of the data (the LEDs count up in that direction).

B. Next is an example of how you might arrange multiple strips so they could make up an LED sign. Each strip is shown running left-to-right, so at the end of the first strip the cables go all the way back to the left to connect to the start of the next strip. Wiring them like this makes it real easy to do things with. Notice that the green arrow runs left-to-right on each row.

C. However, it would be much much easier to just connect them like this, without all the extra wires running around. But, this causes every other row to run in the opposite direction (again, see the green arrows). This means the software has to be smart enough to know how to reverse drawing the pixels for every other row.

ALSO, based on where you decide to make LED 0, that changes everything. In these drawings, we are hooking the Arduino up at the top left. But, if it was easier to hook up at the bottom right, the entire numbering system would be backwards.

I decided to write a simple LED message program that could handle all of this. It’s not pretty, but it (maybe) works. I configure it with the number of LEDs in use, and how many are in each row, then I set where the start pixel is (TOPLEFT, TOPRIGHT, BOTTOMLEFT or BOTTOMRIGHT). I support running the rows STRAIGHT (A) or ZIGZAG (B). It can even do something fun…

D. This is the only thing I have actually done. I had two 1 meter strips, so I decided to spiral them with 20 LEDs in each spiral before the next row starts. These 120 LEDs can be split up in my program as six rows of 20 LEDs each, and then (with a small enough font), a message can rotate around it.

If you’d like to try out my code, I have posted it to GitHub:

https://github.com/allenhuffman/LEDSign

I have only tested it in the D configuration, but I have done some debug prints that make me think it should be handling all the other variations. Until I have access to more LED strips, I won’t know for sure.

Anyone want to try it out and let me know how it works for you?

Poor documentation, and the code could be cleaned up and optimized quite a bit. Perhaps I will have that done when I reach version 1.0.

Here’s a video of my first working version:

Arduino WS2811 scrolling message sign

I have two 1m 60 LED WS2811 strips, and expect to receive several more in coming weeks from Chinese suppliers. Once I have seven of them, I plan to use them as a scrolling message sign.

However, with two 1m strips (120 LEDs total), you can spiral them loosely (not tight enough to break the strip) and end up with six rows… Sorta. And, with a quick Arduino sketch (making use of some TVout fonts)… You can create a mini-circular scrolling message sign.

Here is “HELLO WORLD”:

Just for fun…

RGB addressable LEDs (WS2811, LPD8806)

Last year, I was involved with a large Halloween project that involved upgrading the lighting in a haunted house attraction to DMX controlled RGB LEDs. We spent many, many late hours running 12V power through the entire attraction to power all the lights, and Ethernet cable to carry the DMX (RS485) control signal. The end result was the ability to set the lights to any color without having to change bulbs.

Changing the bulbs would have been much easier.

A year before this project, the manager there had introduced me to HolidayCoro.com. This site resells LED lighting mostly for Christmas light displays. (The manager had one of those synchronized Christmas light displays at his house and he was in the process of converting the entire setup to RGB LEDs as well, which he did in 2013.)

Like many things here, one thing seems to lead to another, and I want to share some information in “addressable RGB LED lights.”

Adafruit.com sells a number of RGB LEDs, including their Neo Pixels which allow each light to be individually controlled. I first learned of this type of technology in 2010 when some GE Color Effect G-35 Christmas lights were introduced and quickly hacked so they could be controlled by an external computer. In 2010, this was cutting edge, but today, there are several off-the-shelf ways to do this.

An Arduino controls a strip of 32 LPD8806 RGB LEDs.
An Arduino controls a strip of 32 LPD8806 RGB LEDs.

There are two main LED chipsets I see being used:

  • WS2811 – Adafruit calls these Neo Pixels, and the lights run in series and are addressed over a one wire connection (power, ground, data) using a special protocol. The library for Arduino to do this is very clever and involves specific assembly language timing to toggle the data line at the proper frequency to send the data.
  • LPD8806 – this version uses a two-wire interface (SPI protocol) to talk to the lights (power, ground, clock and data). These lights are far easier to address and less timing sensitive.

At Adafruit, a string of 60 Neo Pixels (1 meter) runs $24.95. You can find similar strips (same chipset, same number of lights) on e-Bay shipped from China for around $18, or bid on auctions and get them for less than $10 each.

At Adafruit, the LPD8806 strips of 32 LEDs (1 meter) run $29.95. A coworker at my day job just bought one of these, which is where I first saw them in person.  On e-Bay, you can find these for $20 on e-Bay with free shipping from China. To find versions with 52 lights per meter (to get light density similar to the WS2811 version), the cost is around $30.

If you want to experiment with the LPD8806 lights without spending a ton of money or waiting weeks for a shipment from China, check out this seller on e-Baykbellenterprises is located in Missouri and will sell a 1-foot strip of LPD8806 lights for $12.99 (with free shipping). They also sell Arduino clones, power supplies and other items at near-China prices (you can get an UNO clone for around $10). You can get one of their strips and hook it up to an Arduino with four wires and safely power the 32 LEDs. (They say you should be able to power up to 2 feet off an Arduino’s 5V 500ma output. More lights than that requires an external power supply.)

As you can see, the LPD8806 lights are about 3 times the cost of the WS2811. The LPD8806 lights are “smarter” (in a way) and easier to work with, without needing specific timing code like the WS2811 require.

For casual play, both work the same way — in fact, Adafruit has posted libraries for each type of light and they both use the same API. You simply set some pixel colors (RGB) and then display them:

strip.begin();

// Set the first 10 LEDs...
for (i=0; i<10; i++)
{
strip.setPixelColor(i, strip.Color(127,0,0));
}
strip.show();

There are some limitations to using these lights on an Arduino. First, the libraries require a buffer of 3-bytes for each LED on the strip  (one byte for red, green and blue). An Arduino with only 2K of RAM can only handle 500 or so lights (more or less, depending on how much RAM your sketch uses, and any libraries you use). This severely limits how useful this is for anything other than just blinking a small strip of lights. My old 1990s BetaBrite LED sign, for instance, is made up of 80×7 LEDs (560) so I couldn’t replicate that using an Arduino and these types of lights using the standard library. More on this later…

There are dedicated controllers (Look for the T1000S, around $43 with free USA shipping, or less from China) that can display light sequences on up 2048 LEDs from an SD memory card. You don’t get any computer control this way (all sequences are made ahead of time using special Windows software), but this would be a much better way to drive a large amount of lights than trying to do it with an Arduino.

But what if one really wanted to use a 2K Arduino? Could you actually make a scrolling LED sign similar to a BetaBrite?

Perhaps.

In coming weeks, I will be sharing some embedded programming tricks that might allow controlling far more than 500 or so LEDs from an Arduino.

Check back…