Maniacal Labs User Forum
WS2812b Animations Help Needed - Printable Version

+- Maniacal Labs User Forum (http://forum.maniacallabs.com)
+-- Forum: AllPixel (http://forum.maniacallabs.com/forumdisplay.php?fid=1)
+--- Forum: General Discussion (http://forum.maniacallabs.com/forumdisplay.php?fid=2)
+--- Thread: WS2812b Animations Help Needed (/showthread.php?tid=122)



WS2812b Animations Help Needed - geman220 - 11-28-2016

I am interested in animating a LED matrix for an upcoming personal project. I have been tossing around the idea for at least two years now and each time I end up talking myself out of the project because I can't seem to get a grip on how exactly you program WS2812b LEDs.  I found this community doing more research and am hoping someone can help.

My Goal:
  • Cycling custom animations on a LED matrix that will be around 1200 LEDs total. The best way I can describe the animations would be something like playing a .gif. A simple example would be a face that winks.
  • LEDs + controllers should be operable on battery. I can wear a small backpack with batteries and controllers, nothing incredibly heavy. (no car battery on my back =P)
  • I'm not sure if it matters but the LED matrix will end up being shaped more like a diamond than a regular rectangle / square.
  • Although I have an available area of around 1200 LEDs I won't be using most LEDs during animations. I just need the available "surface area" to light wherever needed. For example, the winking face animation might only use 200 LEDs at a time.

Where I am now:
  • I have bought 2 lots (600 LEDs total) of ws2812b strips
  • I purchased a T1000s controller although I am not sure if this will accomplish my goal.
  • 1x Arduino Uno
  • A power supply to test and configure things on a bench before tackling portable power.
  • I have a Pi3 laying around that I can repurpose if that is an option
  • 2x AllPixel

Where I need help:
  • I have looked into the FastLED library, all of the examples are just color fades etc. I do not understand how to properly create an animation like the winking face example above.
  • Is there an example that you can share that meets my goals using FastLED?
  • Is there a more elegant solution, such as getting a netbook running Windows / Linux that can send data to the LEDs?
  • I understand I can use BibiloPixel to combine two AllPixels, but I don't understand how to create custom animations.  Using the same example of a winking face, how would I accomplish this?

My experience:
  • I am familiar with wiring up everything as far as power requirements, data in, clock in, etc.
  • I am not a 'programmer' but I understand coding and can get things to work once I understand the method.
  • I'm completely open to any and all suggestions or ideas. I appreciate any guidance on this, I really want to stop tossing this idea around, learn something new, and make a cool project.

Thanks!


RE: WS2812b Animations Help Needed - Adam - 11-29-2016

So, not entirely sure what your question is exactly, but I'll try to tackle what I can think of...

First, if you are using standard 5050 SMD size WS2812b LEDs, there's NO WAY you are going to battery power this thing. I have a display that large (1250 pixels actually) and it draws up to 375W! That's 75A @ 5V!!! Even lighting only 200 LEDs would draw 12A and 60W, *plus* the base current draw of all the LEDs that are off (around 1mA per LED).

Ok, yes... it's *possible* but I would say inadvisable. I built some pants that used 500 LEDs and it was a serious pain. I had to power it with a super bulky RC car battery and a bunch of 12V to 5V switching converters. It drew over 30A and only ran for ~15 min.

Disregarding power issues, as you are not an experienced programmer, I would recommend using a Pi like the Pi Zero to control it all. I'll actually be releasing a new version of BiblioPixel that can control the WS2812 from a pi directly without an AllPixel. Though I admit that it would be *really* slow with 1200 pixels! You are better off with something faster like the APA102.

As for creating your own animation, I recommend looking at these examples: https://github.com/ManiacalLabs/BiblioPixelAnimations
Also this doc: https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation

As for using FastLED directly, I honestly don't have a lot of experience with writing animations directly. We only use it as a bridge that takes in raw pixel data over serial. checkout http://fastled.io/+ for their awesome support community if you want to go that route.


RE: WS2812b Animations Help Needed - geman220 - 11-30-2016

(11-29-2016, 09:25 PM)Adam Wrote: So, not entirely sure what your question is exactly, but I'll try to tackle what I can think of...

First, if you are using standard 5050 SMD size WS2812b LEDs, there's NO WAY you are going to battery power this thing. I have a display that large (1250 pixels actually) and it draws up to 375W! That's 75A @ 5V!!! Even lighting only 200 LEDs would draw 12A and 60W, *plus* the base current draw of all the LEDs that are off (around 1mA per LED).

Ok, yes... it's *possible* but I would say inadvisable. I built some pants that used 500 LEDs and it was a serious pain. I had to power it with a super bulky RC car battery and a bunch of 12V to 5V switching converters. It drew over 30A and only ran for ~15 min.

Disregarding power issues, as you are not an experienced programmer, I would recommend using a Pi like the Pi Zero to control it all. I'll actually be releasing a new version of BiblioPixel that can control the WS2812 from a pi directly without an AllPixel. Though I admit that it would be *really* slow with 1200 pixels! You are better off with something faster like the APA102.

As for creating your own animation, I recommend looking at these examples: https://github.com/ManiacalLabs/BiblioPixelAnimations
Also this doc: https://github.com/ManiacalLabs/BiblioPixel/wiki/Writing-an-Animation

As for using FastLED directly, I honestly don't have a lot of experience with writing animations directly. We only use it as a bridge that takes in raw pixel data over serial. checkout http://fastled.io/+ for their awesome support community if you want to go that route.

Thanks for your help.  I have a Pi 3 already, how would I use it to control the lights?  Also, I changed my LEDs to 2801s but I don't think that changes anything.  I did have a question about power.  I have a power supply and I was wondering how I connect the LEDs safely.  Do I take the V+ to 5V and tie the grounds together?  Or do I only take the V+ to 5V and ground the LEDs to the pi?


RE: WS2812b Animations Help Needed - Dan - 12-02-2016

The Pi and the LEDs should have separate 5V power, but they will need to share a common ground. So you'll have your 5V and Ground connections from your power supply to the LEDs which will do most of the current handling for the lights, but you'll also need a smaller wire going from Ground on the LEDs to Ground on the Pi. This connection will provide a ground reference for the Clock and Data signals between the LEDs and the Pi.