Understanding how WS2813 works

So i am working on an idea for cabinet lighting, i would like to use some WS2813 Like this. I would like to run these under my cabinet and on top. I thought about using the pre-made tapes but i think i would like the spacing a bit further apart then what i have been able to find so far.

Trying to figure out how these leds are working i looked for some posts and the data sheets. All the post kept referring to the fastled code, which i took a look at. Then looking at a data sheet it looks like when the data is sent each led takes 24bit's for control. when the data is sent out the first led will it take the first 24 bit for its self and then sends the rest of the data on. So for example if there is 100 led the data that is sent out will be 100 24 bit packets? then there needs to be a small data break for the next series of data?

I just want to make sure i am understanding this correctly?

What i would like to do would be to run the under cabinet and over cabinet all on one data line. What would be a realistic max amount of leds in a single run.

So for example if there is 100 led the data that is sent out will be 100 24 bit packets?

Yes.

The devices chain, that is each LED regenerates the output signal and passes it in to the next. The main limit is how much current you can supply to the LEDs and how you can get that power to the LEDs over long distances. That is basically by using multiple power and ground lines. Then their is the memory requirement for the LEDs you want to control, each LED takes three bytes.

Ok so i am on the right track. When you mentioned memory, you mean memory on the arduino itself correct?

So as long as i inject(not sure the proper term?) power at certain points to the 5v line the leds them selves act as signal boosters on the digital lines.

So for example i have 100 lights, the first 50 are under the cabinet and the other 50 are on top. If i want the under cabinet lights on, but not the top, i would send out 100 packets with the first 50 being white and the next 50 being black.

Sorry i just want to make sure i understand, generally find it a bit easier to program when i get how things are working.

Another question, the refresh rate, again not sure if the is the right term, will be affected by the length of the string correct?

I mean, unless you are attempting to program them manually for fun, you'd be better off letting a library do all the heavy lifting. a FastLED has support for ws2813

You need to send out 3 bytes for every WS281"3" in the string. The data line is daisychained from device to device/
Connecting power at multiple places helps prevent voltage drop along the length of the power wire in the LED strip, otherwise LEDs at end could look dimmer than LEDs closer to where power is connected.
https://www.elecrow.com/blog/ws2813-vs-ws2812/

Two D-INs and 1 D-OUT? What’s the point?

In case of a bad led, the data is forwarded to the next led via the second data in pin. It prevents one bad pixel from ruining the entire strip or array.

Another question, the refresh rate, again not sure if the is the right term, will be affected by the length of the string correct?

Yes. Although at 100 leds you need 24 bits per LED so that is 100 x 24 = 2400 bits. This sounds a lot but you send data out at a rate of 800,000 bits per second. So it is very fast.

Your other points are correct as well.

Qdeathstar: I mean, unless you are attempting to program them manually for fun, you'd be better off letting a library do all the heavy lifting. a FastLED has support for ws2813

I wasn't planning doing it manually, though it wouldn't be hard to do it manually, i plan on using the library to an extent, but when i write the functions i needed to understand how it worked so i could write the code properly.

Thanks for the advice guys, still trying to see if i can find something prewired with more spacing then what most of the tapes have. if not i will have to order those ones that are separate.

though it wouldn't be hard to do it manually

Are you sure about, the timing is tight and is so close to the clock speed of the processor?

tallguy64: I wasn't planning doing it manually, though it wouldn't be hard to do it manually

Definitely not true. You only have 10 (on 8mhz) or 20 (on 16mhz) processor cycles per bit!

I know the Adafruit one does it with inline assembler. I just tried to check how fastLED did it, and I wasn't able to find the code to send the data to WS2812s.

Grumpy_Mike: Are you sure about, the timing is tight and is so close to the clock speed of the processor?

I get what your saying, but an uno isn't necessarily the best fit for the project, and esp8266 would be a better fit for something like this, especially with home automation it would make it much easier for communication.

Hi.

A ESP8266 definitely is not a better fit than an UNO for driving WS2813 chips. The issue is that they require a very tight timing and the ESP8266 will take over control of the chip, resulting in "giltching" when you try to fresh large numbers of WS2812/13 strips. You cant really drive over 100 chips from an ESP8266 without experiencing the issue.

Just because the ESP8266 has a faster clock speed doesn't mean you you get better results.

The only issue with using an UNO to drive them is limited memory. The mega might be the best for driving strips, because it has a lot of memory. A teensy would be a close second, but only because you have to deal with level shifting as it is a 3.3v device.

BTW, the ESP8266 is also a 3.3v device so you you have to use a level shifter with it aswell. It is probably the worse microcontroller to use to control smart LEDS.