Does anyone know the maximum size (in RGB pixels) FastLED can handle with one digital output? at which framerate?
That depends on a lot of things.
First of all, it depends on the type of leds that you’re using. For example, if you are using WS2812 leds, they have a data rate of 800khz, and since there’s 24-bits of data per pixel (8-bits each for red, green, and blue data) that works out to a total of 33,333 writes of RGB data per second. How that translates into frame rate depends on how many leds you have. If you have 1000 leds, then you can do at most 33 frames per second. If you have 100 leds, you can do 333 frames per second. (N.B. WS2812’s get REALLY unhappy if you try to drive them at higher than 400fps). Alternatively, if you are using APA102’s, they have a data rate of 24Mhz, and there’s 32 bits of data per pixel (8 bits each for red, green, and blue and then another 8-bits for some control data). That’s a maximum of 750,000 led writes per second.
So - that gives you the base rate for how many leds you can update per second. However, the reality is that these numbers only indicate the rates if you spent 100% of your CPU time pushing RGB data. Since that’s unlikely to be what you want, then the next question becomes how much CPU time does it take you to prepare each frame.
Thank you Daniel for your answer.
Yes, what i know best is the WS2811 which seems to operate at 800khz / 24bits too.
First, in the previous post, i wanted to know if there were any limitations given by the FastLed code like an access to array in byte size (<256)… for instance…
So yes, the arduino is clearly the bottleneck.
Do you have any estimation (even very approximative) of FASTLED fastest method to set rgb leds.
If not, i will try later when my hardware is available, and will publish the result.
Best !
Again, it depends what you want to do. I do a lot of stuff with noise functions - and have been able to drive 256 LEDs at 30-50fps. The more computation you are doing per pixel, the lower your frame rate will be.
@Pierre_Gufflet What is the hardware that you will have available ??
@Daniel_Garcia thanks, independently of any additional cost like noise can give, i’ll give the results of a very simple program.
@JP_Roy all my strips are performing overseas…
@Pierre_Gufflet I think something got lost in the translation…
What is the hardware you plan to use ?
It is already written in the previous post : WS2811.
OK and what microcontroller ?
I will first try with the ATmega328. If it is really too slow, i will go for 32bits microcontrollers.
The ATmega328 has only 2Kb sram that will probably be your ‘limiting’ factor!
Each RGB LED needs 3 bytes of storage and I think that the ATmega328 won’t handle more than 500 LEDs (1,5Kb) as some space is necessary for system variables etc…
yes you are right. but the cpu cost question is more important in my case. memory limitations can always be tackled in any way.
in the kingdom of micro controllers, the cpu cycle imports much more as you can’t boost it.
@Pierre_Gufflet But your initial question was…
" Does anyone know the maximum size (in RGB pixels) FastLED can handle with one digital output? "
Are you no longer concerned with this ??
Wow…
My question is very plain. I apologize to not have mentioned first what was my purpose…
I don’t use one strip but kms of strips on huge art installations, and I have been working for 10 years in led kingdom in Asia…
So my question is related to know any limitations about fastled library and optionally some experience about arduino hardware and led.
Usually i use proprietary led controller that has nothing to do with arduino because it outperforms it in every case.
I want to port some parts of my creations onto arduino to make it easier to travel and give to anybody.
So, for instance fastled is able to control 60000 rgb led , yes no?
Fastled onto arduino of course, 60000 led, arduino yes no
Which arduino?
For which given frame rate 1, 10,15,25,30,60 (I usually work at 60…)
JP Roy, if you don’t know , just say “I don’t know”, that will be all right.
The memory question is a bad anticipation strategy. Whatever the ram or static memory will be available on any hardware, it is always possible to boost it.
But in CPU cycles count thinking, if you want to design for 1 5 or 60000 LEDs , it is all about how your code is optimized so that it doesn’t cost too much time and avoid an horrible jerky animation
@Daniel_Garcia I will compile the code and count the lines. Thank you at least for your answer. And congratulation for your amazing library.
I would certainly not try to control 60,000 leds off of a single arduino. For something at that scale I would look to breaking things off to multiple controllers that are coordinating in some fashion (see further below for some other options).
(Also, regarding CPU cost - if you’re driving thousands of leds, the difference in cost between an arduino nano and a teensy 3.1, for example, is miniscule. In my personal projects, my housings, diffusers, and mounting hardware and wiring ends up dwarfing the cost of my MCU, which is usually less than 2-5% of my final cost)
I know of FastLED installations driving 5000-10000 leds, but usually running off of something like an Arduino Due or a Teensy 3.1 and either using parallel output tricks to drive WS2812’s at higher rates or using chipsets with faster data rates like the APA102. (I personally have built/run a 4000 led WS2812 based installation running off of just an arduino due that ran at about 75fps)
The options for extending memory on the arduino platforms will cause you a significant amount of cpu time pressure, as reading/writing memory via SPI transports is orders of magnitude slower than SRAM (though some of this can be mitigated if you are using a platform that has DMA support and you can schedule block transfers intelligently to stage/prep data).
For what you’re doing some other options that I would recommend looking into, if FastLED doesn’t quite work at the scale that you want:
- FadeCandy - each fade candy board can drive 500 leds at 400fps and it provides intra-frame interpolation to give you a higher amount of dynamic range than you’d usually get off of 8-bit rgb leds (FastLED has a temporal dithering mechanism that has a similar effect, but using a different technique) - you can then drive a batch of them via usb from a raspberry pi or a beaglebone black if you want something smaller than a PC
- LEDsCape - this is a cape for the beaglebone black that can drive 32 strips of WS2812 leds in parallel
- Pixel pusher - I don’t know a whole lot about this platform, but I know that it is out there
For 60,000 leds at 60fps you need an aggregate update rate of 3,600,000 rgb led updates per second.
If you’re using WS2812 leds, at a maximum of 33,333 rgb led updates/second even with the 16-way output on the teensy 3.1 you’re looking at a maximum of 533,000 rgb led updates per second (assuming 100% of your CPU time is spent pushing led data - a rough guideline i recommend for people juggling these things is to assume for spending 50% of CPU time pushing led data (and/or prepping led data to be pushed). Of course, here your limit is primarily going to be the slow data rate of the WS2812s (even if you’re using a DMA ws2812 driver, like OctoWS2811 w/FastLED’s OctoWs2811 driver on the Teensy 3.1 - you are still pretty limited by the data rate of the 2812s - so you’d be stopped at about 266,000 rgb led updates/second).
To get 3.6 million rgb led updates per second with WS2812’s you’d need a minimum of 108 parallel lines of WS2812’s.
To get 3.6 million rgb led updates per second with APA102’s, you’d only need 5(ish) parallel lines of APA102’s running at 24Mhz. I want to do some work to see if I can do parallel output for APA102’s (either 7 or 15 way) on the teensy 3.1, but for a variety of reasons, the effective data rate on each line will be far lower than 24Mhz (though, from some quick math it looks like if I can keep the data rate on each line above 8Mhz I can hit the mark that you want and parallelism will give me a high enough aggregate data rate to get what you’d want).
Some other fun numbers from the scale you gave me above. 60,000 8-bit rgb leds running at 60 fps means you need an aggregate combined data rate of at least 86Mbps - that’s assuming, of course, that your rgb leds only require 24-bits of data. For the APA102, which require 32 bits of data per pixel, then you’re looking at needing a combined data rate of at least 115.2Mbps.
(“Maximum number of leds at maximum frame rate” is a bit of a poor question - because you can always increase the number of leds by decreasing the frame rate, or increasing the framerate by decreasing the numbers of leds. This is why @Mark_Kriegsman and I often end up steering the conversation towards “total number of rgb led updates per second” to get a ceiling – and then you walk backwards from there for the CPU cost of figuring out what you want on each pixel, e.g. if you are running a noise function to generate the value for each pixel, etc…)
wow and then… WOW !!!
First there was the question…
Does anyone know the maximum size (in RGB pixels) FastLED can handle with one digital output? at which framerate?
With one digital output ???
Second there was the first clarification…
Yes, what i know best is the WS2811 which seems to operate at 800khz / 24bits too.
seems to operate at 800Khz??? Seems???
Third is the answer following my first question: " What is the hardware that you will have available ??..
all my strips are performing overseas…
WTF, I never learn, I should have quit when I started feeling pukey…
Fourth is “JP Roy, if you don’t know , just say “I don’t know”, that will be all right.”…
Damn, I give up… The answer is: 42 !!!
Sincerely sorry for making this post so long…
Though i am not working all time in electronic design now, i understand perfectly all the replies and thank you for all the time you spent to answer to my vague question. That’s not nothing, i respect it a lot.
Again, i was not looking for any advices of how to design a led system, but thank you very much for yours replies.
Maybe it is unusual for you as you are more electronic expert than me and aware about all of that, but when i start to design electronics, i always first think about how much cpu cycles approximately will cost my design and i always partition the different task to go on different choices.
I am “old school” designer…
Of course, sdcard has a substantial cost, yes but this is an extra question depending on what i do, for what, in which way i communicate or not with real world, serial, ethernet or sd…
All of these questions are extra cpu cost, not FastLed cpu cost.
How it is plugged is extra question. I ask for only one digital output.
My question was plain and vague, yes. I apologize. I believed it was enough to have a consistent reply or at least an experienced one without entering into reallife very costly chats.
Rob i like your answer of 42 ! That 's pretty cool, a very symbolic number. 
I simply wish you a very pleasant day like it is here in barcelona.
You are invited to have a look to my work in http://www.visualsystem.org at least for your viewing pleasure, my first purpose… better than chatting or talking.
And see you in a few weeks here, i will post some accurate practical results !
best
p.
Hey Daniel - I’m trying to figure out the limits of a Due with the P9813. Can you tell what the data rate is based on http://www.seeedstudio.com/wiki/images/b/be/P9813_datasheet.pdf