Let’s confirm the NeoPixel strip is 100% working before moving on.
Unplug the Arduino and remove the Data Logging Shield. We’ll return to that later, but for now we need access to the Arduino headers.
The NeoPixel library should already be installed from a prior step.
Unplug the Arduino and remove the Data Logging Shield. We’ll return to that later, but for now we need access to the Arduino headers.
The NeoPixel library should already be installed from a prior step.
IMPORTANT: pre-installed wires (if any) on the end of a NeoPixel strip don’t necessarily indicate the “input” end.
Look closely at the face of the strip for small arrows showing the data direction. It’s a little easier with 60 LEDs/meter strip, which adds “DIN” or “DI” (data in) and “DO” (data out) labels next to solder pads. The Arduino will connect to the “in” end, where the arrows are originating.
144 LEDs/meter strips always arrive in 1-meter lengths with wires pre-installed at both ends. 60 LEDs/meter strip is manufactured in longer 4-meter reels (also with wires at both ends), which are then cut when a smaller order is placed. So you might receive a strip with no wires, or there’s a 50/50 chance that the wires are really the output end. So you may have to solder on your own.
Look closely at the face of the strip for small arrows showing the data direction. It’s a little easier with 60 LEDs/meter strip, which adds “DIN” or “DI” (data in) and “DO” (data out) labels next to solder pads. The Arduino will connect to the “in” end, where the arrows are originating.
144 LEDs/meter strips always arrive in 1-meter lengths with wires pre-installed at both ends. 60 LEDs/meter strip is manufactured in longer 4-meter reels (also with wires at both ends), which are then cut when a smaller order is placed. So you might receive a strip with no wires, or there’s a 50/50 chance that the wires are really the output end. So you may have to solder on your own.
These photos show white NeoPixel strip — it’s easier to read in photographs — but you can use either the black- or white-backed type.
DO NOT use the NeoPixel “strandtest” example - it lights up all the LEDs which draws tons of power and could make the Arduino crash due to a 'brown out'. Instead, copy and paste the following code into a new Arduino sketch:
// Simple NeoPixel test. Lights just a few pixels at a time so a // 1m 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 (the end wires, if // any, are no indication -- look instead for the data direction // arrows printed on the strip). #include <Adafruit_NeoPixel.h> #define PIN 6 #define N_LEDS 144 Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800); void setup() { strip.begin(); } 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 strip.show(); delay(25); } }
Edit the N_LEDS value to reflect the actual length of your NeoPixel strip.
Upload this code to the Arduino Uno, disconnect the USB cable, then we’ll connect the strip.
A wiring diagram is not provided…this is on purpose! Different types of LED strips have their connections in a different order, and the manufacturer sometimes makes changes to the design. Impulsively following a picture (rather than reading a description) increases the chance of an improper hookup and a damaged strip!
Make the following three connections:
Upload this code to the Arduino Uno, disconnect the USB cable, then we’ll connect the strip.
A wiring diagram is not provided…this is on purpose! Different types of LED strips have their connections in a different order, and the manufacturer sometimes makes changes to the design. Impulsively following a picture (rather than reading a description) increases the chance of an improper hookup and a damaged strip!
Make the following three connections:
-
GND from Arduino to GND or – on strip (always connect GND first)
-
5V from Arduino to +5V or + on strip
-
Pin 6 from Arduino to DIN (or unmarked input) on strip
Nothing lights up!
- If the computer reports a USB device is drawing too much power, unplug the Arduino immediately.
- If there are extra wires at either end of the strip, make sure the tips are not touching each other or anything conductive.
- Confirm the three connections between the strip and Arduino: GND, +5V and pin 6.
- If you soldered wires on, make sure there’s no cold joints or solder bridges between adjacent pads.
- Make sure you’re connected to the INPUT end of the strip.
- Check the USB cable is properly seated between the Arduino and computer or powered USB hub.
The lights cut out part way down the strip.
Confirm the value of N_LEDS in the code matches the actual NeoPixel strip length.
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.
Can I use more (or fewer) than 144 pixels?
Certainly! But there’s an upper limit of 170 pixels. This is the maximum that can be recorded in one SD card block (512 bytes). Going beyond this would require reading two (or more) blocks and would halve the speed of the entire system…you’d have to move at a snail’s pace when taking photos.
You’re welcome to hack it up and try, but the code will need significant changes, and there’s no guarantee the Arduino even has enough free RAM to handle this.
You’re welcome to hack it up and try, but the code will need significant changes, and there’s no guarantee the Arduino even has enough free RAM to handle this.
Do not proceed until you have a fully tested and working NeoPixel strip. Once the strip is glued to the painting wand, it will be really really hard to fix any wiring problems
Page last edited March 08, 2024
Text editor powered by tinymce.