New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How many leds? #288

Closed
DarkHunterer opened this Issue Apr 12, 2016 · 7 comments

Comments

Projects
None yet
6 participants
@DarkHunterer

DarkHunterer commented Apr 12, 2016

Forgive me if you see this question for the 100th time but I didn't find it in FAQ, neither in wiki.

So the question is, how many ws2812b leds can I control? I mean what is really the maximum length?
They are 800kbs, right? What could be the bottleneck, the reduction of signal amplitude? The voltage drop on led strip?
Did you try when would I have to regenerate the signal?
How many meters can be powered with single source?

Thank you for answering.

@electrokean

This comment has been minimized.

Show comment
Hide comment
@electrokean

electrokean Apr 12, 2016

This doesn't relate to the FastLED library, so it would be better discussed on the FastLED Google+ group - http://fastled.io/+

That said, your biggest issue is going to be voltage drop on the strip, and that will depend on how bright you're running the LEDs and how many are on simultaneously. You can always inject power along the strip in segments with heavy cable from a large PSU, or via several "point of load" power supplies. Just make sure to keep a common ground connection.

With the WS2812B and similar LEDs, the data signal itself is regenerated by each LED chip, so that isn't generally an issue.

With enough LEDs, your next bottleneck will be either memory capacity of your microcontroller, or the time to send each data frame (depending on your desired update rate).

electrokean commented Apr 12, 2016

This doesn't relate to the FastLED library, so it would be better discussed on the FastLED Google+ group - http://fastled.io/+

That said, your biggest issue is going to be voltage drop on the strip, and that will depend on how bright you're running the LEDs and how many are on simultaneously. You can always inject power along the strip in segments with heavy cable from a large PSU, or via several "point of load" power supplies. Just make sure to keep a common ground connection.

With the WS2812B and similar LEDs, the data signal itself is regenerated by each LED chip, so that isn't generally an issue.

With enough LEDs, your next bottleneck will be either memory capacity of your microcontroller, or the time to send each data frame (depending on your desired update rate).

@Daniel-dk

This comment has been minimized.

Show comment
Hide comment
@Daniel-dk

Daniel-dk Apr 12, 2016

Contributor

TLDR:
it depends on a few things, generally they are :

  1. : The amount of RAM that your uC has
  2. : the framerate you want to achieve
  3. : the power supply capacity ( and cable capacity )
  • Uno/Leonardo/micro/nano : I don't go above 512 LEDs ( 1.5kByte of SRAM reserved for LEDs ),
  • Mega : Ive done 1000 LEDs but not with many other things happening. ( 3 kByte of SRAM reserved for LEDs )
  • DUE/ Zero : quite a lot of LEDs ( multiple controller examples ) never more than 1000 per "FASTLED controller" to keep framerate above 30.

my reasons:

SRAM usage
Each LED ( or CRGB array entry ) uses 3 bytes of your SRAM.

The application on your uC will crash - sometimes "randomly" sometimes reliably - when it has too little SRAM to hold the datait needs to work on.

The amount of SRAM available for LEDs depends on what else the controller is doing that also requires SRAM buffers or "chunks" such as :

  • String manipulation
  • Networking ( Ethernet / Wifi with OSC, OPC or MQTT protocols )
  • Serial data ( DMX ),
  • Visualisations/ animations ( Fire 2012 , meteors, fireworks )
  • Signal processing (audio spectrum FFT)
  • Double buffering pixel data ( if you use it as an output for a video - like Processing.org sketches)
  • Stored color pallets ( interpolation happens in SRAM )
  • Arduino buffers ( 64 byte reserved for Serial buffers, I2C buffers, SPI buffers if they are initialised )
  • other things stored in SRAM ( Serial.print("some text "); uses SRAM to store the "some text" )

Arduino Leonardo, Micro, Uno, Nano only has 2.5 kByte of SRAM,
Mega has 4 kByte SRAM.
Due, Teensy has oodles of SRAM, , DUE has 96kByte
Zero / MKR1000 has 32kByte SRAM

Required framerate - mostly to keep the animations or video frames looking smooth

  • 1024 WS2812B LEDs spoken to at 800 kHz will give you 30 FPS
    any more will lower your framerate
  • on DUE I have done about 3000 LEDs with 3 "controllers" , each one driving less than 1024 so the framerate stayed above 30 fps

Power supply rating ( and cabling used )

  • There is a voltage drop over the LED strips so we generally inject power every 2 strips ( 10 m ) with high capacity power cable. and with multiple supplies in parallel.
  • WS series ( 2811,2812,2812B ) LEDs have output drivers that "refresh" the signal when it is forwarded to the next LED in line, you could go a few m in-between LEDs ( Ive done up to 6m which is pushing it a bit as any other cables near the signal wire corrupted the signal )
