Wednesday, April 8, 2015

20150211 More NeoPixels (WS2812/WS2811) Info and 3D Cube

More NeoPixels (WS2812/2811) Feb 11, 2015

I’ve done a couple of projects already that feature using the WS2812 LED strips (Adafruit calls these NeoPixels) NeoPixels are easy to use (fairly easy) individually addressable RGB (or GRB) LEDs. I think when I first started using these there were few others and information was limited. Now however there is so much information about these that it’s hard to sort it all out.
Probably one of the best guides to NeoPixels and how they work (and the timings behind them)
can be found on Adafruit (This is a 40 page guide)


So first off there are individually addressable Leds that are not based off the WS2812/2811 chip. So that is important to know, because they work different, and will not work with the neoPixel Libraries.

Adafruit says they have very strict timing requirements, but others have said they are not as strict as you would except them to be.

Without a external power supply the Arduino can only drive about 10 at a time, at full brightness. Thou, I have driven upwards of 90+ with mine, I’m not saying that was safe from a power stand power thou, and I always knew there was a risk of blowing out the Arduino power.
(60 LEDs = 18Watts about 3.6 Amps at 5v)

Neopixels come in many different styles now:
As strips, as small rings (12 pixels) as larger rings (16, 24 pixels), as a matrix (8x8)
There is a neopixel sheild that has 40 pixels, small strips that have 8 pixels, 1 meter strips (30 pixels) and 1 meter strips that have 60 pixels. They also come as individually packaged (1 pixel) that are both breadboardable, and not breadboardable (These are normally sold in packs of 5)
and recently they have come in 8mm Diffused through-hole style (This is what I used in the 3D cube) The through-hole as also sold normally in packs of 5.

As I said before when I first started messing around with these there wasn’t much information, and the Adafruit library was just about the only library I found that made these works.
And it is still one of my favorite libraries to use.

For the Demo I will be using both the above library and a as far as I can tell fairly new library called FastLED...FastLED has some advantages over Adafruits library as it works with multiply strips at the same time, it also has a easier to use “briteness”

I found a few more libraries that I would like to try they are listed here:
light_ws2812 - is a light weight library to control WS2811/WS2812/WS2812B based LEDS and LED Strings on 8-bit AVR and ARM microcontrollers.  

OctoWS2811 LED Library which was written with the Teensy 3.0 and 3.1 in mind, but I think it works with the Arduinos as well. (In fact the library looks very much like the Adafruit library, so there may not be so different)
PJRC does explain some more about how they work.


A couple of libraries I found that were written for a specific piece of hardware or something other then the Arduinos.

Fadecandy - For the Raspberry PI it looks like.
(Just a year ago, they had not been working on the rPI, and even the Adafruit website says that there would be problems with timings. I believe fadecandy has figured this out by adding a 2nd controller board to the rPI)
http://www.adafruit.com/products/1689 (It looks like you can use this board with a lot of things other then the rPI as well)

LEDscape LED Controller - looks like it might be a competing product for fadecandy - Looks like it might be for the Beaglebone Black (at least there is a BBB in one of the 1st pictures on the site)


This guy explains that the timing isn’t as tight as what Adafruit has claimed, and to prove it he hooked up 1449 pixels and can control them all from his Arduino using 1K of ram.
Impressive - that many pixels, need external power, and I think I counted at least 3 power supplys he used. Watch his video it really is impressive.
I’ve pretty much discovered the same thing in a round about way - they really don’t seem to be as picky about timings as you are lead to believe.
I have 3 different strips made by 3 different companies and bought at three different times.
Each on said it was someting else in the eBay listing - but each one works as you’d expect.
The other thing, the Adafruit library give you the ability to change the times so if you are using one of the older WS2811 or a different micro controller they will still work. Up till the 3D cube none of my strips cared about any of those settings.
the 3D cube (diffused LEDs) were the only ones that did seem picky.

Some of my code (for the demo):


Building the 3D Cube - I more or less (mostly less) followed this tutorial:

I decided not to put a switch in it, or run it from a trinket - but I might later.
I used the case (3D printed), and the general hookup guide.
Thou I didn’t follow that 100% either, as I started to build this I realized that I was having a problem getting some of the legs to line up.  I ended up putting the positive legs inside the case on the 1st rung, For the 2nd rung, the Ground legs would go to the 1st rung and the positives were connected in a “circle”...for the 3rd run, the positive legs would come down and connect to the positives on the 2nd rung.  (Confused yet?)
Jumps from the 1st rung to the 3rd rung would connect the ground, and a jumper from the inside of the case to the 2nd rung would connect the positive.  
Overall this worked great, thou it was a little confusing keeping which rung was what straight.
In the long run thou, I think mine makes since.
I took the idea of connecting all the rungs like that from watching people make 3D cubes using normal LEDs.
led_pixels_IMG_2090.jpg

I also found Cheap NeoPixel LEDs on eBay, which while technology the same, they were made cheaper - you can tell that just by the pictures of the two side by side.
Also, when some of the timing pulses got off or something, sometimes this sparkly.

eBay listing:
I offered $2 each for 6 sets of these - they took it...so offer them something less then they are asking :-) if you want to do a project like this.





No comments:

Post a Comment