Do I need led drivers to control 256 RGB leds ( 50 mA) ?

Hello everyone,

I come to you because I'm kind of new to electronics ( i'm a french engineering school student ) and I need some advice on my project : being able to display, thanks to rgb led strings, "pixel art-ish" images.
It has already been done a lot of times but there is something I quite don't understand:

I kind of get ( please correct me if I'm wrong ) that a driver's goal is to make sure a Led is getting the right amount of electricity but also it has to do with the number of devices (here Leds) that the arduino can control via I²C bus.

What bothers me is that in this project, they are using something like 15*15 WS2812B Leds, ( the exact same as I'll probably work with ) without any driver.

Can it realistically work that way ?

How many Leds can a arduino Uno safely control via I²C bus ?

Thank you in advance for your answers =) .

How many Leds can a arduino Uno safely control via I²C bus ?

I can’t think of any safety issues in controlling LEDs over I2C

Thanks for replying that fast =) ,

The teacher in charge said the arduino uno could only handle a number of leds via I²C and we may certainly need a driver to increase that number.

Is he right ?

You linked to a project with addressable WS2812B LEDs.
Addressable LEDs use their own one-wire protocol.
They have nothing to do with I2C.

Ohhh .... ok didn't know that, that could explain a lot.

Thank you Leo.

With WS2812B LEDs the driver is in the package along with the three colored LEDs. The single data input to the first chip is regenerated inside the chip and passed onto the next. So in theory you can have as many LEDs as you want.

In practice you are limited by the amount memory an Arduino has. You need three bytes per LED to hold the colour. It also very quickly requires a lot of current, about 60mA per LED. The other thing is the refresh rate. You can only send the data at a specific rate 800K bits per second and again you need three bytes per LED, that is 24 bits.

What bothers me is that in this project, they are using something like 15*15 WS2812B LEDs, ( the exact same as I’ll probably work with ) without any driver.

OK, so far we have it sorted that the interface is not I2C and these LEDs have their own “drivers” incorporated.

The big matter is that you need to power them with a stable 5 V supply. 225 LEDs at 60 mA each (which is what you need to design for) totals 13.5 Amps - you need a 15 or preferably, 20 A 5 V power supply.

The build in that link also has a bad error - all the strips are connected in series, one after the other. This is correct in terms of the data passing on from one to the other, but completely wrong for the power; there is simply far too much resistance in the strips to convey 5 V from one end to the other. If you were building it in that fashion, then you need to parallel the ground and 5 V lines down to every strip on the end (side) where the power connection is. The other end will probably not matter so much.

And you also need to put a 1 mF capacitor between 5 V and ground on that side, and a 470 Ohm resistor in series with the data input to the array.

Finally, each LED requires three bytes of RAM in the Arduino; so you are using 675 bytes. That is I believe, OK, but you would have to be careful how much bigger you made it.

In general

An AVR based Arduino (e.g. Uno, Mega) can safely 'deliver' 20 mA per pin. The total of port (8 pins) is 100 mA. And the total of the processor is 200 mA.

The Uno has one 8-bit port (pins 0..7); the other ports have less pins. The Mega has a a few more 8-bit ports (e.g. the analog pins, PortC, PortL, ...).

So with normal leds and non-addressable led strips, you will need to take this into account. If you want to control a non-addresable led strip, you will need a driver (a mossfet is often used) once you go over the limits.

This driver will only require a fraction of the current that the processor can deliver on a pin to drive a bigger load.

Thank you all for your answers,

We won't go over 16*16 leds so the 2kB sram of the arduino should be ok, but it seems our teacher really wants us to use drivers at least as a fuse so ...

For the power supply we will surely go with a 5V/15 A power supply.

Regarding the build, should i do something like that then ?

We won't go over 16*16 leds so the 2kB sram of the arduino should be ok, but it seems our teacher really wants us to use drivers at least as a fuse so ...

Sorry, that makes no sense. The "driver" is the Arduino, there is no other.

Regarding the build, should i do something like that then ?

Yes, that's the idea. The power wiring would be right alongside the ends of the strips with that 1 mF capacitor also. It is important to keep all the wires as short as possible and running together - ground and 5 V together and the data (green in your diagram) together with the ground.

I believe he explained that in this case a "driver" could work as an "extension" assisting the arduino in controling the leds via I²C, but if those ws2812b truly don't rely on this protocol then that makes them only useful for regulating electrical current as said on this

site :

I'll ask my teacher to clarify what he wants me to add to this circuit but if it works I see no reason why I couldn't stick to it.