Contributor

Daniel-dk commented Apr 12, 2016

TLDR:
it depends on a few things, generally they are :

  1. : The amount of RAM that your uC has
  2. : the framerate you want to achieve
  3. : the power supply capacity ( and cable capacity )
  • Uno/Leonardo/micro/nano : I don't go above 512 LEDs ( 1.5kByte of SRAM reserved for LEDs ),
  • Mega : Ive done 1000 LEDs but not with many other things happening. ( 3 kByte of SRAM reserved for LEDs )
  • DUE/ Zero : quite a lot of LEDs ( multiple controller examples ) never more than 1000 per "FASTLED controller" to keep framerate above 30.

my reasons:

SRAM usage
Each LED ( or CRGB array entry ) uses 3 bytes of your SRAM.

The application on your uC will crash - sometimes "randomly" sometimes reliably - when it has too little SRAM to hold the datait needs to work on.

The amount of SRAM available for LEDs depends on what else the controller is doing that also requires SRAM buffers or "chunks" such as :

  • String manipulation
  • Networking ( Ethernet / Wifi with OSC, OPC or MQTT protocols )
  • Serial data ( DMX ),
  • Visualisations/ animations ( Fire 2012 , meteors, fireworks )
  • Signal processing (audio spectrum FFT)
  • Double buffering pixel data ( if you use it as an output for a video - like Processing.org sketches)
  • Stored color pallets ( interpolation happens in SRAM )
  • Arduino buffers ( 64 byte reserved for Serial buffers, I2C buffers, SPI buffers if they are initialised )
  • other things stored in SRAM ( Serial.print("some text "); uses SRAM to store the "some text" )

Arduino Leonardo, Micro, Uno, Nano only has 2.5 kByte of SRAM,
Mega has 4 kByte SRAM.
Due, Teensy has oodles of SRAM, , DUE has 96kByte
Zero / MKR1000 has 32kByte SRAM

Required framerate - mostly to keep the animations or video frames looking smooth

  • 1024 WS2812B LEDs spoken to at 800 kHz will give you 30 FPS
    any more will lower your framerate
  • on DUE I have done about 3000 LEDs with 3 "controllers" , each one driving less than 1024 so the framerate stayed above 30 fps

Power supply rating ( and cabling used )

  • There is a voltage drop over the LED strips so we generally inject power every 2 strips ( 10 m ) with high capacity power cable. and with multiple supplies in parallel.
  • WS series ( 2811,2812,2812B ) LEDs have output drivers that "refresh" the signal when it is forwarded to the next LED in line, you could go a few m in-between LEDs ( Ive done up to 6m which is pushing it a bit as any other cables near the signal wire corrupted the signal )
@focalintent

This comment has been minimized.

Show comment
Hide comment
@focalintent

focalintent Apr 12, 2016

Member

How many leds is a complex question - it depends on the amount of ram on the hardware that you have (e.g. about 600 on a given arduino, more like 10-15,000 on the teensy). It also depends on what kind of frame rate that you want. It takes 30µs to write out a single led's worth of data, so the absolute maximum number of rgb led updates per second that you can do is about 33,000 (or, if you're doing 8-way parallel output 260,000ish). Of course, that's assuming spending 100% of your time writing led data.

Re: maximum length - there really isn't one. Because each WS2811/WS2812 re-generates the signal, in theory you can have as long of a chain as you want (as long as you inject power regularly, see below - or every 100 or so). Voltage drop is the reason why you need to inject power at various points - but because of the signal regeneration happening at each chip, you don't have to worry about voltage drop/signal degradation as a function of length.

Member

focalintent commented Apr 12, 2016

How many leds is a complex question - it depends on the amount of ram on the hardware that you have (e.g. about 600 on a given arduino, more like 10-15,000 on the teensy). It also depends on what kind of frame rate that you want. It takes 30µs to write out a single led's worth of data, so the absolute maximum number of rgb led updates per second that you can do is about 33,000 (or, if you're doing 8-way parallel output 260,000ish). Of course, that's assuming spending 100% of your time writing led data.

Re: maximum length - there really isn't one. Because each WS2811/WS2812 re-generates the signal, in theory you can have as long of a chain as you want (as long as you inject power regularly, see below - or every 100 or so). Voltage drop is the reason why you need to inject power at various points - but because of the signal regeneration happening at each chip, you don't have to worry about voltage drop/signal degradation as a function of length.

@DarkHunterer

