I have a question on driving 120 LEDs using WS2812B LED strips. I use the Adafruit library.
Im currently trying to repair a circuit/reprogram a game that uses the WS2812B LED strip. However, after having picking things apart and putting them back together, the LED strip did not light up. Having done my own calculations on the power consumtion of the WS2812B, the Arduino differently shouldnt be able to drive the strip. HOWEVER, before I took the original circuit apart to redesign it, the strip was only powered by the arduino using a 5v 2000mA USB PSU. There's a capacitor conncet to +/gnd every 15 LED. This doesnt make sense to me, BUT it did indeed light up without any extra PSU for the LED strip. So my question is: how on earth was the arduino alone able to drive the LED strip?
I know the required current for the LEDs, Estimating 40mA for each RGB LED. The LEDs will never use full power - the Arduino program "draws" a rainbow. However, driving 120 LEDs requires a fairly large power supply.
Edit: I use the Uno R3 and 1000uF capacitors. The Arduino was powered through USB using a 5v/2A PSU.
The Arduino isn't powering the LEDs. The power supply is powering them both. Ideally, the power (current) shouldn't go through the Arduino.
40mA x 120 = 4.8 Amps but 60mA is normally "assumed" for "worst case" (20mA per-LED per-color). That's 9 Amps with all LEDs on at full-brightness white!
That's a little strange but if they are "large" capacitors (maybe 1000uF) they could serve a couple of purposes. Normally, power should be connected about every meter to minimize voltage drop over the "thin" conductors built-into the LED strip.
Capacitors store energy so if they only inject power at one end, the capacitors could supply current to "hold-up" the voltage while the LEDs at the far-end flash for a moment.
Similarly, the whole strip could flash-white for a moment, again with the capacitors supplying the current that the power supply can't.
When you power the Arduino from USB, the current passes directly from the USB connector to pin 5V of the Arduino, where the strip was most likely connected.
That is, the strip was not powered by the Arduino, it was powered by PSU via arduino.
That is a cost saving measure you get in some very cheap rubbish Chinese LED strips. In real strips there should be a ceramic capacitor fitted to every LED in the strip. Leaving them out will not affect the ability to light up but will affect the stability of the strip.
You don't know how well it was driving the strip because you never looked at the signals with an oscilloscope. It can only safely drive the strip if you impose a brightness limit from the library which limits the brightness which the LEDs can be set. Or the Arduino fails to delver the proper signals and so it goes into a mode that reduces the voltage delivered due to the over stressing of the pins. Note this point is way above the point where damage is being done to the Arduino. The Arduino might not immediately fail but its working life is seriously shortened.
Your question falls apart in 2 different sides: signal and power.
Let’s answer the easy one first: signal. Each WS2812B has an output that drives the next one, so the Arduino only drives the first.
Going further, let’s start with an assumption: as you didn’t specify which Arduino, I assume the UNO R3, the most common one.
The description gave the impression of a powerbank-like thing to power the USB of the Arduino and the strip being connected to the Arduino. I happen to know that the UNO R3 contains a polyfuse in it’s powerline, so any USB power source over 500mA is superfluous. Print traces have limited capacity anyway. That means the Arduino didn’t provide power to the strip. Therefore I assume your description was less than accurate.
Thanks for your lenghty reply. Sorry, I might not have explained myself correctly.
The Arduino was powered by a 5v/2A USB PSU through the Arduino USB input. The WS2812B was powered through the Arduino 5v and shared a common GND. Obviserously, the 2A is nowhere enough current. Based on my observations, the LEDs where probably running at 50% brightness and would never go 100% on each color (because of the rainbow animation).
I did not mention that the capacitor are indeed 1000uF. The 100 LEDS are divided into 5 strips, which are connected together using a dupont connector. The capacitors are placed between 5+/gnd at the end of each seperate strip.
I promise you that there were no external PSU supplying power to the LED strip. The PSU for the Arduino Uno R3 is a simple 5v/2A plugged to a wall-outlet. This is why I am confused - using basic electronic calculations, it does not make sense to me.
I have previously worked with the WS2812B using an external PSU to support the large enough of current that they draw.