Author Topic: Individually addressable RGB LED comparison?  (Read 162716 times)

dougal

  • Sr. Member
  • ****
  • Posts: 289
Individually addressable RGB LED comparison?
« on: June 14, 2013, 08:02:32 am »
So I know there's WS2801, WS2811, and LDP8806 controllers for LED strips. What others should we be aware of?


Can someone point us to (or write up) a breakdown comparison of the features/limitations of the various options?


Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Individually addressable RGB LED comparison?
« Reply #1 on: June 15, 2013, 07:32:49 pm »
From what I understand, WS2801 and LPD8806 are both SPI-based chipsets. Both do 8-bit PWM and have RGB channels. Both come as separate chips which are connected to any sort of RGB LED, available as fairy-light strings or as strips. LPD8806 seems to be patent encumbered and less available for purchase than the WS2801 stuff. LPD8806 are very poorly documented - adafruit managed to reverse engineer enough of how they work to make an arduino library. The LPD* chips generally also do not freerun - this means your microcontroller needs a background process (timer or watchdog interrupt) pausing your program and sending out clock signals to the LEDs even when you aren't outputting colours. This clock signal runs their PWM. If you make it too fast, the colours will start to be reproduced less accurately - if you make it too slow, they will look flickery and might be an epilepsy risk.


For those reasons, I recommend you do not use LPD8806. WS2801 is a similar SPI device with a seperate chip. You can hook it up to a raspberry pi, a serial or parallel port on a computer, a digispark, littlewire, and arduino - pretty much anything capable of digitally writing to two wires. The WS2801 runs it's PWM off an internal clock, so you can set it and forget it - they'll hold their colour without needing your program to be interrupted thousands of times every second.


The WS2811/WS2812 is really neat! The WS2811 is a chip, like the ws2801, but instead of SPI it uses a purely timing-based serial protocol. They can be driven by an arduino or digispark running at 8 or 16 megahertz, they hold their colour (set and forget) just like the ws2801, and are basically the same, but you only need a single data wire instead of two, making them very appealing for use with digispark.


The WS2812 is the WS2811 chip die embedded in to a 5050-style LED, so you have an all in one addressable chainable LED module. You can buy these on 60-led per meter strips on aliexpress or from adafruit. All ws2812 LED modules run in the 800khz protocol, not the 400khz protocol available on some ws2811 devices. This means they run at twice the speed, allowing your program to communciate with them faster, so each time you send an update to your LEDs your program will spend less time doing it, and get back to your colour calculation code quicker - this potentially means a higher framerate. We also have out of the box support for 800khz ws2811 and ws2812 lights built in to the beta version of LittleWire 1.2 and included in the littlewire ruby library and c library. This means you can use a digispark to control ws2811 and ws2812 LEDs from a computer via a digispark without needing to write any arduino code or figure out how to interface with the digispark from your program - you just pass an array of colours to the littlewire libraries and it handles it all for you.


Another key difference is because of the strict timing requirements of ws2811/ws2812k, you need to precompute the colours for all of your LEDs and then use a function which outputs them from an array. You can't do streaming output, where you compute a single colour, send it out, compute the next one, etc... You can stream output with ws2801 and to some extent lpd8806 devices. This can be relevent to digispark and arduino projects because digispark only has 512 bytes of ram, and each LED takes 3-4 bytes of that memory depending on the library you use. This means you are practically limited to buffering about 100 WS2811/WS2812 LEDs in a digispark's memory. On the newer arduinos you can do a few hundred more. The Teensy 3.0 can do a bunch more still.


This limitation isn't as bad as you might think, because you can have multiple parallel strips! You fill your buffer with data for one strip and output it, then fill it with colours for a different group of LEDs and output it to a different pin! With this technique you can have roughly (100 * number of free pins) - if you have nothing else connected to a digispark it can control 600 LEDs!


