Animation speed for 900 Ws2812b

I have three 5M steps of Ws2812b leds (900 total) connected together in series around the roof line of my house. In using the code found at https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effect/
And everything seems to work fine. When I set the SpeedDelay for example in the Cylon animation to 0 which is the fastest I can make it, it's still slow. I know the fewer the leds the faster the animation.
First of I'm a noob so I don't understand why the more leds the slower ( perhaps someone can explain in noob lingo). Secondly, is their a way to speed up the animations on a length of 900 Leds? I appreciate any suggestions and help. Thanks

First of I'm a noob so I don't understand why the more leds the slower

Because all the data has to be sent to the strip. The WS2812 has strict timing requirements on the data bits, the data line must be held at a high state and a low state for a fixed amount of time. It is the ratio between the time the data signal is high and low that defines if it is interpreted as a logic one or logic zero. So the more LEDs the more data and the slower it is.

is their a way to speed up the animations on a length of 900 Leds?

No.

If you tell a friend to give you $1 how long would it take.
If there were 899 people that had to first get the request, how long would it take to get $1 if your friend was at the end of line of people.

Grumpy_Mike:
Because all the data has to be sent to the strip. The WS2812 has strict timing requirements on the data bits, the data line must be held at a high state and a low state for a fixed amount of time. It is the ratio between the time the data signal is high and low that defines if it is interpreted as a logic one or logic zero. So the more LEDs the more data and the slower it is.
No.

larryd:
If you tell a friend to give you $1 how long would it take.
If there were 899 people that had to first get the request, how long would it take to get $1 if your friend was at the end of line of people.

Okay, That's a bummer. Thanks for the info.

There definitely are ways to speed it up.

First of all, post your code, exactly as you uploaded it to the Arduino (Mega?). Please read the forum guidelines in the sticky post of you haven't already, so you know how to post code correctly.

It is possible there are delay() functions used in the code that don't reduce to zero when you set SpeedDelay to zero. If these can be reduced, then speeding up the animation will be easy. If not, there may be other parameters that have an effect on the apparent speed of animation (eg. how much change there is between each successive frame).

900 LEDs @24 bits per led is 21,600 bits to update all strips. Ws2812b strips update at a frequency of around 800KHz, so one "frame" should take 0.027 seconds to transmit. That's 37 frames per second. In practice, you won't ever get that theoretical full speed, but anything over 20 frames per second should give a reasonably smooth update.

If those ideas fail, then there are more options, but they will not be simple. There are faster Arduinos, some that can use Direct Memory Access methods to update the strip while the next frame is being prepared, such as the AdaFruit ItsyBitsy M0 board. There is a library called "octoWs2811" that could be used that can update 8 strips at the same time. This would require moving to a Teensy 3.x board, re-wiring the strips and re-coding. So let's look at your code first.

I believe it should also be possible to cut the long strip into several shorter ones and adress all these short strips from different pins. Say you cut it in 9 strips of 100 LEDs each and put them back in the original order. You declare and connect the 9 different strips (says strip1 to pin 3, strip2 to pin 4, ... strip9 to pin 11 for example) and write your code accordingly, to control each strip so they light up when required.

With this, the shorter strips should react quicker.

@lesept
the requirement was:-

rinkguy:
connected together in series around the roof line of my house.

No problem, it's just a question of length of wires. He only needs to connect for example the DIN of LED number 100 with a wire of the length of strip number 1 (LEDs from 0 to 99) to the chosen pin. I think this can be called (at least in french): shunt the control of the first 100 LEDs.

He can do the same with supply, or not. But any other solution can be done as well.

No problem, it's just a question of length of wires.

No the length of the wires is the problem. In a strip each LED regenerates the signal. You try sending a Neopixel data stream over a long length of wire and you will find it does not work at the other end. Do do that you need some form of differential send and receive buffer.

Anyway it does not sound like it is an installation where you could usefully update one portion and not the other. And as PaulRB pointed out the refresh rate isn’t a problem with that number of LEDs.

I'm not sure I understand what you mean.

I have 2 WS2812 LED rings of 16 LEDs each working in series with a 3.3V supply (maybe 3.7V it's a LiPo battery) and data sent from an ESP-01, the rings are connected to the ESP-01 with at least 2 meters wires (maybe 3 I'll check) and it's working perfectly.

rinkguy talks about 3 strips with 300 LEDs each, 5 meters each, so 100 LEDs should be 1.66 m long. Not that much. If the Arduino is located at the center of strip number 5, the maximum wire length is 1.66/2 + 3*1.66 = 5.8m.

I'm not sure I understand what you mean.

You seem to have some misconceptions about how the WS2812 system works.
Each LED reconstituted the signal so the distance between LEDs is important not the total length of the strip.

and it's working perfectly.

So is it just functionality you are looking at or have you done any measurements on that?

It is most likely that it is on the bring of failing, but as I suspect you are not actually measuring anything so anything could happen.

If the Arduino is located at the center of strip number 5, the maximum wire length is 1.66/2 + 3*1.66 = 5.8m.

That is just a silly statement. You can not locate an Arduino at the center of a strip.

Sorry for my bad English. I meant the arduino is located close to the center of the strip, not in the strip of course. The data wire to the center strip would be 83 cm long, the data wire to the next strip would also be 83 cm long, the data wire to the second next strip would be 83 + 166 cm long and so on.

Do you need a picture?

I measured my wires, the are close to 1.5 meters, sorry for the inaccuracy of my previous message... But as you said, my leds rings work perfectly, meaning they do the light animations I programmed.

I didn't do any oscilloscope measurement as you anticipated, because I don't need to do it.

I didn't do any oscilloscope measurement as you anticipated, because I don't need to do it.

You do need to do it if your are going to use the word “perfectly “ to describe how your LED rings work. Otherwise you can just say it works for you.

I don’t see how your numbers add up to 15 meters.

I have three 5M steps of Ws2812b leds

Grumpy_Mike:
You do need to do it if your are going to use the word “perfectly “ to describe how your LED rings work. Otherwise you can just say it works for you.

You're perfectly right :slight_smile:

Grumpy_Mike:
I don’t see how your numbers add up to 15 meters.

I never said 15 meters. In the case of 9 short strips, it adds up to 22 m. On the picture below, the orange square is the Arduino, the blue rectangles are the strips. I put them like this to have a smaller image, but they can be in line, the result is the same. Le longest wire length is 5.8 m (quite long)

In the case of 9 short strips,

Great you propose a soloution that involves ripping up what the OP has and replacing it with a soloution that will never work.

The distance you propose for the longest wire is 5.83 meters. This based on a personal experience as it being OK to have a wire length of 1.5 meters between Arduino and first LED in the strip.

You honestly think this amounts to a soloution?

It can easily be tested : just connect one of the available strips (without cutting it of course) with a 6m long wire to the data pin and see if it lights up and can be controlled. Have you ever tested yourself before saying it won’t work ?

His problem was about “the more leds the slower”: shorter strips won’t have this drawback. That’s all I say. If longer data wires don’t work, then my solution is b***it. But what makes you say it “will never work” without testing it?