# NeoPixel LED Cortana Costume

## Overview

http://youtu.be/LxMiDvhkTXs

In this project we’re adding sewable NeoPixels and GEMMA to a bodysuit to make a light up Cortana costume.&nbsp;

To get extra details, we’ll trace artwork from reference photos, format the artwork and make a stencil that we can 3d print.

### How it Works

This sewable project uses a Gemma, NeoPixel Rings and sewable NeoPixels use our condutive thread to connect data, power and ground.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/512/medium800thumb/led_pixels_leds_cortana-loop3.jpg?1448312679)

### Project Advisory&nbsp;

Stitching on stretchy fabric can be very challenging. Be sure to stretch the fabric while you sew so the thread doesn’t end up too tight, or the strong stainless steel thread might tear the fabric. If you’re a beginner, stick to soldering or try an easier conductive thread project first!

### Prerequisite&nbsp;Guides

- [Introducing GEMMA](../../../introducing-gemma/)
- [NeoPixel Uberguide](../../../adafruit-neopixel-uberguide)
- [Conductive Thread](../../../conductive-thread)

![](https://cdn-learn.adafruit.com/assets/assets/000/019/514/medium800/leds_parts.jpg?1409890743)

### Parts &&nbsp;Components

Most of the tools parts and supplies are available in our shop.

- [Gemma](https://www.adafruit.com/product/1222)
- [NeoPixels](https://www.adafruit.com/products/1559)
- [NeoPixel Ring 16x](https://www.adafruit.com/product/1463)
- [150mAh Lipo Battery](https://www.adafruit.com/product/1317)&nbsp;

### Tools & Supplies

- [Condutive Thread](https://www.adafruit.com/search?q=conductive+thread&b=1)
- [Needles](https://www.adafruit.com/search?q=needles&b=1)
- [3D Printer](https://www.adafruit.com/search?q=3D+Printer&b=1)
- [PLA Filament](https://www.adafruit.com/search?q=filament&b=1)
- [Wire Stripper](https://www.adafruit.com/products/527)
- [Soldering Iron](https://www.adafruit.com/search?q=Soldering+Iron&b=1)
- [Solder](https://www.adafruit.com/search?q=Solder+spool&b=1)

![](https://cdn-learn.adafruit.com/assets/assets/000/019/510/medium800thumb/led_pixels_leds_cortana-loop2.jpg?1448312648)

https://youtu.be/oUuGXWMr3sE

# NeoPixel LED Cortana Costume

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/019/513/medium800/leds_cortana-circuit.jpg?1409890558)

Connect the NeoPixel Ring to Gemma using Silicone Wire.&nbsp;

**Vcc** to **&nbsp;Vout**  
**IN** to **&nbsp;D1**  
**GND** to **GND**

Connect each NeoPixel into two&nbsp;chain&nbsp;&nbsp;along the sides. Create a Y connection were they meet in the middle.

Share&nbsp;the NeoPixel Ring's&nbsp; **Out** &nbsp;pin&nbsp;to&nbsp;the digital pins on both NeoPixel chains as shown in the diagram.&nbsp;

Connect **-** and **+** pins on the NeoPixels to **GND** and **Vout** on Gemma.

# NeoPixel LED Cortana Costume

## Code

Load the following code onto your GEMMA using the Adafruit Arduino IDE or Codebender:

```auto
//Cortana costume animating NeoPixels
//based on the Larson Scanner Shades by Phillip Burgess
//https://learn.adafruit.com/larson-scanner-shades
//modified by Becky Stern for Adafruit
#include <Adafruit_NeoPixel.h>

#define PIN 1

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(21, PIN, NEO_GRB + NEO_KHZ800);

int ringRightSide[] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
int ringLeftSide[] = {0, 15, 14, 13, 12, 11, 10, 9, 8};
int singlePixels[] = {16, 17, 18, 19, 20};

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel.  Avoid connecting
// on a live circuit...if you must, connect GND first.

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

int pos = 0;
int pos2 = 0;

void loop() {
    // Draw 5 pixels centered on pos.  setPixelColor() will clip any
  // pixels off the ends of the strip, we don't need to watch for that.
  strip.setPixelColor(ringRightSide[abs((pos - 2)%9)], strip.Color(0, 0, 80)); // Dark blue
  strip.setPixelColor(ringRightSide[abs((pos - 1)%9)], strip.Color(0, 0, 150)); // Medium blue
  strip.setPixelColor(ringRightSide[abs((pos    )%9)], strip.Color(15, 15, 200)); // Center pixel is brightest
  strip.setPixelColor(ringRightSide[abs((pos + 1)%9)], strip.Color(0, 0, 150)); // Medium blue
  strip.setPixelColor(ringRightSide[abs((pos + 2)%9)], strip.Color(0, 0, 80)); // Dark blue
  
  strip.setPixelColor(ringLeftSide[abs((pos - 2)%9)], strip.Color(0, 0, 80)); // Dark blue
  strip.setPixelColor(ringLeftSide[abs((pos - 1)%9)], strip.Color(0, 0, 150)); // Medium blue
  strip.setPixelColor(ringLeftSide[abs((pos    )%9)], strip.Color(15, 15, 200)); // Center pixel is brightest
  strip.setPixelColor(ringLeftSide[abs((pos + 1)%9)], strip.Color(0, 0, 150)); // Medium blue
  strip.setPixelColor(ringLeftSide[abs((pos + 2)%9)], strip.Color(0, 0, 80)); // Dark blue
  
  strip.setPixelColor(singlePixels[abs(pos2 - 1)], strip.Color(0, 0, 80)); // Dark blue
  strip.setPixelColor(singlePixels[abs(pos2    )], strip.Color(15, 15, 200)); // Center pixel is brightest
  strip.setPixelColor(singlePixels[abs(pos2 + 1)], strip.Color(0, 0, 80)); // Dark blue
  
    strip.show();
  delay(100);
  
    // Rather than being sneaky and erasing just the tail pixel,
  // it's easier to erase it all and draw a new one next time.
  for(int j=-2; j<= 2; j++) {
    strip.setPixelColor(ringRightSide[(pos+j)%9], 0);
    strip.setPixelColor(ringLeftSide[(pos+j)%9], 0);
    strip.setPixelColor(singlePixels[(pos2+j)%5], 0);
  }
  

  pos += 1;
  if(pos < 0) {
    pos = 1;

  } else if(pos >= 9) {
    pos = 0;

  }

  pos2 += 1;
  if(pos2 < 0) {
    pos2 = 1;
  } else if(pos2 >= 6) {
    pos2 = 0;

  }

}
```

# NeoPixel LED Cortana Costume

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/019/515/medium800/leds_DSC_4895.jpg?1409890859)

A body form is a must for this project! You can make your own if necessary, but you really shouldn't attempt this project without one.

Suit up your bodyform with your shapewear undergarment and mock up the layout of circuitry using pins and&nbsp;a marking pen or pencil.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/516/medium800/leds_DSC_5143.jpg?1409890945)

We'll be both soldering and sewing to GEMMA, so let's do the soldering first. Attach two silicone-coated wires to Vout and GND, and one to D1. Then connect one set up to Power, Ground, and Data Input&nbsp;on the 16-NeoPixel ring, respectively.

Solder another wire to the NeoPixel ring's Data Out pin.

When you're happy with the layout, stitch GEMMA to the undergarmend with plain cotton thread around one of the unused pins. Be careful not to accidentlaly stitch it to your body form! You may need to pull the stretchy fabric away from the form to be sure the needle doesn't pierce any fabric cover that might be on your body form.

Before affixing the ring to the garment, start stitching connections from Vout and GND on GEMMA to head to your sewable pixels. You don't have to complete the buses now, this is just so you don't have to sew uncomfortably underneath the NeoPixel ring, so you can leave long thread tails hanging out for now.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/517/medium800/leds_DSC_5146.jpg?1409890967)

Secure the NeoPixel ring to the garment with plain thread.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/518/medium800/leds_DSC_5148.jpg?1409891014)

Attach the Data Out wire to the garment by stripping a long section of the wire and stitching over and around it with conductive thread. Double the wire over to make a loop, make sure that it can't pull loose from the thread connection!

![](https://cdn-learn.adafruit.com/assets/assets/000/019/520/medium800/leds_DSC_7237.jpg?1409891158)

Since we want the right and left pixel chains to perform the same animation, we'll just split the data connection and send it to both at the same time-- they'll act "mirror image" this way without extra code! Stitch the data line to the inputs on the first two sewable pixels.

Use those extra power and ground wires to criss cross and transition to conductive thread for the far power and ground buses on the pixel chains (as pictured).

![](https://cdn-learn.adafruit.com/assets/assets/000/019/519/medium800/leds_DSC_5139.jpg?1409891060)

Pick up your power and ground threads and stitch on the rest of your pixels. Pull the fabric from the body form and carefully pick up bits of material to create a running stitch on your needle, then pull through. Double check you're not sewing to your form.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/523/medium800/leds_DSC_5141.jpg?1409891295)

Gently stretch the fabric as you sew, to make sure there is enough slack in the thread to accomodate for the stretching necessary to put the garment on. Stainless steel conductive thread is very strong and will not stretch-- it will instead tear through your delicate knit fabric and could ruin your project... we've said it before but it's worth mentioning again: this project requires challenging and technical execution, if it's your first foray into conductive thread we strongly recommend you try something on woven (not stretchy) fabric first!

At each pixel, wrap tightly around the connection pad, then tie one knot and continue on without breaking the thread. Since the running stitch should be pretty loose (to allow for more stretch), this knot prevents the loops around the pixel from opening up and possibly shorting other components on the pixel.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/521/medium800/leds_DSC_7242.jpg?1409891228)

Tidy stitching is the name of the game here! Here's a sewn pixel closeup.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/522/medium800/leds_DSC_7216.jpg?1409891249)

It's hard to test your circuit until you've finished stitching! Once you've sewn your pixel chains, you can leave the excess power and ground threads attached in case you need to double over your connections. Just coil them up and pin them to your body form, making sure they're not touching each other.

# NeoPixel LED Cortana Costume

## 3D Printing

![](https://cdn-learn.adafruit.com/assets/assets/000/019/524/medium800/leds_vector1.jpg?1409891720)

## Trace Reference

Build the stencil&nbsp;files by tracing out the details&nbsp;in your favorite vector app to create the paths or download the svg vectors paths!

&nbsp;

[Download SVG Paths](http://www.thingiverse.com/thing:467346/#files)
![](https://cdn-learn.adafruit.com/assets/assets/000/019/525/medium800/leds_vector2.jpg?1409891862)

## Measure body length

Create a document with the correct body measruments for each part of the upper, middle and lower chest.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/526/medium800/leds_vector3.jpg?1409891885)

## Exturde Paths

Next we'll build the solid pieces that will act as the cutouts for the stencils, or you download the STLs for the shoulders, chest and lower body.

Make a square&nbsp;as big as the build plate you'll be printing on, here we made it 30cm x 30 cm.&nbsp;Import the svg file, snap the bottom faces to the&nbsp;top of the square, just a couple millimeters below the box.

[Download Stencile STL](http://www.thingiverse.com/thing:467346)
![](https://cdn-learn.adafruit.com/assets/assets/000/019/527/medium800/leds_vector4.jpg?1409891890)

Make the stencile about 1 to 1.5 mm thick. We found&nbsp;that a thinner stencile produced cleaner edges when spray painting on the&nbsp;unitard.

![](https://cdn-learn.adafruit.com/assets/assets/000/019/571/medium800/leds_printing.jpg?1409958782)

## Print&nbsp;Stencil

Clean your build plate and preheat your extrude. We used a Flexable build plate for&nbsp;easy removal. Prints should take about an hour to complete.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/019/573/medium800/leds_mark-uni.jpg?1409958864)

## Mark LEDs on unitard

Mark the placement of were the&nbsp;NeoPixel LEDs are by&nbsp;wearing&nbsp;the unitard over the spanx.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/019/572/medium800/leds_tape-stencile.jpg?1409958793)

## Paint Stencil

Once we have marked our NeoPixel placments we mock up were we'd like the circuit trace details. Use pieces of blue tape once your happy with the placment of each stencil.

Keep the unitard stretch for painting. We used a box to keep the parts stretch out while spraying.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/019/577/medium800thumb/led_pixels_leds_cortana-loop.jpg?1448312700)

Let the paint dry for about 30mins and wear to your next halloween&nbsp;or cosplay event!


## Featured Products

### Adafruit GEMMA v2 - Miniature wearable electronic platform

[Adafruit GEMMA v2 - Miniature wearable electronic platform](https://www.adafruit.com/product/1222)
 **Deprecation Warning: The Gemma bit-bang USB technique it uses doesn't work as well as it did in 2014, many modern computers won't work well. So while we still carry the Gemma so that people can maintain some older projects, we no longer recommend it.** <a...></a...>

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1222)
[Related Guides to the Product](https://learn.adafruit.com/products/1222/guides)
### Silicone Cover Stranded-Core Wire - 2m 26AWG White

[Silicone Cover Stranded-Core Wire - 2m 26AWG White](https://www.adafruit.com/product/1882)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

In Stock
[Buy Now](https://www.adafruit.com/product/1882)
[Related Guides to the Product](https://learn.adafruit.com/products/1882/guides)
### NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1463)
Round and round and round they go! 16 ultra bright smart LED NeoPixels are arranged in a circle with 1.75" (44.5mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

In Stock
[Buy Now](https://www.adafruit.com/product/1463)
[Related Guides to the Product](https://learn.adafruit.com/products/1463/guides)
### Flora RGB Smart NeoPixel version 3 - Sheet of 20

[Flora RGB Smart NeoPixel version 3 - Sheet of 20](https://www.adafruit.com/product/1559)
So, you want lots and lots of NeoPixels? And you want them for less? Not a problem! Here's a sheet of Flora NeoPixels fresh from the (reflow) oven. Cut them off as you need 'em and save a pretty penny while you're at it.  
  
**Each order comes with 20 pixels on a...**

In Stock
[Buy Now](https://www.adafruit.com/product/1559)
[Related Guides to the Product](https://learn.adafruit.com/products/1559/guides)
### Stainless Thin Conductive Thread - 2 ply - 23 meter/76 ft

[Stainless Thin Conductive Thread - 2 ply - 23 meter/76 ft](https://www.adafruit.com/product/640)
After months of searching, we finally have what we consider to be the ultimate conductive thread. It's thin, strong, smooth, and made completely of 316L stainless steel. Once you start working with this thread you'll quickly agree its optimal for any wearables work!  
  
This...

In Stock
[Buy Now](https://www.adafruit.com/product/640)
[Related Guides to the Product](https://learn.adafruit.com/products/640/guides)
### Needle set - 3/9 sizes - 20 needles

[Needle set - 3/9 sizes - 20 needles](https://www.adafruit.com/product/615)
Mighty needles, sew like the wind! This needle set is the only one you'll need for any sort of hand sewing, especially using our conductive thread and wearable electronics parts.  
  
Each pack contains 20 gold-eye sharps, with eye sizes ranging from #3 (1.75" long) to #9...

Out of Stock
[Buy Now](https://www.adafruit.com/product/615)
[Related Guides to the Product](https://learn.adafruit.com/products/615/guides)
### PLA Filament for 3D Printers - 3mm Diameter - Black - 1KG

[PLA Filament for 3D Printers - 3mm Diameter - Black - 1KG](https://www.adafruit.com/product/2064)
Having a 3D printer without filament is sort of like having a regular printer without paper or&nbsp;ink. &nbsp;And while a lot of printers come with some filament there's a good chance you've been printing up a storm and need something new. &nbsp;That's why we've started...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/2064)
[Related Guides to the Product](https://learn.adafruit.com/products/2064/guides)
### Lithium Ion Polymer Battery - 3.7v 150mAh

[Lithium Ion Polymer Battery - 3.7v 150mAh](https://www.adafruit.com/product/1317)
Lithium-ion polymer (also known as 'lipo' or 'lipoly') batteries are thin, light, and powerful. The output ranges from 4.2V when completely charged to 3.7V. This battery has a capacity of 150mAh for a total of about 0.6 Wh. If you need a larger battery, <a...></a...>

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

## Related Guides

- [NeoPixel Ring Bangle Bracelet](https://learn.adafruit.com/neopixel-ring-bangle-bracelet.md)
- [IRIS LED and Prop Guards](https://learn.adafruit.com/iris-leds-prop-guards.md)
- [Light of Your Life Wedding Bouquet](https://learn.adafruit.com/light-of-your-life-wedding-bouquet.md)
- [Clockwork Goggles](https://learn.adafruit.com/gemma-m0-clockwork-goggles.md)
- [CircuitPython Media Dial](https://learn.adafruit.com/media-dial.md)
- [LED Rocket Lamp](https://learn.adafruit.com/led-rocket-lamp.md)
- [FLORA NeoGeo Watch](https://learn.adafruit.com/flora-geo-watch.md)
- [Unibeam](https://learn.adafruit.com/unibeam.md)
- [Adafruit NeoPixel Überguide](https://learn.adafruit.com/adafruit-neopixel-uberguide.md)
- [NeoPixels on Raspberry Pi](https://learn.adafruit.com/neopixels-on-raspberry-pi.md)
- [NeoPixel LED Necklace Insert with USB Charging](https://learn.adafruit.com/neopixel-led-necklace-insert-with-usb-charging.md)
- [3D Printed NeoPixel Ring Hair Dress](https://learn.adafruit.com/neopixel-ring-hair-dress.md)
- [Zelda Guardian Robot Terrako Companion](https://learn.adafruit.com/terrako.md)
- [Cyber Tank Girl Cosplay](https://learn.adafruit.com/cyber-tank-girl-cosplay.md)
- [2014 Halloween 3D Printed Projects Roundup](https://learn.adafruit.com/2014-halloween-3d-printed-projects-roundup.md)
