NeoPixel Strip with Ghosting & Random/Unintentional

I am getting started with the NeoPixels.

After running the Strand Test included with the library succesfully I aimed to write a sketch that would turn on one LED at a time to a specific color. I thought this would be the easiest place to start.

I am noticing that if I run this sketch, there are many instances where LEDs will randomly blink in a Red, Green, or Blue - almost a ghost of the strand test…

But I cleared the memory, unplugged and re plugged many times. I switched pins, the data cable is only a foot, everything is set up to spec. I tried a delay and they happen only slower.

Here is the code. I am guessing this may just be an easy mistake.

#include <Adafruit_NeoPixel.h>

#define Strand1 2

Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, Strand1,  NEO_GRB + NEO_KHZ800);

void setup()  {
  strip.begin();
  strip.show();  //Initializes all pixels to 'off'
    strip.setBrightness(32);  //Dims LEDs
}

void loop()  {
  strip.setPixelColor(0, 255, 255, 255);
  strip.show();
}

Here is a video description: http://youtu.be/qyRFkF9DGfU

I also just confirmed this same phenomena occurs with the FastLED library.

This leads me to believe it may be the strip.

However, I just cut off the first pixel and reattached everything - same problem.....

Adafruit_NeoPixel strip = Adafruit_NeoPixel(2, Strand1, NEO_GRB + NEO_KHZ800);

There looks to be more than 2 LEDS in that strip and I'm not sure what effect setting this wrong will have but I could think this will be the problem if the original Adafruit demo worked okay. The other options are power brownout (not likely with single LED lit) or dodgy wiring.

Riva, that is a good start.

However I have tried it with the full 90 coded (as seen in the video) and without and still the same effect. What is interesting is that if I state there are only 10, 2, or however many LEDs it will only go to that point in the strip.

Also, I read somewhere that you might need to ground them every meter. So I tried a piece that was only 4 LEDs and the problem still existed.

I have a brand new power supply and I am pretty confident in the solder points.

Have you ever had one go bad on you? Did it look like this?

Have you ever had one go bad on you? Did it look like this?

I have only used the 60 pixel ring, not a strip but never had it go bad on me like you show in your video.

If you load the original Adafruit strand demo again does it still work okay?

In the video it looks like you may have the recommended 1000uF capacitor across the power (connected the right way round?) but do you also have the resistor in the short length data line?

You could try moving the two lines from loop into setup so they only run once and see if the output is stable (no flickering & just first pixel lit). If it’s still flickering then I would suspect either the strip or power.
If the strip does not flicker then put the two lines back into loop and add a delay(10) on the end. This is in the hope that continual data (without the delay) is confusing the strip logic.

Another thing to check is the pixel type is correct (assumed this as you say Adafruit demo worked) as it seems the old v1 strips used different clocking speed and colour space.

This problem is caused by not extending a ground to the Arduino as well.

I repeat, if you see this problem it is because the ground is not tied into the Arduino correctly.

Sensebellum: This problem is caused by not extending a ground to the Arduino as well.

I repeat, if you see this problem it is because the ground is not tied into the Arduino correctly.

Glad you finally figured out what was wrong but how come the Adafruit example sketch worked but yours did not?

I would like to update the first post. Although I thought that the test sketch worked but mine did not, in actuality the test sketch was exhibiting these random behaviors I just did not see that they were noise. I thought it was just a chaotic test sequence.