# Simple and Beautiful NeoPixel Holiday Lights

## Introduction

Get your Holiday cheer up and running with NeoPixels!&nbsp; Make a beautiful color shifting light strand to put on your Christmas tree, your house, or add color and light to your artwork.&nbsp; These weatherproof LED pixels work great indoors or outdoors.&nbsp; We've included some fancy software to run the lights in an ever-shifting and changing array of color palettes.&nbsp; It's not much more work to choose and customize your own color palettes to create the exact look you want.

This project is great for beginners.&nbsp; There is just a little bit of easy soldering involved.&nbsp; Most of the challenge is in getting the software set up, but once you've got that working, customization is as easy&nbsp;as copy and paste.

Pictures in this guide show either a [Flora](https://www.adafruit.com/product/659) or [Circuit Playground](https://www.adafruit.com/product/3333) microcontroller — either one works fine, or you might even consider the [Gemma M0](https://www.adafruit.com/product/3501). Gemma M0 and Flora are a little less expensive, but Circuit Playground has a lot more options for future expansion: it has ten LEDs on its face, so with a few extra code tweaks you can use it as a glowing tree ornament, or the onboard microphone could make things sound-reactive if you add suitable code. Other microcontroller boards may work as well, as long as it’s Arduino- and FastLED-compatible.

These light strands are sturdy and versatile.&nbsp; Have fun making everything glow!

![](https://cdn-learn.adafruit.com/assets/assets/000/049/292/medium800/adafruit_products_christmastree_neopixels.jpg?1513277590)

# Simple and Beautiful NeoPixel Holiday Lights

## Wiring Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/049/481/medium800/adafruit_products_xmas-diagram.png?1513805204)

The great thing about these NeoPixel strands is that most of the wiring is already done for you, we just need to make some connections at the ends.

We'll show making an adapter for the microcontroller, then attach the NeoPixels with their included connector. Power connects at the opposite end of the light strand. That’s something frequently overlooked with NeoPixel projects: while color data _must_ travel in a specific direction from “in” to “out,” **power can go either way.** In the diagram above, a 5V power supply is connected at the _end_ of the strand, and we tap off this at the _start_ of the strand to power the microcontroller, where the strand’s data input is also connected.

You can easily chain multiple light strands together with their included connectors.&nbsp; Just remember that if you have more than a few strands chained together, you may need a [beefier power supply.](https://www.adafruit.com/product/658)&nbsp; A modest 2 Amp supply is good for a couple strands, or the 4A power supply listed in the sidebar should work for at least 5-8 strands, depending on how you set the brightness level.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/488/medium800/adafruit_products_xmas-lit.jpg?1513811627)

# Simple and Beautiful NeoPixel Holiday Lights

## Software

It's a great idea to get your software all set up and loaded onto your board right away, to make testing your connections easier later on.

To get the code running you'll need:

1. Arduino IDE (1.8 or newer preferred)
2. Adafruit Board support (for Flora, Circuit Playground or Gemma M0)
3. FastLED Library

It's also helpful to install the Adafruit NeoPixel&nbsp;library, for testing purposes or in case FastLED is not working.&nbsp; (Use `Sketch→Include Library→Manage Libraries…` and search for Adafruit NeoPixel)

### 1. Arduino IDE

If you’re not using a recent version of the Arduino IDE (1.8.3 or newer), this would be a [good time to upgrade](https://www.arduino.cc/en/Main/Software).&nbsp; If this is your first time using Arduino, [head over to this guide to get it installed](../../../../adafruit-arduino-ide-setup/arduino-1-dot-6-x-ide).&nbsp; It's free and fairly simple to get set up.

### 2. Board Support

You'll need to tell the Arduino IDE which board you're using.&nbsp; This takes just a few minutes of setup, and you'll only need to do it once.&nbsp;

- [Here's a step-by-step tutorial using the Flora](../../../../adafruit-arduino-ide-setup/arduino-1-dot-6-x-ide)
- [Here is a step-by-step tutorial using the Circuit Playground](../../../../introducing-circuit-playground/arduino)
- [And one for Gemma M0](../../../../adafruit-gemma-m0/arduino-ide-setup)

### 3. FastLED Library

This project uses the FastLED library, which provides high-performance math and color functions for NeoPixel projects. You'll need to download and install this manually:

[Download FastLED Library for Arduino](https://github.com/FastLED/FastLED/archive/master.zip)
Installing Arduino libraries is a frequent stumbling block, but [we have a guide explaining the procedure](../../../../adafruit-all-about-arduino-libraries-install-use).

### Upload the Code

Plug your microcontroller into your computer with a USB cable.&nbsp; In the Arduino IDE, go to **Tools \> Boards** and select the name of the board.&nbsp; Then go to **Tools \> Port** and select the board there too.&nbsp; (If it's not showing up there, be sure your microcontroller is plugged into your computer via USB)

This code was written by Mark Kriegsman.&nbsp; There are a few simple variables you can change: brightness of the LEDs and how quickly the lights shift between palettes.&nbsp; I'll get more into how to add and configure your own color palettes later on.

Warning: 

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/simple_strand_palettes/simple_strand_palettes.ino

# Simple and Beautiful NeoPixel Holiday Lights

## Assembly

NeoPixel color data must travel from the “in” end of the strand to the “out” end. Examine the backs of the pixels _very_ closely. Printed on the PCB, you might see either some data direction arrows, or the words “IN” and “OUT” between pads. The weatherproofing epoxy makes things murky and you may need to look at several pixels before finding one.&nbsp;This is important! If you connect the microcontroller to the wrong end, the lights won't work.

![adafruit_products_00_findarrow.jpg](https://cdn-learn.adafruit.com/assets/assets/000/049/284/medium640/adafruit_products_00_findarrow.jpg?1513223876)

If you have multiple LED strands, plug them into each other to create one long überstrand.

Each strand should have a pair of extra wires with exposed ends, for connecting power. Only **one** of these pairs is required. The rest should have their exposed tips trimmed flush or covered with tape or heat-shrink tubing to prevent electrical shorts.

For 1 to 3 linked strands, let’s use the pair of wires at the **end**. For longer strands, choose a pair near the **middle.**

Connect a female DC power adapter using the screw connectors, being **super extra careful** to **follow the polarity markings** stamped on the DC jack:

- **+** &nbsp;(plus) connects to the strand’s&nbsp; **red** wire
- – (minus) to the opposite wire

You may need to strip away a little extra insulation from the wires to make a good connection with the terminals.&nbsp;Tug a little on each wire to make sure it's firmly in place.

![adafruit_products_dcjack.jpg](https://cdn-learn.adafruit.com/assets/assets/000/049/525/medium640/adafruit_products_dcjack.jpg?1513898141)

To connect the microcontroller at the “input” end of the strand, I soldered up this little **adapter cable** using a **3-pin JST plug** (to the LEDs), a **2-pin JST cable** (to the Circuit Playground, Flora or Gemma board) and one end of an **alligator jumper cable**.

Don’t just follow the picture, take a good look at your actual hardware and be **super extra careful** to get the connections right:

- The **RED** wire from the LED strand should connect to the **RED** wire on the 2-pin JST plug. (If using an all-black 3-pin JST cable, as shown here, carefully follow the wires from the LED strand all the way through.)
- The **OPPOSITE** wire from the LED strand (furthest from the red wire) should connect to the **BLACK** wire on the 2-pin JST plug.
- The **MIDDLE** wire should go to the ’ **gator clip** , which can then be clipped to the appropriate pad on the microcontroller board.

![adafruit_products_jstgator.jpg](https://cdn-learn.adafruit.com/assets/assets/000/049/527/medium640/adafruit_products_jstgator.jpg?1513898353)

![adafruit_products_adapter-diagram.png](https://cdn-learn.adafruit.com/assets/assets/000/049/539/medium640/adafruit_products_adapter-diagram.png?1513908230)

If you don’t have these exact parts on-hand, it’s usually okay to **improvise**.

For example, if you don’t have or are unwilling to sacrifice an **alligator cable** , you can **solder a wire directly** to one of the pads on the microcontroller board. This is easily **removed later** by re-melting the solder and you can then use the board in other projects.

If you don’t have a **3-pin JST plug** , and you’re 100% okay sacrificing the “output” end of your LED strand, you can cut that plug off and use it as an input-end adapter. Do this at the mid-point between the plug and the last pixel, so there’s enough wire to be useful. Was your DC jack connected to the extra power wires there? That’s okay! Remember, the strand can accept power from _either_ end.

The wiring diagram and code both show the NeoPixel data connected to digital pin **6**. If using Circuit Playground or Gemma M0, the number and sequence of pads is different, and you’ll need to **modify the code** to reflect what pin has the NeoPixels connected. It’s fairly early in the sketch:

```
#define DATA_PIN   6
```

 **Double-check** all your connections: 5V, ground and NeoPixel data. If you have a multimeter with a continuity beep function, the “–” (minus) terminal on the DC jack should beep in response to any “GND” pad on the microcontroller board.

If everything looks good, connect a power supply and watch the pretty light show!

![adafruit_products_06_plugin.jpg](https://cdn-learn.adafruit.com/assets/assets/000/049/290/medium640/adafruit_products_06_plugin.jpg?1513224472)

![](https://cdn-learn.adafruit.com/assets/assets/000/049/489/medium800/adafruit_products_xmas-lit.jpg?1513811680)

# Simple and Beautiful NeoPixel Holiday Lights

## Troubleshooting

### Lights Don't Come On

First, check all your connections and make sure they are tight.&nbsp; The screw terminal may be the culprit.&nbsp; Check to be sure your wires are stripped enough, and the terminal is clamping down on bare wire instead of on insulation.&nbsp; &nbsp;Tug on the wires to make sure they're in there really firmly.

On occasion you get a screw terminal that just won't hold the wires very well.&nbsp; Try replacing the DC jack if this seems to be the problem.

Next, check to be sure you've uploaded the code to your microcontroller.&nbsp; For the Flora: when an upload is successful you'll see a red light come on and slow-blink (that means you're in bootloader mode), then you'll see a yellow LED flash for a moment (that means the Flora is receiving code).&nbsp; If you don't see this light sequence on the Flora, your code didn't upload correctly.&nbsp; Try hitting the reset button and uploading again.

![](https://cdn-learn.adafruit.com/assets/assets/000/049/296/medium800/adafruit_products_flora_uploading.jpg?1513278143)

If it seems to be uploading correctly but the light strand still doesn't come on:

Be sure that your code and your actual physical pin connections match.&nbsp; The code expects you to have connected your lights to pin #6.&nbsp; If you've connected to a different pin, update the code to match.&nbsp;

Also make sure you've got the three connector wires going to the correct pins -- it's easy to get them mixed up.

Lastly, check again on the back of the pixels to make sure your Flora is attached at the "in" end of the strand and not the "out" end.&nbsp;&nbsp;

### Code Won't Upload

Check to be sure that the correct board is selected from your Boards menu.&nbsp; Don't see it there?&nbsp; Head back to the **Software** page and follow the directions to get it installed.

Also check to be sure that under `Tools > Port ..` you can see and select your microcontroller.&nbsp; Don't see it there?&nbsp; Try a different USB cable, or try plugging your USB cable directly into your computer if it's going through a hub.&nbsp; Still don't see it?&nbsp; Try rebooting your computer.

Be sure you've installed the **FastLED** library (`Sketch > Include Library > Library Manager..`)&nbsp; You may need to update the library if you have an older version.

If you still can't get the code to upload, back up and try uploading sample sketches from the NeoPixel library Examples folder.&nbsp; Be sure you can get the **StrandTes** t sketch to work, then try this sketch again.

### Lights Come on but Misbehave

If only some of the lights come on, take a look at the code you uploaded and make sure you've changed this line:

`#define NUM_LEDS 400 // Change this to reflect the number of LEDs you have`

..to reflect the actual number of LEDs you have.&nbsp; It's OK to make this number too big, but it's a problem if it's too small.

If you get just one or two lights coming on in white or green: You may have your power and ground connections switched.&nbsp; Double check to make sure you soldered the connector on right.

# Simple and Beautiful NeoPixel Holiday Lights

## Creating Color Palettes

http://www.youtube.com/watch?v=7CDgxgyALWQ

 **FastLED Color Palettes**

Using the FastLED library opens up a world of LED coding tools that are fairly easy to use.&nbsp;

There's a fantastic tool called **PaletteKnife** that works great for artist-minded people who think in colors instead of in code, and this project uses it.&nbsp;

Watch the video above for a demo of just how easy this is.

**Want to try PaletteKnife and grab some new color palettes?**  
Here's what you'll _definitely_ need:

1. A basic understanding of how FastLED palettes are used.&nbsp; Check out the FastLED ColorPalette example, as well as FastLED Fire2012WithPalette example, both of which can be found in the&nbsp;[FastLED library](https://github.com/FastLED/FastLED) Examples folder.
2. You'll need Chrome or Safari. &nbsp;PaletteKnife doesn't work with Firefox or IE.
3. You will also need a little patience; it's not terribly slick but it works a dream.

Basically, you browse to the color palette that you want, and click PaletteKnife (a bookmarklet) in your browser. &nbsp;Then you COPY the resulting code, and PASTE it into your FastLED animation source code.&nbsp;

**Full instructions on how to get started with PaletteKnife are here:**  
[http://fastled.io/tools/paletteknife/](http://fastled.io/tools/paletteknife/)

![](https://cdn-learn.adafruit.com/assets/assets/000/049/297/medium800thumb/adafruit_products_parasol_head.jpg?1513278952)


## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### Circuit Playground Classic

[Circuit Playground Classic](https://www.adafruit.com/product/3000)
Would you like to learn electronics, with an all-in-one board that has sensors and LEDs built in? **Circuit Playground** is here - and it's the best way to practice programming on real hardware with no soldering or sewing required!

This is the **Classic**...

In Stock
[Buy Now](https://www.adafruit.com/product/3000)
[Related Guides to the Product](https://learn.adafruit.com/products/3000/guides)
### FLORA - Wearable electronic platform: Arduino-compatible

[FLORA - Wearable electronic platform: Arduino-compatible](https://www.adafruit.com/product/659)
FLORA is Adafruit's fully-featured wearable electronics platform. It's a round, sewable, Arduino-compatible microcontroller designed to empower amazing wearables projects.FLORA comes with Adafruit's support, [tutorials and...](http://learn.adafruit.com/category/flora)

In Stock
[Buy Now](https://www.adafruit.com/product/659)
[Related Guides to the Product](https://learn.adafruit.com/products/659/guides)
### Adafruit GEMMA M0 - Miniature wearable electronic platform

[Adafruit GEMMA M0 - Miniature wearable electronic platform](https://www.adafruit.com/product/3501)
The **Adafruit Gemma M0** is a super small microcontroller board, with just enough built-in to create many simple projects. It may look small and cute: round, about the size of a quarter, with friendly alligator-clip sew pads. But do not be fooled! The Gemma M0 is incredibly...

In Stock
[Buy Now](https://www.adafruit.com/product/3501)
[Related Guides to the Product](https://learn.adafruit.com/products/3501/guides)
### Adafruit NeoPixel LED Dots Strand - 20 LED 4" Pitch

[Adafruit NeoPixel LED Dots Strand - 20 LED 4" Pitch](https://www.adafruit.com/product/3631)
Attaching NeoPixel strips to your costume can be a struggle as the flexible PCBs can crack when bent too much. So how to add little dots of color? Use these stranded NeoPixel dots! They're very small, so they're easy to embed into any structure, costume, or wearable. Each dot is...

In Stock
[Buy Now](https://www.adafruit.com/product/3631)
[Related Guides to the Product](https://learn.adafruit.com/products/3631/guides)
### Adafruit NeoPixel LED Dots Strand - 20 LEDs at 2" Pitch

[Adafruit NeoPixel LED Dots Strand - 20 LEDs at 2" Pitch](https://www.adafruit.com/product/3630)
Attaching NeoPixel strips to your costume can be a struggle as the flexible PCBs can crack when bent too much. So how to add little dots of color? Use these stranded NeoPixel dots! They're very small, so they're easy to embed into any structure, costume, or wearable. Each dot is...

In Stock
[Buy Now](https://www.adafruit.com/product/3630)
[Related Guides to the Product](https://learn.adafruit.com/products/3630/guides)
### Female DC Power adapter - 2.1mm jack to screw terminal block

[Female DC Power adapter - 2.1mm jack to screw terminal block](https://www.adafruit.com/product/368)
If you need to connect a DC power wall wart to a board that doesn't have a DC jack - this adapter will come in very handy! There is a 2.1mm DC jack on one end, and a screw terminal block on the other. The terminals are labeled with positive/negative assuming a positive-tip configuration...

In Stock
[Buy Now](https://www.adafruit.com/product/368)
[Related Guides to the Product](https://learn.adafruit.com/products/368/guides)
### 5V 2A (2000mA) switching power supply - UL Listed

[5V 2A (2000mA) switching power supply - UL Listed](https://www.adafruit.com/product/276)
This is an FCC/CE certified and UL listed power supply. Need a lot of 5V power? This switching supply gives a clean regulated 5V output at up to 2000mA. 110 or 240 input, so it works in any country. The plugs are "US 2-prong" style so you may need a plug adapter, but you can pick one...

In Stock
[Buy Now](https://www.adafruit.com/product/276)
[Related Guides to the Product](https://learn.adafruit.com/products/276/guides)

## Related Guides

- [Introducing Circuit Playground](https://learn.adafruit.com/introducing-circuit-playground.md)
- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Bluefruit Ouija Board](https://learn.adafruit.com/bluefruit-ouija-board.md)
- [Compost Friend!](https://learn.adafruit.com/compost-optimization-machine.md)
- [How to Find Hidden COM Ports](https://learn.adafruit.com/how-to-find-hidden-com-ports.md)
- [NeoPixel Manicure](https://learn.adafruit.com/neopixel-manicure.md)
- [Micro USB Dock for Circuit Playground](https://learn.adafruit.com/micro-usb-dock-for-circuit-playground.md)
- [Case for Circuit Playground](https://learn.adafruit.com/case-for-circuit-playground.md)
- [NeoPixie Dust Bag](https://learn.adafruit.com/neopixel-pixie-dust-bag.md)
- [Makecode para la Circuit Playground Express](https://learn.adafruit.com/makecode-es.md)
- [Makey Paper Craft ](https://learn.adafruit.com/makey-paper-craft.md)
- [Glowing Fascinator Hat with Gemma M0 and MakeCode](https://learn.adafruit.com/glowing-fascinator-hat-gemma-m0-makecode.md)
- [Trash Panda](https://learn.adafruit.com/trash-panda-circuit-python-crickit.md)
- [Mystical LED Halloween Hood](https://learn.adafruit.com/mystical-led-halloween-hood.md)
- [CircuitPython Hardware: PCA9685 PWM & Servo Driver](https://learn.adafruit.com/micropython-hardware-pca9685-pwm-and-servo-driver.md)
- [Flora Accelerometer](https://learn.adafruit.com/flora-accelerometer.md)
- [Jellyfish Umbrella with easy WLED WiFi Control](https://learn.adafruit.com/jellyfish-umbrella-with-easy-wled-wifi-control.md)
