Uncategorized  Add comments
Jul 272013

LEDscape test

Are you building a giant LED display for your hackerspace or Burning Man and need a way to control multiple kilometers of LED strips? Are you tired of running massive USB hubs of Teensys for each row? Then you might be interested in my LEDscape code for the BeagleBone Black to drive up to 500 meters of WS2811 RGB LED strips at 30fps.

On the Teensy 3, Paul’s OctoWS2811 makes very clever use of three DMA engines to generate the bit-train for the WS2811 LED strips, but only supports up to eight strips. Beth’s FadeCandy improves on Paul’s work and has a great frame rate with beautiful interpolation (and a custom USB protocol to pump pixels fast enough to keep up with the frame rate), but the temporal dithering and expanded colorspace features run into frame rate and memory limitations at strips beyond 64 pixels.

The BeagleBone Black has far more memory than the embedded AVRs (512MB versus 16KB) and the AM335x ARM Cortex-A8 has a killer feature: two built in PRU (“Programmable Realtime Units”). These are embedded real-time microcontrollers built into the ARM core with full DMA to main memory and control over all of the IO pins. This afternoon I hacked up a quick proof of concept in PRU assembly that use one of the units to drive 32 of the WS2811 strips at full speed with zero CPU load and easy double-buffering of the image. The best parts of writing for the ARM instead of the AVR is that there aren’t any issues with running out of memory for image processing and there is built-in ethernet for OSC or other visualization libraries.

The drawback to the BeagleBone is that the 3.3V signals won’t travel very far for large scale displays. Matt Mets (of Blinkiverse and Blinkitape kickstarter) and I are designing a “cape” to add 32 RS485 drivers to translate them to differential signals for longer runs. Add in art-net support and it will be part of an awesome DMX/VJ system.

 Posted by at 11:39 pm
  • Pingback: LED strip cape drives kilometers worth of LEDs

  • Pingback: LEDscape: When you need to control kilometers of LED strips on your BeagleBone Black! #beaglebone « adafruit industries blog

  • aaronb


  • Pingback: Community Corner: Solar Outdoor Pi, Back to the Future Clock, a Cardboard RasPi Internet Radio, and More Treats from the Adafruit Community « adafruit industries blog

  • Jeffery Legere

    I SO WANT THIS!. 32 channel rs 485. mmmm telescope control :)

  • Yona Appletree

    This is awesome. I’ve got your code running on my beagle bone, and driving some WS2812s, but I’m new to EE, and I’m curious what you’re doing with the resistor in the image on this post. It seems that you’re using it to bring the 3.3v logic up to 5v, somehow…

    • Matt Thomas

      That might just be a pull-up resistor or something. I think in the photo he is simply running the power and data lines at 3.3v.

    • Ryan O’Hara

      Yona, I am running the new WS2812B’s (4 pin vs 6pin WS2811) and am having bit of trouble with the timing not being 1.25us. Are the 2812s you are using the new pin types?

      • Yona Appletree

        They are, but I had to modify the PRU code to adjust the timing. The most important thing, IIRC, is that the line is held high for the correct time. You can add more time between the bits, but the ws2812 is fairly picky about the amount of time from when you raise data until it reads the state of the line.

        I’ll see if I can post my fork of LEDscape sometime later today.

      • Yona Appletree

        Ryan — I finally cleaned up, documented and posted my LEDscape fork: https://github.com/Yona-Appletree/LEDscape/ . I’ve removed all the non-ws2811 stuff from the repo and modified it to run on both PRUs to get a better framerate. It’s verified and working with WS2812 and WS2812b.

  • http://www.colinharrington.net Colin Harrington

    I’m curious how fast the BeagleBone Black boots from no power to LED functionality. Can you time yours for me next time you get a chance?

    • Yona Appletree

      It takes about 28 seconds from plugging in the usb cable (used for both power and network data) to outputting data to the LEDs. This is with no optimization of the boot-up sequence or any tweaks for speed. I’d love to make it faster.

  • Justin Edwards

    Would a simple logic converter to bring the voltage up to 5v be fine? They’re used for many other BBB projects.

  • Shane

    I can’t figure out from the code of a teensy is needed or not – can I run light sequences with ~250 WS2811 pixels from a beaglebone standalone (i.e. no pc or teensy or anything else required – once the software’s uploaded of course!) or does it need a teensy/pc permanently connected?

    • Yona Appletree

      No teensy is needed. It appears that LEDscape was once used to output data via a teensy, but no longer. The repo linked above is a bit cluttered, and can be a little tricky to get working. I have made a fork that is cleaned up and optimized for ws2812/b: https://github.com/Yona-Appletree/LEDscape/

  • telmnstr

    Nice! I’ve been hunting for a WS2812B solution for a LED array of 40 wide x 32 high. The artnet solutions aren’t quite big enough, and I haven’t gotten the tpm2.net stuff to work on Arduino w/ ethernet yet. I found 3 free applications for driving these LED arrays (PixelController from Pixel Invaders, Glediator, and Jinx!) Each has it’s own advantages and disadvantages, and supported hardware.

    I really think artnet and dmx universes is not the way to be doing this LED stuff, but it’s what the existing software seems to support. The Tpm2.net and generic UDP style protocols of PixelInvaders looks a bit promising, and I think the UDP protocol is supported by the Python script PixelPi (Which cannot drive the WS2812B due to timing inaccuracies?)

  • ChicagoWayVito

    Is the LED Controller cape available now? If not is it possible to get a beta board and provide testing/feedback? I and those in my Hacker Space would love to try this out.

  • ChicagoWayVito

    Adding my Twitter handle as a way to get a hold of me if any of the below is possible: @chicagowayvito:disqus
    Is the LED Controller cape available now? If not is it possible to get a beta board and provide testing/feedback? I and those in my Hacker Space would love to try this out.

  • Jet Dillo

    It looks like this is taking up almost all the GPIOs on the Beagle.
    Is it possible to just use a couple pins for LEDScape and leave the others free ?
    I’m not trying to drive a huge array, just a Lightring/strip of 24-60 WS2812s.
    This would clear up some cabling clutter and save me from having to use a Teensy, but I need to be able to use at least 2 UARTs for serial comm to other devices that are part of the project.