NeoPixel Issues

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

NeoPixel Issues

Postby Xalara » Sun Feb 10, 2013 8:32 pm

I recently purchased a few meters of the NeoPixel LED strip for use in some projects. I then proceeded to snip off a section of 25 LEDs so that I could experiment and get things up and running. Unfortunately, my strip does not seem to be functioning correctly as lights will randomly turn on and off, and if I set an LED to a particular colour it might not necessarily get set to that actual colour. If I could get some help it would be greatly appreciated since this is extremely frustrating.

First some information:
  • I have tried both an Arduino Uno and a Teensy 3.0 and get the same behaviour.
  • While the images and video I have taken show my own wiring, I got the same results when using the default wiring out of the package.
  • I am using the Arduino 1.0.3 IDE.
  • The base code that I am using is strandtest.
  • I have tried different output pins on my chips
  • I have tried a few different strands, as well as tried chopping off some of the LEDs to no avail.
  • I am somewhat new to the world of wiring things up, not new when it comes to the programming side of things.

So now for videos of the problem:
  • 22 LED strip where I'm trying to set pixel two (LED three) to red.
    • The LED I am manipulating isn't always set to the proper colour for some reason.
    • Pixel zero (LED one) for some reason is always "on" and is pretty much always white.
    • The other LEDs in the strip randomly turn on and off at low power. From experimenting, I have determined that this is caused when the show() method is called. This was discovered when I simply had a loop with only strip.show() in it.
    • This is the code that I was using:
      Code: Select all
      #include <Adafruit_NeoPixel.h>
      Adafruit_NeoPixel strip = Adafruit_NeoPixel(22, 6, NEO_GRB + NEO_KHZ800);

      void setup() {
        strip.begin();
        strip.show(); // Initialize all pixels to 'off'
      }

      void loop() {
        strip.setPixelColor(2, strip.Color(255, 0, 0));
        strip.show();
        delay(200);
      }

  • 22 LED strip where I am using colorWipe(strip.Color(255, 0, 0)
    • Again notice how the first LED in the strip is pretty much always white.
    • The strip sort of starts off ok with pixels being set to red, but then the pixels start being set to random colours right after.
    • This is the code that I was using:
      Code: Select all
      #include <Adafruit_NeoPixel.h>

      Adafruit_NeoPixel strip = Adafruit_NeoPixel(22, 6, NEO_GRB + NEO_KHZ800);

      void setup() {
        strip.begin();
        strip.show(); // Initialize all pixels to 'off'
      }

      void loop() {
        // Some example procedures showing how to display to the pixels:
        colorWipe(strip.Color(255, 0, 0), 50); // Red
        //colorWipe(strip.Color(0, 255, 0), 50); // Green
        //colorWipe(strip.Color(0, 0, 255), 50); // Blue
        //rainbow(20);
        //rainbowCycle(20);
      }

      // 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);
        }
      }


Now for details of my wiring job:
  • I wired positive (red wire) to +5V and negative to the ground.
  • The digital input is wired to pin 6 on the Arduino Uno. I have tried other pins to no luck.
  • The chip is being powered by USB whereas the LED strip is being powered by a 5 volt, 10 amp power supply.
  • Picture one: Image
  • Picture two: Image

Here are the materials I am using:

Please let me know if you need more information to help troubleshoot the problem.
Xalara
 
Posts: 3
Joined: Wed Jan 09, 2013 12:48 am

Re: NeoPixel Issues

Postby Xalara » Sun Feb 10, 2013 8:41 pm

I messed up the pictures of my wiring. Here are imgur links:

http://imgur.com/pUQAD1W
http://imgur.com/KcGj78j

Red wire = positive
Blue wire = negative
Orange wire = digital input

I also want to ask: the strip came pre-wired with two grounds. It shouldn't make a difference if I only connect to a single ground instead of two, correct?
Xalara
 
Posts: 3
Joined: Wed Jan 09, 2013 12:48 am

Re: NeoPixel Issues

Postby pburgess » Sun Feb 10, 2013 8:49 pm

A common ground is important actually. Connect a wire from Arduino ground to the strip ground, see if it clears up.
User avatar
pburgess
 
Posts: 1406
Joined: Sun Oct 26, 2008 1:29 am

Re: NeoPixel Issues

Postby Xalara » Sun Feb 10, 2013 9:31 pm

That fixed it, thank you. Out of curiousity what is the technical reason for having to connect the Arduino ground to the ground as well? I thought being connected to USB would take care of that.
Xalara
 
Posts: 3
Joined: Wed Jan 09, 2013 12:48 am

Re: NeoPixel Issues

Postby pburgess » Sun Feb 10, 2013 10:00 pm

My somewhat naive understanding is that the two circuits (computer and LED strip) are isolated through the power supply transformer(s)...that there's no actual continuity down that path, so the two grounds (and the voltages relative to those grounds) are sort of subject to interpretation.

But maybe a proper engineer can chime in. :)
User avatar
pburgess
 
Posts: 1406
Joined: Sun Oct 26, 2008 1:29 am


Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit

Who is online

Users browsing this forum: No registered users and 6 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [114]

Raspberry Pi[82]
 
FLORA[24]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[12]
Arduino[60]
 
NETduino[14]
 
BeagleBone[23]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[39]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[9]


 
Breakout Boards[35]
LCDs & Displays[49]
Components & Parts[70]
Batteries & Power[54]
EL Wire/Tape/Panel[52]
LEDs[112]
 
Wireless[16]
Cables[66]
 
Lasers[6]
Sensors/Parts[147]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[41]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[25]


 
Stickers[41]
 
Skill badges[55]
 
Books[26]
 
Circuit Playground[7]
 
Gift Certificates[4]