Here’s one of the reason you might be getting flickering when using LED strips with an Arduino
All my content is free.
If you feel that my videos are helping and you would like to contribute, you can toss some coins in the Tip Jar via PayPal.
Select amount then click the “Donate” button.
WS2812 LED strips are great to use with an Arduino, they are easy to use and require only one of the Arduino digital pin to connect a bunch of leds.
But one of the most common problem some encounter, is flickering when lighting up a lot of them.
Here’s a Quick Tip that might help you solve this problem.
WS2812 RGB LED INTRODUCTION
A WS2812 is a RGB LED with a WS2811 driver chip built inside, looking a the chip you can see Driver chip with the connection to the Red Green Blue LED.
The WS2812 (older version) and the WS2812B (latest version) are slightly different, the older version has 6 pins and the latest version has 4 pins.
We will be using the latest version WS2812B in this example.
The 4 pins are: VCC (3.5 to 5.3VDC), GND, Digital IN and Digital Out.
THINGS TO CONSIDER WHEN USING LED STRIPS
A WS2812 LED is basically 3 LEDs in one, one Red one Green and one Blue.
Depending on the color you are displaying, it will require more current to light up.
For example, if you are lighting it up in Red, Green or Blue only, then only one LED is being activated, if you want to light it up Yellow in color, then the Red and Green LED would be lit up. but if you want to light it up as White then all 3 of them are lit up and will require more current to light up.
In theory, if you light up the LED White and at 100% brightness, the WS2812 would require around 50mA, and that is just for one of them.
So if you do the math, 100 WS2812 lit up White in color and 100% brightness would require about 5 Amps at 5 Volt.
ONE POSSIBLE REASON YOU MIGHT BE EXPERIENCING FLICKERING
You are using a power supply that’s not providing enough current…
Like discussed before, LED require quite a bit of current, especially when lighting up a lot of them.
So first thing to make sure is that you are using a powerful enough power supply.
To make sure, you can use the worst case scenario of lighting the LEDs White (which uses all 3 LEDs) and at 100% brightness which requires around 50mA per WS2812 and multiply it by the number of LEDs you will be using, and then use a 5V power supply that has enough amperage to match.
Of couse this is worst case, if you don’t plan to light up the LEDs white or at 100% brightness you can get away with a less powerful power supply.
Keep in mind that using a power supply with not enough amperage can introduce flicker and can also make the power supply heat up or get damaged but overdriving it.
THE MAIN REASON YOU GET FLICKER (in my experience)
That reason in one word: VOLTAGE DROP.
When creating or prototyping a project we tend to use breadboard wires, alligator clips etc…
Those are fine for most project or when using a small number of LEDs, but when trying to drive hundreds of them, these wires are just too small to carry the amount of current needed and you get what is called voltage drop, which is the main reason you get flickering.
The size and length of the wire that connect the VCC and GND to the LED strip is important when creating a project with a lot of LEDs.
The best practice is to keep those wire as short as possible and use proper sized wires.
To find out what size of wire you should be using in your project, click this link Online cable size calculators to find some online calculators.
This applies to the VCC and GND wires, the Digital IN connection from the LED strip to the Arduino is a little more forgiving but try to keep that one as short as possible and properly sized as well.
There are other reasons you might get flickering:
– Arduino code, etc…
But from my experience, improper wire size and length are the most common reason for led strip flicker.
Hope this as been helpful and don’t forget to watch the video below for a demonstration of flicker and how changing the connection method resolved it.