PDA

View Full Version : using teensy 3 with neo pixel strips from adafruit?



iainduncan
09-06-2013, 08:01 PM
I'm guessing that the video is just keeping brand names off the web, but I wanted to verify before ordering a teensy 3 that it would be good for driving the adafruit neo pixel strips with the library that Paul has posted.

thanks!
Iain

strip:
http://www.adafruit.com/products/1506

nlecaude
09-06-2013, 10:57 PM
Yup, they are based on the ws2811 chip so they will work great. You can use adafruit's neopixel library, fastspi2 library or Paul's excellent octows library.

iainduncan
09-06-2013, 11:06 PM
Yup, they are based on the ws2811 chip so they will work great. You can use adafruit's neopixel library, fastspi2 library or Paul's excellent octows library.

Awesome, thanks!

I'm assuming Paul's library would be the best if fast updates are required?

iain

iainduncan
09-06-2013, 11:16 PM
I imagine each image will be about 48 x 96 rgb pixels, for what that's worth.

thanks!

PaulStoffregen
09-07-2013, 12:21 AM
For a 4608 LED project, you probably want 4 Teensy3s running OctoWS2811.

WS2811 (a.k.a. NeoPixel) LEDs always communicate at 800 kHz. Well, the hardware also has a 400 kHz mode, but everybody uses 800 kHz. Because the RGB data is 24 bits, each LED always takes 30 us to update.

OctoWS2811 is 8 times faster than other libraries, but only because it transmits 8 data streams simultaneously. It's designed so you can use multiple Teensy3s working together, each pumping out 8 streams. If you use 4 boards, that's 32 streams of data. For 4608 LEDs divided by 32 streams, each strip will be 144 LEDs long. Since all 32 strips update simultaneously at 30 us per LED, the entire array will update in 4.32 ms. In theory, this is 230 frames/sec. In practice, it gives you a lot of extra margin to pretty easily achieve 30 or 60 frames/sec progressive update rates.

If you tried to update all 4608 as one giant strip, the update would take 138.24 ms. That would be at best a sluggish 7 frames per second. The FastSPI and Neopixel libraries fully consume the CPU while updating, so can't get the next frame ready until the last one is fully transmitted. So in practice, you would never get close to the full 7 Hz theoretical speed.

By contrast, OctoWS2811 updates the LEDs in the background and has double-buffering, so the Teensy3 can work on receiving or generating the next frame while the current one is still shifting out to all those other LEDs. It really is designed for high performance. But the cost is in the complexity of hooking up many connections.

For simple projects with less than 100 to 150 LEDs, a single strip with the FastSPI or Neopixel library is easier.

iainduncan
09-07-2013, 06:32 PM
Thanks for the detailed answer Paul. Unfortunately I did a terrible job of asking the question, I thought I'd mentioned in the first post that it was a POV project, but I hadn't. oops, sorry!

So there are only 48 pixels on at once, and the 96 is the number of frames I'm trying to draw by strobing. I think this means I need to draw a frame about every 1 ms, but not sure about that part yet.

thanks
Iain

PaulStoffregen
09-07-2013, 06:58 PM
People attempting persistence of vision with WS2811 have reported frustrations with that chip's relatively slow internal PWM. Even though it receives data at 800 kHz, apparently the PWM it drives on the 3 LEDs is approx a 400 Hz carrier.

iainduncan
09-07-2013, 07:09 PM
People attempting persistence of vision with WS2811 have reported frustrations with that chip's relatively slow internal PWM. Even though it receives data at 800 kHz, apparently the PWM it drives on the 3 LEDs is approx a 400 Hz carrier.

Ah, grr, that's a real disappointment, the strips looked like they were going to make this easy-peasy. Do you know if the WS2812 is the same?

I guess it's worth giving it a shot anyway as I have the strips.

What would you recommend for getting a line of 40-48 RGB leds going for a POV display?

thanks so much!
Iain

iainduncan
09-07-2013, 07:12 PM
Would it make a difference if our POV movement is not all that fast? We're trying to make home brewed pixel poi, so I imagine we'll have them moving one circle every 0.5s, with the image being drawn twice in a circle.

PaulStoffregen
09-07-2013, 08:21 PM
Check out this thread.

http://forum.pjrc.com/threads/16469-looking-for-ideas-on-generating-RGB-colors-from-accelerometer-gyroscope

I've been told the WS2812 is the same. However, I've seen datasheets with very different specs, but I think some of the info in the original WS2811 datasheet is simply incorrect and they fixed it for newer versions of the file. Then again, the silicon might actually be different? Ultimately, I can not say with absolutely certainty what the specs of those chips really are. They're not made or even sold by PJRC.

As far as POV for spinning poi goes, to really find out you're going to have to give it a try. Good or bad, I hope you'll report back here on how well it did (or didn't) work and post some photos. While I've spent a lot of time on OctoWS2811 and the more technical details, a lot of this practical "it works for X, is so-so for Y, doesn't work for Z" practical advice, I really do depend on good feedback from projects like yours. I hope you'll share what you learn?

iainduncan
09-07-2013, 09:39 PM
Check out this thread.

http://forum.pjrc.com/threads/16469-looking-for-ideas-on-generating-RGB-colors-from-accelerometer-gyroscope

I've been told the WS2812 is the same. However, I've seen datasheets with very different specs, but I think some of the info in the original WS2811 datasheet is simply incorrect and they fixed it for newer versions of the file. Then again, the silicon might actually be different? Ultimately, I can not say with absolutely certainty what the specs of those chips really are. They're not made or even sold by PJRC.

As far as POV for spinning poi goes, to really find out you're going to have to give it a try. Good or bad, I hope you'll report back here on how well it did (or didn't) work and post some photos. While I've spent a lot of time on OctoWS2811 and the more technical details, a lot of this practical "it works for X, is so-so for Y, doesn't work for Z" practical advice, I really do depend on good feedback from projects like yours. I hope you'll share what you learn?


I certainly will! Thanks so much for your work on the Teensy. =)