Cheap-Ass PC Interface for Digital LED Pixels

July 1st, 2011

I have an unhealthy obsession with LEDs. I also have an unhealthy obsession with frugality…

Total Control Lighting is a system of individually-addressible full-color LED “pixels” that can be shaped into any display imaginable. It’s a new offering from Funhouse Productions, who’ve been marketing their Cool Neon electroluminescent wire to creative types for years now, practically defining the after-dark aesthetic of the Burning Man arts festival.

The appeal of the Total Control Lighting system is that it scales linearly…just chain one strand of LEDs after the next, like Christmas lights. One end plugs into a controller box, which can issue preprogrammed color sequences, or others can load animation data from an SD card. In more sophisticated setups, the controller in turn connects to a computer, which can then command every LED individually and in real time. That’s where this project comes in…

These controller boxes offer some fine features, and come as a tidy, pre-packaged solution. They can run unattended, without any computer attached, streaming data from an SD card. Or they can be situated remotely on a network, far away from the computer actually generating the display. They also cost money, which I’d rather pour into buying more LEDs! Fortunately, for the technically-minded, we can cobble together our own home-built alternative for about fifteen bucks.

Some folks are already using an Arduino as a PC-to-LED bridge, and that works great up to a point. But when you start getting into larger displays and faster frame rates (such as video and persistence-of-vision displays), it’s like trying to funnel the traffic from an eight lane highway down a narrow gravel path. This alternate controller uses an FTDI USB-to-serial adapter, along with a C library to run it using “bitbang mode,” which is explained in this article at Hack a Day. The bitbang FTDI route can provide significantly higher throughput.

That’s the good news. The bad news, perhaps, is that this is just a low-level C library. You’ll still need to write the code to make it actually do anything. If the existing controllers already handle everything you need, be it pleasing color patterns or playing back animation sequences from an SD card, that extra investment might save you a lot of headache. But if hacking a Kinect controller for an interactive POV display is more your style, or anything else weird and unexpected, this might be just the thing you need. The code is open-source, and works on Mac, Linux and Windows.

Some outwardly identical-looking LED pixels are offered from other sources such as Bliptronics and Adafruit. Without getting into the all the geeky details, while these other types work fantastically well with a microcontroller, they just can’t be driven by the FTDI adapter without unsightly flicker. What distinguishes the Total Control Lighting pixels is the use of a newer LED driver chip — the P9813 — that’s essentially immune to the small timing issues of the FTDI approach. The code unfortunately will not work with those other pixels.

The library is available for download from this GitHub repository. Until I can get around to providing better documentation here, the README file included with the code explains its use and depicts the hardware setup with awful ASCII art. Any significant progress will also be posted on this YouTube channel.

16 Responses to “Cheap-Ass PC Interface for Digital LED Pixels”:

  1. Singinius says:

    Amen brother! I am very interested in this tech and low cost solutions. I have an art car that has been to BM a few times and I am considering this system for her this year. Look forward to seeing more info on your experiences!

  2. ladyada says:

    Hi thanks for showing this off on the ask an engineer show&tell. Just want to give you a heads up that we have updated the pixels we have in the adafruit to WS2801 type which have free-running PWM and they’ll work great with this kind of stuff – no flicker, no clocking, no syncing, etc. We may even port your code so we can make our own LED wall (I mean, who -doesnt- want a LED wall!?!?! :)

    • eddie says:

      I want an LED wall! Is Arduino Uno an upgrade on this topic?

      • pburgess says:

        Hi Eddie. Unfortunately, no…somewhat counterintuitively, the Arduino Uno is actually slower for this kind of thing, due to the serial I/O bottleneck. I’m currently looking into some of the “native” USB alternatives…these may end up being just as fast as the FTDI trick, without any of the driver or library yuckiness.

    • Aaron Stone says:

      Given a choice between WS2801 and P9813 based LED modules in a new application, which should I go with — and more broadly, what are the relative merits of each chip on each of use, clock stability, number of nodes I can daisy chain, (what else should I be asking here…) and so on?

      • pburgess says:

        Hi Aaron,

        Afraid I can’t really answer the more technical questions. Most of these LEDs/drivers come out of China, and datasheets (if even available) are seldom translated. I’ve done installations with both WS2801 and P9813 LEDs and have not run up against any severe limits regarding strand lengths, etc. The main differentiator between those two is in how a latch signal is issued…delay-based with the WS2801, protocol-based with the P9813. If you’re using a microcontroller (Arduino, etc.) as the driver, either works just as well, but if you’re using something like FTDI bitbang mode or GPIO lines on an embedded Linux system (where timing isn’t always deterministic) then P9813 is the better choice (because accidental delays won’t cause an inadvertent latch).

        So aside from that one latch detail, the better criteria might be things like cost, ready availability, choice of pre-installed plugs, whether or not water/dust-proof-ness is a factor, and so forth.

  3. Caleb Kraft says:

    I can not wait to see this completed. I share your unhealthy obsession with LEDs Phil.

  4. michu says:

    nice work, I also created a PixelWall/VideoWall called PixelInvaders and created quite a flexible software called PixelController. I released the Software as OpenSource at https://github.com/neophob/PixelController. You can control the software with OSC messages, MIDI messages (using PureData as Frontend) or of course your keyboard/mouse.

    There are generators, effects, mixer, fader… you klick and play with it.

    cheers
    michu

  5. AJediIAm says:

    Hi everyone,

    This looks like so much fun!

    I’m looking into controlling several led systems throughout my house (kitchen, livingroom and hallway). I want to have them work together in a mood-light/weather-simulation/ambi-light system. I have RGB led strips and build in the house itself. Before I moved up to individually controllable leds I wanted to find the right controller solution for the challenge. Is this it?

    It looks like this might actually work as long as I have a HTPC turned on, right? This is the first thing I found which looks like a cheap led controller which might actually do what I need. I have searched for hours, but perhaps in the wrong places.

    Programming it should not be a problem, but I have no experience with the hardware part. As an alternative I was hoping to find a wireless controllable solution I could control directly via PC or android device. The only thing I could come up were having several Arduino boards which is actually overkill.

    Do you guys think a controller like this can be programmed for what I need?
    If you have any hardware or feature recommendations I would love to hear them.

  6. [...] recently posted this excellent step-by PC Ambilight clone from talented builder and writer Phillip Burgess. Naturally, Ladyada would like to sell you the parts, but it’s all open source and the [...]

  7. Ryan says:

    my RGB pixels are actually GRB pixels(which I bought from http://www.ledlightinghut.com/12mm-ws2801-led-pixels-dc5v-input-ip68-50pcs-a-string.html )… that is, sending a color value of (255, 0, 0) outputs green, (0, 255, 0) outputs red, (0, 0, 255) outputs blue, etc. instead of red, green, blue (respectively). Since i’m using a tutorial (http://ladyada.net/make/adavision/) is there any way to change the R and G calls in the WS2801 processing library?

  8. Erin says:

    I am wondering, is it possible to use a Coolneon”total control lighting” controller with lpd6803 or other IC’s besides the P9813?

Leave a Reply:

Copyright © 2014 Paint Your Dragon. All Rights Reserved.