Hey guys! First post here, I have a quick question.

Hey guys!

First post here, I have a quick question. How many LEDs could I run using the FastLED library, an Arduino Mega, and ws2812B LEDs?

Thanks guys!
Looking forward to becoming an active memeber in the communite!

I have seen @Daniel_Garcia provide answers to this sort of question a few times so I’ll cut and paste one of his super answers here.

Daniel said:

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

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

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 )

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.

Thank you so much this is exactly what I was looking for, For my application I need to run roughly 6000 LEDs off of one controller, do you have any links to help me out with using multiple arduinos to control all of the LEDs in sync?