WS2812 all LED's blink at once in the middle of the code randomly

Hi,

This is my first Arduino project. I have 4 LED Strips with 60 LEDs (Mokungit 3.2ft 1 meter 60 LED WS2812b 5050 RGB 5V), an Arduino Uno R3, 3 external batteries for this project. I'm trying to make the LED's light up on different ways with certain "patterns". Most of it works great and I'm having a lot of fun but one of the shapes is causing a very strange bug where in the middle of it all LED's shine bright for one or two seconds and then it goes back to what it was doing.

Here's my code: ArduinoLED/pingpongV2.ino at master · LeoTanoue/ArduinoLED · GitHub
and I'm using this library: GitHub - cpldcpu/light_ws2812: Light weight library to control WS2811/WS2812 based LEDS and LED Strings for 8-Bit AVR microcontrollers.

Please let me know if I'm doing something wrong. I think it's something with my code. I tried different pins and tested the batteries and no luck.

Thank you,
Leo

It sounds like your power distribution. How is this wired up? You might try another 1000uF capacitor at the end of each strip and do not chain the power through the strips but wire each strip directly to the power. I am assuming you have a series resistor in the data line.

The strips are attached in series, but I am powering them individually with external batteries (5V 2.1A 20,000 mAh https://www.amazon.com/gp/product/B00YDNSH7I/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1). I have no resistors or capacitors at this point.

have no resistors or capacitors at this point.

Then put them in immediately before you turn it on again.

Are all the grounds connected together but the positives not? That is how you should do it. You need a capacitor across each battery and a resistor on each data input of the strips.