This comment has been minimized.

Show comment
Hide comment
@DarkHunterer

DarkHunterer Apr 12, 2016

Thank you for your complex answers!

I'm going to study my needs now but I believe that what I read here is enough for my question.

Thanks again.

DarkHunterer commented Apr 12, 2016

Thank you for your complex answers!

I'm going to study my needs now but I believe that what I read here is enough for my question.

Thanks again.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Feb 26, 2017

Hello,

Thanks for informations

But I don't understand, How to calculate the number of LED WS2811 that can be put on a microcontroller ?

Can you help me for this calculation, with the size of RAM, the speed of the µC ?

And for my application, I need to receiv data with the 1.31 protocol and I find this takes place in RAM ?

thanks and soory for my level in english ..

ghost commented Feb 26, 2017

Hello,

Thanks for informations

But I don't understand, How to calculate the number of LED WS2811 that can be put on a microcontroller ?

Can you help me for this calculation, with the size of RAM, the speed of the µC ?

And for my application, I need to receiv data with the 1.31 protocol and I find this takes place in RAM ?

thanks and soory for my level in english ..

@ajensen2

This comment has been minimized.

Show comment
Hide comment
@ajensen2

ajensen2 Oct 5, 2017

Hello All,

First off, I am a complete newbie so thanks for any insight and help.

I am putting together a Christmas Light Display using Arduino's. Part 1 is 16 Solid State Relays being controlled with Vixen through an Arduino Mega. Part 2 is strips of Mukungit WS2811 Pixels. I just got the LED Strips last night and I copy and pasted some code for PixelFlex to get them to interact with Vixen and it mostly worked. I know now (after reading this thread) that one issue is that I was using an Uno because it's what I had laying around and I could tell it wasn't as responsive as I would like. Another problem is that some of the Pixels in the middle of the strip stayed lit and were not controlled with the rest of the pixels. I imagine that this is a symptom of me copying and pasting code that was not the right thing. When ran a simple chase code all of the Pixels responded appropriately so I know that the strand of pixels is fine.

Now, for the big question... Each strand has 300 Pixels and I would like to run 8 strands. Furthermore, I would like to run them all independent from each other. How many of what controllers would you recommend to control these? From this thread I am getting the feeling that a DUE might be the right answer for me but will one do it? I'm good with power, I'm just lost when it comes to coding and the processing speed of Arduino's. I bought the book "Programming Arduino" and am working my way through that.

yes, I know I need to start small.... but that's not my style. That's why I am starting to work on my Christmas Display at the end of September. Thanks in advance!

ajensen2 commented Oct 5, 2017

Hello All,

First off, I am a complete newbie so thanks for any insight and help.

I am putting together a Christmas Light Display using Arduino's. Part 1 is 16 Solid State Relays being controlled with Vixen through an Arduino Mega. Part 2 is strips of Mukungit WS2811 Pixels. I just got the LED Strips last night and I copy and pasted some code for PixelFlex to get them to interact with Vixen and it mostly worked. I know now (after reading this thread) that one issue is that I was using an Uno because it's what I had laying around and I could tell it wasn't as responsive as I would like. Another problem is that some of the Pixels in the middle of the strip stayed lit and were not controlled with the rest of the pixels. I imagine that this is a symptom of me copying and pasting code that was not the right thing. When ran a simple chase code all of the Pixels responded appropriately so I know that the strand of pixels is fine.

Now, for the big question... Each strand has 300 Pixels and I would like to run 8 strands. Furthermore, I would like to run them all independent from each other. How many of what controllers would you recommend to control these? From this thread I am getting the feeling that a DUE might be the right answer for me but will one do it? I'm good with power, I'm just lost when it comes to coding and the processing speed of Arduino's. I bought the book "Programming Arduino" and am working my way through that.

yes, I know I need to start small.... but that's not my style. That's why I am starting to work on my Christmas Display at the end of September. Thanks in advance!

@AndyBadger

This comment has been minimized.

Show comment
Hide comment
@AndyBadger

AndyBadger Dec 5, 2017

ajensen2 - check out the controllers from SanDevices. I started my Christmas display using Arduinos and have transitioned to the SanDevices E6804 controller. It is awesome and has good fusing on each output for protection. Also check out xLights software too. I am right now switching from Vixen to xLights. Good luck.

AndyBadger commented Dec 5, 2017

ajensen2 - check out the controllers from SanDevices. I started my Christmas display using Arduinos and have transitioned to the SanDevices E6804 controller. It is awesome and has good fusing on each output for protection. Also check out xLights software too. I am right now switching from Vixen to xLights. Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment