Maniacal Labs User Forum
Individual LED control or Group Controls? - 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: Individual LED control or Group Controls? (/showthread.php?tid=128)



Individual LED control or Group Controls? - chavenor - 12-21-2016

I'm looking to control multiple groups of LED'S in real-time from a web messaging service that I have built in python bottle.

Would AllPixel be a fit for the use case below.

- I'm using a pi version 2 B+ v1.2 and pi 3 B+.
- 700 Leds WS812 RGB.
- LED power strip to drive all the above.

Example goal:
Leds 1 - 10 are all green.
Leds 11 -20 are pulsating in and out from low brightness to high color of green.
Leds 21 - ALL are all red.

I'd like to make changes to the led colors and which ones are green, red or pulsating.


RE: Individual LED control or Group Controls? - Adam - 12-21-2016

Absolutely. You can do this in a variety of ways... The simplest would be to just take the REST request on your bottle service (PixelWeb is built on bottle) and then update the specific set of LEDs you want as requested by the REST call. Basically just call led.set() and led.update() in BiblioPixel.

Note BTW that 700 pixels is the max for the Allpixel, so that will work, but if you use more LEDs you will need multiple AllPixels.

You can also take a look at the animation classes built into BiblioPixel: https://github.com/ManiacalLabs/BiblioPixel/wiki/Animations


RE: Individual LED control or Group Controls? - chavenor - 12-22-2016

Thank you for getting back to me so quickly.

How does the CPU work when driving individual classes of grouped leds?
Any notice of speed in changing of the leds states?
I understand the restful idea -- do you have any tips on best practices?
How does the board perform under 24/7 loads? Any stability issues?

Also any tips on where to buy the power supplies and other materials needed for this job. Hopefully you get some kickbacks on these recommendations. Wink


RE: Individual LED control or Group Controls? - Adam - 12-22-2016

The CPU is fine. But note that even though our library, BiblioPixel, makes it seem like you are just updating a group of LEDs that in fact every time you call update it pushes *all* the pixels again to the whole strip. That's just how they work. So there's no difference between updating 1 pixel or updating all of them as far as the AllPixel is concerned.

LED change speed is dependent on the types of LEDs you have. WS2812 are the slowest, LPD8806 or APA102 are fastest. 700 WS2812 pixels like you have will take ~24ms to each frame, meaning a max framerate of about 45fps. This is just math... WS2812 has a datarate of 800kbps and you've got 700 pixels each with 24 bits of data per color for 16,800 bits per frame. The math here actually says 21ms per frame, but there's a ~2-3ms overhead of sending that data over USB first.

As for the rest service, I honestly recommend writing an animation class (as I linked to earlier) that runs in a thread (just use threaded=True in run()) and then send data to that animation when you get the request over the REST service. If you give me a little more detail as to what exactly the effect you are going for is I might have something I can send you that would get you much of the way, but would have to wait until this evening anyways when I have access to that code.

24/7 is no problem. I have multiple permanently installed displays, one of them on my porch in a weather proof box but otherwise at the mercy of the cold. They run all day every day with no problem. Even when off. I actually have them setup to keep setting all pixels to off ever second when no other animation is playing (this is just part of PixelWeb). This may sound a little weird, but when you have really long runs of these LED strips they are susceptible to RF interference, even to things like turning a nearby ceiling fan on, and then you get a few stray pixels turning on. Having the pixels continuously updated takes care of this. But point being that it's being doing this for years now.

I almost exclusively use MeanWell brand power supplies like this one: https://www.amazon.com/Taiwan-meanwell-switching-LRS-350-12-monitoring/dp/B00YMA0M6G/
You can find them on Amazon, Mouser, ebay, etc.
You have to wire in your own power cord and note that most come switched to 220V so be sure to flip that over to 110V if you are in the US. But they are the best watts per dollar you can get. Given that I have displays that run 500W @ 5v (100A!) these things are great. You can also get them in 12v and 24v variants if your LEDs require it.

Not really sure what other materials you need... but pretty much all wires, connectors, etc I either buy on mouser, ebay, or Amazon.


RE: Individual LED control or Group Controls? - chavenor - 12-24-2016

WOW 24fps is going to be perfect for my setup. I recalculated it and I'll need 600 leds.

WOW great news on the PSU. Nice.

Who would I contact to buy chips from you in bulk? Of what is your definition of a bulk order?
When driving led's inside of a freezer/refrigerator should I be worried about the signaling getting messed up when the fridge turns on?


RE: Individual LED control or Group Controls? - Adam - 12-24-2016

What do you mean by chips? The AllPixel? LEDs?
If it's the AllPixel, you can purchase them through Tindie: https://www.tindie.com/products/ManiacalLabs/allpixel-universal-led-controller/?pt=ac_prod_search
Bulk order for us would be anything into the wholesale range (50+) as we have a really small profit margin already. How many are you looking to get?

Running in a fridge should be fine as long as everything is sealed and protected from any moisture.