Max number of FastLED data pins/limitations of Mega?

I have a series of 20 led strips hanging down, each with 90 (30 groups of 3) 12V ws2811 leds. For a variety of reasons, it makes more sense in my application to have a dedicated data pin for each of the strips at the top.

1 - Is there a limit to the number of data pins I could use on the Mega? Are any pins off limits?
2 - How much power is required for the data pin only? Presumably not much, but just want to double check. Is a resistor between the arduino and data line recommended?
3 - I'm trying to look into the setMaxPowerInVoltsAndMilliamps function, but I can't tell if having each strip on a separate line would be an issue, or if the function includes all led strips controlled by the library.

I have two 30 amp power supplies that will be plugged in at opposite ends of my strip "start" points at the top. Obviously this is not enough if all of the lights decide to go white at once. I don't intend for that to happen in my code, but it'd be good to have the setMaxPower function in place just in case.

Thanks in advance for any help.

Not really, as long as the code fits. Wiring becomes messy.

Only pins 0 and 1 which connect to the USB interface.

Relates to the next answer. :grin:

Certainly is, mounted at the start of each strip. A 330 Ohm resistor restricts current to 15 mA, so that is negligible "power".

Haven't heard of that one. :astonished:

1 Like

From the data sheet, maximum input current for the ws2811 is +- 1uA.

1 Like

If the data pin only pulls 1 µA, why the resistor? Just to be on the safe side?

I still haven't looked too much into the built-in power limiting function, but that would be slick if it worked! I was trying to work out rgb values (and current, by extension) from hue and saturation and then have a global max value that could not be exceeded, which I feel would probably work.

And you're absolutely right. The wiring will look terrible. I'll post my finished protoboard when it's all put together.

There are two reasons to use the resistor.

One is that the wiring between the Arduino and the LED strip represents a transmission line and has inductance. Sending fast voltage transitions down it may - indeed does - generate "ringing" effects where the voltage at the receiving end exceeds the supply voltage

This could damage the LED's logic circuit; the resistor limits the current. Note that the specification for how much current the LED draws applies only to voltages within the 5 V supply range.

The second is that if you happen to switch off the LED supply but the Arduino is still driving data out at 5 V levels, you are again applying a voltage to the data input which exceeds the supply voltage (being zero). Again, the resistor limits the current.

1 Like

I think it applies to all LEDs connected in total, no matter how they are connected.

Do not connect the 12V lines from the two PSUs together at any point in the circuit. Use one PSU for 10 strips and the other PSU for the other 10 strips. Grounds must be connected together between the two PSU and the Arduino.

Ideally, the library would apply the max power settings separately for your two PSUs, otherwise if one half of the LEDs exceeds the 30A limit but the other half is well below it's 30A limit, the library will think there is no problem and do nothing to prevent the first PSU from being overloaded.

However, I don't think you will get close to the PSU limits. 30 groups of LEDs @ 60mA per group X 10 strips = 18A. You could probably use just the one 30A PSU, with the max power set at 12V, 25A. It all depends what patterns you want to show. If every led was set to red at maximum brightness, that would only be one third of the current compared to every led on white. If only half the LEDs are on at any instant, halve that current again...

One more thing that might surprise you: even with all LEDs off, your strips will draw around 600mA! The chips on the strips draw about 1mA each at all times.

1 Like

Thanks for all your help.

Okay, good deal. Makes my life easier.

Why's that?

I'm using this strip, which has 3 rgb leds per chip. So my actual, all white all bright power demands are 108A for all 20 strips. That's why I was hoping to give the entire 20 strips access to the whole 60A (though my plan is to never exceed 48A).

And, come to think of it, that probably means I should pass 16A to the setMaxPowerInVoltsAndMilliamps function, since the library would have no way of knowing the chip is driving 3 leds.

Because no PSU is exactly 12V, and no two PSU will be exactly the same voltage output as each other. One will always be slightly higher than the other, even if only by a few mV. If you connect them together, this PSU will be doing most of the work, until the load gets so close to its maximum that it's output voltage is dragged down to the same level as the other PSU. So they won't share the load equally. If there is insufficient load, for example because most of the LEDs are off, then the higher voltage PSU could force current into the output of the lower voltage PSU, damaging it