Anyway, thanks for helping me that much you all, I'm really grateful =)

Can’t make out your link but the fact remains that to implement a matrix array of independent pixels, the only only practical way of doing it on this scale - it may be different if you are building one of those giant outdoor video screens - is to use the WS2812 (or similar) LEDs which have an integrated driver which has nothing whatsoever to do with I2C whatever your teacher may say.

Now let’s just get back to that word “practical”. There are multiplexed driver chips which can drive an array of LEDs which may include “plain” RGB LEDs. In multiplexing such an array it is not however practical to provide PWM to individual LEDs, so you are limited to primary colours at full intensity (though the overall intensity is usually selectable) . And while these do use an I2C interface, the number of selectable addresses are usually limited to eight, so you are limited to eight such modules.

Probably not I2C, but this would be an example.

These are going out of fashion in favour of the “NeoPixels” - WS2812, but do you suppose this is what your teacher is talking about?

Datasheet for the WS2812B
As you can see, there is just a single control line that goes to the first chip in the series of chips, with specialized timing that determines whether the databit sent out is interpreted as a 1 or 0.
Nothing to do with I2C, which uses a clock and a dataline to send databits out.

You can also see from the top of the 3rd page that the current into that one datapin is +/- 1uA, just like the input pin on an Arduino, so no driver is needed. The series resistor is only to prevent signal reflections if there happens s to be a long wire connecting the Arduino to the first pin.

I connected up 43 WS2812Bs into a ring, and made 4 rings. I drove each ring from its own Arduino pin using the FastLED.h libraru with no resistors at all over a few feet and had no issues. I would suggest it could be left out if the distance from Arduino to the first chip is not very far.

Demo’d in this youtube clip.

WS2812B preliminaryV2.0.pdf (265 KB)

So, my teacher and me talked it out and it seems he wasn't aware that those ws2812b leds didn't need any sort of driver to work.

Therefore we'll do a build as posted previously. Regarding that :

  • How do you define what resistor and capacitor you need to add ? It's not I don't trust you, I'd just
    like to understand it ^^
  • Do the resistor need to withstand a current of 5V * 15 A ? (The resistor is not linked with the power
    supply, he's on the "data" wire)

Thank you for your answers =)

Therefore we'll do a build as posted previously

But you have never posted a coherent proposal of what drivers you want to use so how can we give you advice on something you have not told us about?

You can not drive LEDs directly through an I2C interface. You have to have an I2C device that can drive LEDs and so far you have not come up with any suggestions about what devices you are permitted to use.

From what I saw on the Internet, people were able to control about 200 leds by connecting the data wire directly to the arduino, without connecting anything else.
My problem was that I believed we would have needed some sort of driver to make the arduino and the leds communicate but, it turns out that those leds don’t use I²C so a “driver” becomes irrelevant.

Throughout all those posts I never really knew what a driver was, and it still is pretty vague.
I just know, thanks to previous answers, that with those ws2812b leds I don’t need one, whereas with more “plain” leds, as said previously, that would rely on I²C, I would indeed need some sort of driver.

So what does your teacher want you to do? He won’t let you use the proper electronic devices because he doesn’t know anything about them, so you will have to ask him what sort of driver he will permit you to use.

This is a problem only you and your teacher can solve because you are being so pig headed about what technology is permitted.

that would rely on I²C,

No LEDs rely on I2C it is a rouge fish.

Sorry if I didn't make myself clear.

At first he wanted us to use a driver but the leds he provided us with (ws2812b) don't need one, and since we won't buy other cheaper leds for the sake of having a "harder" time, we'll just do that simple montage :
in which we link the data wire directly to the arduino.
A build that I know will work although I indeed don't know what tech it relies on.

our teacher and us are fine with it so the questions that remain do not concern led drivers since we won't use any.

How do you define what resistor and capacitor you need to add ? It's not I don't trust you, I'd just
like to understand it

The resistor value is not critical it is normally between 200 and 500R. It is a compromise between allowing enough current through to drive the logic in the first LED and being high enough to prevent damage if the data voltage is applied without the power being supplied being connected to the LEDs. It also has to match the impedance of the line to prevent signals being reflected and causing voltage spikes. There’s no simple formula to calculate this but anything in the above range is about right.

The capacitor needs to be big enough to Handel expected current transients, it cannot be too big but it can be too small. If you want to calculate it you would need to know several things that are hard to find out, like the impedance of the power supply and the short term voltage / current characteristics of the power supply.

Do the resistor need to withstand a current of 5V * 15 A ?


This photo might help you understand reflections.

adding resistor to ws2812 drive.png