In summary, I would recommend using ws2812/ws2811 (800khz) for all projects except where you want to drive LEDs from an SPI port, like that of the raspberry pi. For raspberry pi driving LEDs directly, use ws2801. Only use LPD* lights when you have to for compatibility with something else.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Individually addressable RGB LED comparison?
« Reply #2 on: June 17, 2013, 06:35:10 am »
Great info, Bluebie, exactly what I was hoping for!


I've got a 1m strip, a 5m strip, and a string of 50 12mm lights, all WS2811-based, on the way from eBay auctions. The first one should hopefully arrive today, and the others next week. I just wanted to make sure there wasn't some other type that would be better to focus on.


I'll be downloading your drivers as soon as I get a chance.  :)

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Individually addressable RGB LED comparison?
« Reply #3 on: June 19, 2013, 08:56:08 am »
I just scored a lot of 100 individual ws2812 modules on eBay for $25. w00t!


http://www.ebay.com/itm/171058502069?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649


That's the best price/quantity deal I've seen, short of buying lots of 500 or more.


DeuxVis

  • Full Member
  • ***
  • Posts: 107
Re: Individually addressable RGB LED comparison?
« Reply #4 on: June 27, 2013, 02:43:24 am »
You are sure those are WS8212 with the integrated rgb led ? I know the ebay pictures seems to show that, but they are described as WS8211...

Anyway, thanks for sharing. I think I might get a pack too...

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Individually addressable RGB LED comparison?
« Reply #5 on: June 27, 2013, 01:49:58 pm »
Going by the pictures, and this blog entry, it looks like WS2812 modules, to me.


I'm guessing that they used WS2811 in the description because more people are searching on that keyword? (though you'd think they'd put both terms in for maximum coverage...)


I dunno. I'm just looking forward to receiving them. :)




dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Individually addressable RGB LED comparison?
« Reply #6 on: June 27, 2013, 02:10:50 pm »
Over on AliExpress, it looks like you can get them even cheaper *if* you buy multiple 100-piece lots. The lots are $14 each, but they add $20 shipping. However, it looks like the shipping stays the same even for a large number of lots:


http://www.aliexpress.com/item/5050-SMD-RGB-LED-with-built-in-WS2811-IC/656558600.html


digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Individually addressable RGB LED comparison?
« Reply #7 on: June 27, 2013, 04:05:51 pm »
What are you folks using these for - generally one or many at a time? I'm wondering what form a breakout/shield for these should take or if we should just carry them individually/in 10 and 100 packs? I imagine we could offer them for $25 for $100 (or less) without the china shipping wait times

DeuxVis

  • Full Member
  • ***
  • Posts: 107
Re: Individually addressable RGB LED comparison?
« Reply #8 on: June 28, 2013, 01:34:32 am »
My plan is to make a clock out of those. Take 60 of them disposed in a circle shape, light up 3 of those at a time for hours, minutes and seconds, with different colours (and mixing when they overlap) for each unit.

Not something that would fit on a spark shield, but a spark should be enough to drive it.


I think people would probably make customs forms or shapes out of many those. If you only use a single you don't need the chaining capability, and if you only want a straight line you can buy premade strips.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Individually addressable RGB LED comparison?
« Reply #9 on: June 28, 2013, 07:27:03 am »
I don't have any specific plans for them yet. But I was on an LED strip buying spree, and getting a big lot of individual elements seemed like a good idea at the time. :)


The pre-built LED strips are great, but if you don't want a linear layout, or if you need to vary the spacing, you have to cut them apart and wire them anyhow.


They're small (5mm square -- less than 1/4" for us Imperialists), so they'd be good for all sorts of projects where you want to use a lot of little blinkenlights -- more than you could control with charlieplexing. You could make a 10x10 matrix in right around 2" of space, if you squeeze them tight. They'd be good for making your own wearables, like the AdaFruit Flora NeoPixels.


