WS2812 strip does only partly light up

Hi!

I'm new to Arduino and I choose as my first project to make an LED unicorn horn for my girlfriend.

I use an Arduino Nano, 16 WS2812 LEDs (two of these in series: https://tinyurl.com/y75cnptz
) and the whole circuit is powerd by a 18650 and step up converter.

Everything worked perfectly so I wanted to see for how long the battery can run the whole circuit and LED-strip.

The lights made a nice cycling rainbow effect for about 3.5 hours and then all LEDs were shining red.
I thought at the time that the voltage just dropped to far for the other diodes but when I tried it again the next day (while being attached to 5v power) only the first 4 LEDs were lighting up.

I replaced the led strip, checked all voltage, reloaded the code but I can't find the reason for it not working anymore.
After replacing the leds now only the first 2 LEDS light up and the third flashes faintly when the battery is connected to the curcuit.
Life at this point doesn't make any sense to me anymore so I come here for help.

Below I will show my circiut and my code but I don't think there is anything with the code because it worked before.

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif

#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800);
const int buttonPin1 = 2;
const int buttonPin2 = 4;
int buttonState1 = 0;
int buttonState2 = 0;
int x = 0;

void setup() {

  strip.begin();
  strip.setBrightness(50);
  strip.show(); // Initialize all pixels to 'off'
  pinMode(buttonPin1, INPUT);
  pinMode(buttonPin2, INPUT);
  Serial.begin(9600);
  colorWipe(strip.Color(204, 0, 102), 20); // Pink
  colorWipe(strip.Color(0, 0, 0), 20); // off
  colorWipe(strip.Color(204, 0, 102), 20); // Pink
  colorWipe(strip.Color(0, 0, 0), 20); // off
}

void loop() {

  buttonState1 = digitalRead(buttonPin1);
  buttonState2 = digitalRead(buttonPin2);
  if (buttonState1 == HIGH || buttonState2 == HIGH)
  {
    while (x == 0) {
      colorWipe(strip.Color(204, 0, 102), 50); // Pink
      buttonState1 = digitalRead(buttonPin1);
      buttonState2 = digitalRead(buttonPin2);
      if (buttonState1 == HIGH)
      {
        while (x == 0) {
          rainbow(30);
          buttonState1 = digitalRead(buttonPin1);
          buttonState2 = digitalRead(buttonPin2);
          if (buttonState1 == HIGH)
          {
            while (x == 0) {
              rainbowCycle(20);
              buttonState1 = digitalRead(buttonPin1);
              buttonState2 = digitalRead(buttonPin2);
              if (buttonState1 == HIGH || buttonState2 == HIGH)
              {
                colorWipe(strip.Color(0, 0, 0), 50); // off
                delay(200);
                return;
              }
              if (buttonState2 == HIGH)
              {
                colorWipe(strip.Color(0, 0, 0), 50); // off
                delay(200);
                return;
              }
            }
          }
          if (buttonState2 == HIGH)
          {
            colorWipe(strip.Color(0, 0, 0), 50); // off
            delay(200);
            return;
          }
        }
      }
      if (buttonState2 == HIGH)
      {
        colorWipe(strip.Color(0, 0, 0), 50); // off
        return;
      }
    }
  }
}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for (uint16_t i = 0; i < strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
    strip.show();
    delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for (j = 0; j < 256; j++) {
    for (i = 0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for (j = 0; j < 256 * 5; j++) { // 5 cycles of all colors on wheel
    for (i = 0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
  for (int j = 0; j < 10; j++) { //do 10 cycles of chasing
    for (int q = 0; q < 3; q++) {
      for (uint16_t i = 0; i < strip.numPixels(); i = i + 3) {
        strip.setPixelColor(i + q, c);  //turn every third pixel on
      }
      strip.show();

      delay(wait);

      for (uint16_t i = 0; i < strip.numPixels(); i = i + 3) {
        strip.setPixelColor(i + q, 0);      //turn every third pixel off
      }
    }
  }
}

//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
  for (int j = 0; j < 256; j++) {   // cycle all 256 colors in the wheel
    for (int q = 0; q < 3; q++) {
      for (uint16_t i = 0; i < strip.numPixels(); i = i + 3) {
        strip.setPixelColor(i + q, Wheel( (i + j) % 255)); //turn every third pixel on
      }
      strip.show();

      delay(wait);

      for (uint16_t i = 0; i < strip.numPixels(); i = i + 3) {
        strip.setPixelColor(i + q, 0);      //turn every third pixel off
      }
    }
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if (WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  }
  if (WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}

Are connections soldered?
Show us a good image of the actual wiring.
Worst case is you are drawing ~1amp.
What is the voltage on the ring when the LEDs act up?

Wire ring as follows, what happens when you do so?

First of all: Thanks for the help!

I haven't got any capacitors on hand so I only added the resistor in series with the data line.
That didn't seem to chance anything. ( Powered everything as shown in diagramm)

EDIT:Third LED does not always act up but when it does the voltage drops from 5.1 to 4.8 because it is stuck on full brightness and therefor a higher voltage drops of at the LED.
Pictures are messy because I tested everything on a breadboard first and it worked.


I suggest you revisit the soldering connections.

larryd:
I suggest you revisit the soldering connections.

So just re-flowing all the solder connections and checking for conductivity with an Ohmmeter?

Possibly a problem with your step up since that cuts down a lot of available current.
You'd be better off with 2 18650's and bucking.

Yes

The solder joints all look cold, possibly intermittent or not connecting at all.

Proper electronic flux and a 350°C soldering iron is what’s needed.

INTP:
Possibly a problem with your step up since that cuts down a lot of available current.
You'd be better off with 2 18650's and bucking.

I'm limited by space so 2x18650 are not possible.

Effiecency of the step up curcuit should be able to provide enough current and powering it over USB doesn't change anything either.
If I turn down to brightness of all the leds nothing changes so I doubt that it's a current problem.

larryd:
Yes

The solder joints all look cold, possibly intermittent or not connecting at all.

Proper electronic flux and a 350°C soldering iron is what’s needed.

Tomorrow I will re-flow all the connections
but I doubt that that is the problem,
because the setup as shown on the pictures worked for several hours and I checked for conductivity after soldering the first time.

Additionally I'm pretty sure nothing is shorted out because the animations are playing on the two leds
and if I accidentally short something out the arduino won't do anything.

Working and then not working is a sign that the LEDs are dead. That is, if you're confident that erratic behavior isn't a lack of power issue.

Re-flowed and checked all the solder connections nothing has changed.

I don't think that the current is a problem because the step up converter should deliver enough and while I power it over USB (2A with Quicke Charge) I get the same problems.

But what I just measured is that if i power the whole circuit with the battery I get 4.9V at the end of the strip but if the circuit is powered over the USB (2A possible) the voltage is only 4.36V.

Shouldn't the Arduino have a stable 5V at the 5V output?

INTP:
Working and then not working is a sign that the LEDs are dead. That is, if you're confident that erratic behavior isn't a lack of power issue.

I replaced the LED and the problem didn't change.
The only option I see for LED failure is if it instantly fails on the first power up.
But I doubt that option because there are no voltage or current spikes on power up of the circuit.

Normally, a sensible person would take apart the system and start testing components, not keep flipping the switch and seeing if it decides to change.

Write a simple program for the LEDs and test them. Properly power them, no buttons, etc.