That's normal for ws2811 12V RGB strips. Each group of 3 LEDs will draw up to 60mA, so 30 groups per strip X 20 strips = 36A. I guess you had better measure the current for 1 strip to be certain!

Could I just throw a diode down on both supplies to avoid that? Doesn't solve the problem of one PSU overpowering the other, and obviously I'll separate these if push comes to shove, but I think I have been miscommunicating the type of led strip I have/just how much current I'll need to draw.

When you say each group of 3, do you mean red, green, and blue? Because I am saying there are 3 groups of red, green, and blue leds per chip. So 9 20mA leds. 90 rgb leds per strip, but each group of 3 leds will do the same thing. Maybe I have completely misunderstood up to now, but my understanding was that each "pixel" draws a max of 60mA, and I have 3 pixels per chip.

Well, they would have to be bloody big diodes to handle that much current! Big diodes with big heatsinks! Much better to share the load between the 2 PSU by splitting the strips evenly between them.

No, I mean 3 physical led packages, each package contains one red, one green and one blue led. So, yes, 9 LEDs to each driver chip. In a group of 3 led packages (with 1 driver chip), the 3 red LEDs are connected in series and the same 20mA flows through each of them. Same for green and blue, so 60mA in total for 3 physical led packages.

In ws2811 strips, the driver chips are separate from the led packages, and each driver chip controls 3 led packages in a 12V strip, 6 led packages in a 24V strip and only 1 led package in a 5V strip. That last option has been almost completely replaced by ws2812 strips these days, where the driver chip is integrated with the led package.

1 Like

Got it got it got it. Well that's good news then. I was starting to get nervous about the prospect of handling a potential 100+ amp demand. Thanks again for your help.

Like I suggested, run some tests on one strip. If I'm right, the current will be 1.8A at most. If I'm wrong, it could be 5.4A. Still within the 10A range of your multimeter.

Frankly, that makes no sense at all! :roll_eyes:

A power supply is just that - a supply. In the case either of a series regulator or a switchmode supply, there is nothing on the output that will consume power. If the output voltage goes too high, it will simply regulate off.

The only possible malfunction of two supplies in parallel is the possibility of some sort of instability in their regulation causing oscillation, as we warn against here with simple series regulators with the wrong - and that is almost always insufficient - output (and perhaps, input) capacitors. And this would actually represent a design fault in the supply.

It is most likely to happen at maximum load because whatever current limiting arrangement in place is not correctly frequency compensated as is the voltage regulation. But with supplies connected at opposite ends of the strip, the quite significant resistance of the strip itself would balance out the load at higher current draws.

So yes, if you have ever tried connecting two together and they oscillated, you must assume they were faulty. :face_with_raised_eyebrow:

Ok, thanks @Paul_B. I thought I'd read something about connecting PSU in parallel, but I must have misunderstood.

But in @Bapstack 's project, the PSU will not be at opposite ends of the strip. There will be 20 strips with power connected to each at one end only. Each strip will be connected to a PSU with some heavy duty cable, I hope, so the resistance between the outputs of the two PSU would be low. Any concerns about that?

No mention about the must have capacitors across the power to each strip at both ends.

Badly designed maybe, but not faulty. In that if you send it back for a refund you will get exactly the same behaviour with your replacement power supply.
Just because a power supply is rated at 30A that does not mean you can draw 30A out of it without any external capacitors.

That seems to be somewhat prevaricative as your following comment on the capacitors indicates (and yes, I would imagine that capacitors would be particularly appropriate for stabilising them). If the power supply is unstable in such a situation, one must anticipate that there may well be be a number of situations in which it would also be unstable.

Similarly to the requirement for a Zobel network for audio amplifiers.

I seem to recall you have been one of the main antagonists here for paralleling power supplies. :face_with_raised_eyebrow:

I think you might be wrong here. I have worked on several projects where trying to parallel up a power supply has caused a lot of problems. I don't particularly like paralleling up batteries.

Yes, that's what I gathered.

(antagonist)