What I'm starting to wonder is if there might be any value in making some sort of I2C interface for WS2811 hardware? You could offload the timing and RAM requirements to a large degree. And it wouldn't need to be DigiSpark-specific.




dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Individually addressable RGB LED comparison?
« Reply #10 on: July 01, 2013, 09:14:22 pm »
I don't know if this will interest anyone, but I started working on a browser-based JavaScript simulation of LED strips. You can view it on CodePen:


http://codepen.io/dougalcampbell/pen/fnjFu


It is currently emulating the 'chasers' code from Danny Havenith's WS2811 AVR library:


https://github.com/DannyHavenith/ws2811


At the moment, there is an off-by-one error somewhere in my chaser code that is causing an extra light to be added to the strip, which shows up as white on the left side.


My intent is to use this as an easy way to prototype LED Strip control algorithms (e.g., VU meter, frequency analyzer) before trying them in Arduino code.


kathy82

  • Newbie
  • *
  • Posts: 1
Re: Individually addressable RGB LED comparison?
« Reply #11 on: July 30, 2013, 12:30:53 am »
ws2811 and the ws2801 are both 8 bit per colour, the LEDs used are the same. The main difference is that the ws2811 has the clock information sent through the data, so the chip itself doesnt have an internal clock. The ws2801 has the 4th wire for a clock as the clock is internal to the chip. This adds to costs.The other difference is that the ws2811 outputs at 18.5mA per colour as apoosed to the ws2801 which is 20mA, the difference here are really negligable and if anything under driving the LED slightly will increase the life of the LED.The ws2811 can achieve a further distance between controller and first pixel than what the ws2801 can. So the ws2811 is now becoming the main pixel type used in the hobby.  In the end most are going to ws2811 because its far better value especially in a strip

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Individually addressable RGB LED comparison?
« Reply #12 on: September 04, 2013, 11:23:09 am »
Just as an FYI, I've updated my JavaScript ledstrip code, and put it up on Github:


http://dougalcampbell.github.io/LEDStrip/


And I was pleased just now to find that it got a mention on the Adafruit Blog!


http://www.adafruit.com/blog/2013/09/04/javascript-simulation-of-led-strips/


The "Chasers" and "Water Torture" pattern drivers were derived directly from Danny Havenith's example code (I crudely translated them from C++ to JS).


The "Color Wave" pattern was my own creation, which just cycles the red, green, and blue values as overlapping out-of-sync sine waves. It came out looking even better than I had hoped. And this is basically why I wanted to create the JS simulation in the first place, so I could test out algorithms easily without having to go back and forth to the hardware. I can create my basic algorithms in JavaScript, then when I have it working like I want, I can translate it into Arduino C code.


I've got an Adafruit NeoPixel Stick (8 pixels) and a couple of the NeoPixel Rings (16 pixels each), and now that I've got my new MacBook Pro talking to my Digisparks, I'm ready to play!  ;)


digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Individually addressable RGB LED comparison?
« Reply #13 on: September 04, 2013, 12:10:36 pm »
That's awesome dougal! Digistump will soon be stocking the WS2812Bs - the newest version of these LEDs

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Individually addressable RGB LED comparison?
« Reply #14 on: September 04, 2013, 07:08:24 pm »
Oh man WS2812B look totally rad! That is a very good development. The only thing which would make it more perfect is if they integrated the little capacitor as well, and did a version with leads, so you could do through hole or wrap the leads around a screwdriver to make loops for electrical embroidery. I am just now imagining if I could make some sort of machine so I could make those really quickly: lay an LED face down, get a small leaded capacitor, lay it diagnoally against the back and solder it in place, and then solder on two more leads for data.


I certainly have enough servos to make a soldering robot, but somehow this seems like a really bad idea. Hmmmmmmmm


I wish my 3d printer could print something which would withstand soldering temperatures. Maybe I could prototype and then get shapeways to make it in metal.


Robots!!