Going past the ESP32 limits in number of outputs and segments

Hello, I’m currently running ESP32 NodeMCU / DevKit-C in my stairs where I have total of ~1510 LEDs divided into 4 outputs on ESP32 (each running 360-420 LEDs). Again these LEDs are divided into 16 segments / stairs.
I’m currently on the safe limit on both the ESP32 outputs and max number of segments.

Now I’d like to add 17th stair to the setup. First of all, if I’d go with the 4x ESP32 outputs, I’d need to connect the 17th stair to the same output that is currently driving the most number of LEDs (around 420). This 17th strip would have at least 150 LEDs, so the total amount of LEDs would increase to 570-600 on a single ESP32 output.
Other option is to enable 5th output on the ESP32 just for this 150 LEDs.

Which of the two would be the least worse approach? I’m mainly running static lights without effects, but I’d like to have the effects still running in a case I want to play with them. I understand I could override the MAX_NUM_SEGMENTS and write 17 there to enable the 17th segment.
Am I running into problems and is this doable?

ESP32 supports 32 segments and 10 outputs by default.

1 Like

Okey, thanks. I have read that 16 segments is the maximum, and it’s hard-coded in the code. That has been changed at some point?

https://kno.wled.ge/features/multi-strip/
This document says the sweet spot for outputs is 4 and 512 leds per output for the best performance. That’s why I’m asking whether it’s more advisable to introduce 5th output or go past the 512 led/output

It depends on your need for max FPS or if you can accept something a bit slower.

No, ESP32 always had greater number of segments than ESP8266. The limit on ESP8266 was 12 until 0.13-b1 (or thereabouts) when it changed to 16 due to memory optimizations. It is safe to use up to 32 on ESP32 though there are caveats.

Regarding number of LEDs per pin: you can have as many as 10.000 (or possibly more) per single pin but the update rate will severely suffer. If you want anything above 25 FPS you should keep count below 800.

1 Like

Alright, thanks.

If I have done my research correct, on a 3-channel led (like RGB and WWA) the theoretical maximum refresh rate is about 33.333 / (number of leds on a channel), so even with 600 leds we’re still getting 55fps which is above the default 42fps.

My conclusion is that I’m trying to add the additional ~150 leds in series with the existing 420 or so. Other option would have been adding the 150 to a separate 5th dataline, but in that case I’d need to introduce second level shifter since I’ve already consumed all 4 outputs from the first level shifter.

But as a thought: Could I assume 33.333/420 ~ 75 fps operation if I have 5 outputs coming from ESP32? With 5 outputs the largest number of leds/output would be 420. Documentation says about 4 being the optimal maximum?

“Theoretically” there should be no difference between 4 outputs and 5 (or 8) since they all use RMT buffers. Practically, though, I have noticed a slowdown of FPS when going beyond 5 due to bug in ESP core.

You can test it on a test unit (hint you don’t need to have all LEDs attached, just the 5th strip).

1 Like