G’day everyone. I have a custom LED strip for a project, a digital RGB running TM1803 6 pixels per IC. My question is what is the limit, how many ICs can be controlled with 1 pin?
Depends on a lot of things (or, to put another way - this is not a simple question):
-
what MCU are you using? A stock arduino only has 2k of ram, and each rgb pixel takes up 3 bytes of ram (not including memory taken up by everything else you’re doing), so realistically, you can drive up to, say, 500 leds. Maybe less.
-
What frame rate do you want? The TM1803 is a slow chipset, 60µs per led. If you want 60 fps, you’re limited to about 140 leds (assuming you want cpu time to do things like generate your effects/frames). The math for that - assuming you did nothing but write led data, at 60µs per rgb pixel, you’re looking at a total of 16,667 rgb led updates/second. That sounds like a lot, but when you factor that you’ll want to spend at least half of your cpu time doing things other than pushing led data, now you’re at 8,333 rgb led updates/second. Still sounds good, no? Well, now divide that by the number of frames per second you want your animation to have - at 60fps you’re down to 138 leds.
-
What kind of power source do you have available? That is also likely to impact how many leds you can run. Also note that many led chipsets/setup require injecting power every 100 (or so) rgb leds. (Note: for TM1803 strips, which often have 3 or 6 rgb leds per_pixel this means you’ll want power every 33 or 16 “pixels”)
Hi Daniel, thank you for a quick reply! I’m using Arduino MEGA 2560. I’m testing with DemoReal100 at the moment. We will use it on the outside of the building and I need it to run 250m of LED strip. I will add more Arduinos if needed. For now I just tried to upload the DemoReal100 with number of LEDs set to 2500, that is the amount of ICs on 250m strip. It used 93% of the memory. I have to ask LED strip manufacturer if the data line can handle it. What is your opinion?
I just got the answer from the manufacturer. One data line with 1803 IC can control 1000ICs. That means 100m in my case.
That means I need to use another pin for next 100m (as another channel). ?Is there a code I can use that would use another pin as consecutive to the first one?
The mega2560 has 8kb of ram, which means, realistically, you’re capped off at about 2500 leds. Of course, the moment you start doing anything interesting, pattern wise, you’re going to run out of ram very very quickly there.
And yes, you can use multiple pins - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for information on using multiple outputs.
However, keep in mind that 2500 leds is going to take 150ms to write out the data for. Which means that you’ll get … maybe 3-5 frames/second. If you’re lucky.
I would strongly recommend looking at a controller like the teensy 3.2, which gets you more memory, as well as the option of using 8-way parallel output (which would turn your frame write times to 18ms/frame, which would let you get close to 30fps update rates). Let me know if you go that route, i’ll have to make a slight library change to support parallel output for the TM1803.
Yes, I’ll definitely go that way! So with 1x Arduino and 1x teensy 3.2 I could control whole 250m of strip?! How long can those data lines be before connected to strip?
Hey Daniel, that link really helped I got “One array, many strips” working, but having trouble how to load a “rainbow” or “rainbowWithGlitter” to work seamlessly over 3 pins.
Also what about if the strips are not the same length?
Sorry for being such a noob!
Hi @Uros_Lotric ,
I used a MEGA2560 for my Xmas tree last year. It has only 332 WS2811 LEDs distributed on 34 different pins that is used to send data to 34 different branches. Each branch has any number of LEDs from 4 (minimum) up to 13 (maximum). Here’s a cut&paste from my setup()… you will se it is possible to have different strip lenghts on different pins…
void setup() {
FastLED.addLeds<WS2811, 52>(leds, 0, 13); // White branch #1
FastLED.addLeds<WS2811, 50>(leds, 13, 13); // White branch #2
FastLED.addLeds<WS2811, 48>(leds, 26, 13); // White branch #3
FastLED.addLeds<WS2811, 46>(leds, 39, 13); // White branch #4
FastLED.addLeds<WS2811, 42>(leds, 52, 13); // White branch #5
FastLED.addLeds<WS2811, 40>(leds, 65, 13); // White branch #6
FastLED.addLeds<WS2811, 38>(leds, 78, 12); // Orange branch #1
FastLED.addLeds<WS2811, 36>(leds, 90, 12); // Orange branch #2
FastLED.addLeds<WS2811, 32>(leds, 102, 12); // Orange branch #3
FastLED.addLeds<WS2811, 30>(leds, 114, 12); // Orange branch #4
FastLED.addLeds<WS2811, 28>(leds, 126, 11); // Grey branch #1
FastLED.addLeds<WS2811, 26>(leds, 137, 11); // Grey branch #2
FastLED.addLeds<WS2811, 53>(leds, 148, 11); // Grey branch #3
FastLED.addLeds<WS2811, 51>(leds, 159, 11); // Grey branch #4
FastLED.addLeds<WS2811, 49>(leds, 170, 11); // Grey branch #5
FastLED.addLeds<WS2811, 47>(leds, 181, 11); // Grey branch #6
FastLED.addLeds<WS2811, 43>(leds, 192, 10); // Pink branch #1
FastLED.addLeds<WS2811, 41>(leds, 202, 10); // Pink branch #2
FastLED.addLeds<WS2811, 39>(leds, 212, 10); // Pink branch #3
FastLED.addLeds<WS2811, 37>(leds, 222, 9); // Yellow branch #1
FastLED.addLeds<WS2811, 33>(leds, 231, 9); // Yellow branch #2
FastLED.addLeds<WS2811, 31>(leds, 240, 9); // Yellow branch #3
FastLED.addLeds<WS2811, 29>(leds, 249, 9); // Red branch #1
FastLED.addLeds<WS2811, 27>(leds, 258, 9); // Red branch #2
FastLED.addLeds<WS2811, 45>(leds, 267, 9); // Red branch #3
FastLED.addLeds<WS2811, 44>(leds, 276, 8); // Blue branch #1
FastLED.addLeds<WS2811, 34>(leds, 284, 8); // Blue branch #2
FastLED.addLeds<WS2811, 35>(leds, 292, 8); // Blue branch #3
FastLED.addLeds<WS2811, 25>(leds, 300, 4); // Point #1
FastLED.addLeds<WS2811, 24>(leds, 304, 4); // Point #2
FastLED.addLeds<WS2811, 23>(leds, 308, 4); // Point #3
FastLED.addLeds<WS2811, 22>(leds, 312, 4); // Point #4
FastLED.addLeds<WS2811, 3>(leds, 316, 5); // Top
FastLED.addLeds<WS2811, 2>(leds, 321, 11); // Star
}
Hi again, I would strongly recommend you get a Teensy3.2 with it’s OCTOWS2811 adaptor from http://pjrc.com for that many LEDS, like Daniel also suggested.
Also, I would forget that idea of splitting your LEDs between any Arduino and the Teensy3.2 and go with just the Teensy3.2 and OCTOWS2811adaptor.
How would you deal with the synchronisation between the 2 different MCUs !?!?
Thank you Roy for an example! I’ll have a look in it… Regarding Teensy3.2 I didn’t know it’s a MCU that is why I asked what I need, I thought it is just a shield for Arduino. I need to read a bit more about FastLED from the beginning!