Test the NeoPixel Strip

Before assembling everything, let’s give the NeoPixel strip a test run. If there’s a problem, it’s easier to request help or an exchange now than with an assembled project.

If you’re not already using the Adafruit_NeoPixel library for Arduino, download and install this first. We have a guide for proper library installation.
After installing the library and restarting the Arduino software, copy and paste the code below into a new Arduino sketch.

DO NOT use the NeoPixel “strandtest” example for this test! It lights all the LEDs at once — more power than USB can handle. The code below is designed to light only a few LEDs at a time, so we can use the Arduino’s 5V or VIN pins.

If you have an Arduino Uno (or similar) around, use that for NeoPixel testing. Not mandatory, but the headers make for easy jumper wire connections.
// Simple NeoPixel test.  Lights just a few pixels at a time so a
// long strip can safely be powered from Arduino 5V pin.  Arduino
// may nonetheless hiccup when LEDs are first connected and not
// accept code.  So upload code first, unplug USB, connect pixels
// to GND FIRST, then +5V and digital pin 6, then re-plug USB.
// A working strip will show a few pixels moving down the line,
// cycling between red, green and blue.  If you get no response,
// might be connected to wrong end of strip -- look for the data
// direction arrows printed on the strip.

#include <Adafruit_NeoPixel.h>

#define PIN    6
#define N_LEDS 240 // 4 meter reel

Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {

void loop() {
  chase(strip.Color(255, 0, 0)); // Red
  chase(strip.Color(0, 255, 0)); // Green
  chase(strip.Color(0, 0, 255)); // Blue

static void chase(uint32_t c) {
  for(uint16_t i=0; i<strip.numPixels()+4; i++) {
      strip.setPixelColor(i  , c); // Draw new pixel
      strip.setPixelColor(i-4, 0); // Erase pixel a few steps back
Upload this code to the Arduino board, then unplug USB and make the following three connections:
  • GND from Arduino to GND or on strip, usually a black wire (always connect GND first).
  • VIN from Arduino to +5V or + on strip (usually a red wire).
  • Pin 6 from Arduino to DIN (or unmarked input) on strip (usually a white wire).
As mentioned before, testing is easiest with an Arduino Uno with its row headers. If you only have the Arduino Micro that you got for this project, that’s okay…you can make connections using a combination of jumper wires and alligator clips (but be super extra careful that they connect the to right points and have a firm grip…losing the ground connection even for a moment can ruin the first pixel…so don’t move parts around while testing). Or you can temporarily solder wires to the board (best if you have some experience with desoldering — it’s easy to damage things if done wrong).

Lay the strip out flat so you can see the entire thing, then re-connect the USB cable. After a few seconds, you should see a few LEDs chasing down the length of the strip, cycling between red, green and blue. Watch carefully, noting any skipped or off-color pixels.

Nothing lights up!

  1. If the computer reports a USB device is drawing too much power, unplug the Arduino immediately.
  2. Make sure the extra wires at either end of the strip are not touching each other or anything conductive.
  3. Confirm the three connections between the strip and Arduino: GND, +5V and pin 6.
  4. If using an Arduino Leonardo or Mini, it takes about 10 seconds when USB is connected before the sketch actually runs. Be patient.
  5. If you soldered any connections, make sure there’s no cold joints or solder bridges between adjacent pads.
  6. Make sure you’re connected to the INPUT end of the strip.
  7. Check the USB cable is properly seated between the Arduino and computer or powered USB hub.
If you have a multimeter, check the voltage across +5V and GND at the OUTPUT end of the strip. It should be around 5 Volts.

The lights cut out part way down the strip.

Confirm the value of N_LEDS in the code matches the actual NeoPixel strip length.

One or more pixels won’t light up, or show the wrong color.

Possibly defective pixel(s). Read on…
If you encounter any of these problems (or others), search the Adafruit Customer Support Forums for similar issues and their resolutions. If your situation is not addressed, make a new post with a description of the problem and (if possible) a clear photo showing the wiring between Arduino and NeoPixels. We’ll help troubleshoot the problem or have a replacement sent if needed.
Do not proceed until you have a fully tested and working NeoPixel strip.
This guide was first published on May 01, 2014. It was last updated on Sep 19, 2018. This page (Test the NeoPixel Strip) was last updated on May 04, 2015.