Overview

Author Gravatar Image BECKY STERN
Mod your headphones to glow! Express your personal blinken-style by adding 14 color-changing NeoPixels to a white pair of Skullcandy headphones. This intermediate-level soldering project embeds a FLORA main board in one earphone and uses a piece of ribbon wire to connect to the other earphone. Each pixel is addressable, so the colors an animation possibilities are endless!
Project assistance and modeling by the inimitable Risa Rose!

Tools & Supplies

Author Gravatar Image BECKY STERN
Prerequisite guides:
You will need the following materials:
You will need the following tools:
Any entry level 'all-in-one' soldering iron that you might find at your local hardware store should work. As with most things in life, you get what you pay for.
Upgrading to a higher end soldering iron setup, like the Hakko FX-888 that we stock in our store, will make soldering fun and easy.

Do not use a "ColdHeat" soldering iron
! They are not suitable for delicate electronics work and can damage the Flora (see here).

Click here to buy our entry level adjustable 30W 110V soldering iron.

Click here to upgrade to a Genuine Hakko FX-888 adjustable temperature soldering iron.

Learn how to solder with tons of tutorials!
You will want rosin core, 60/40 solder. Good solder is a good thing. Bad solder leads to bridging and cold solder joints which can be tough to find.

Click here to buy a spool of leaded solder (recommended for beginners).

Click here to buy a spool of lead-free solder.
Don't forget your wire strippers, pliers, and flush snips!
A helping third hand tool really makes this project a joy to build.

Click here to buy a helping third hand tool.

Circuit Diagram

Author Gravatar Image BECKY STERN
Click to enlarge! Two rings of seven NeoPixels each are connected to FLORA: VBATT to (+), GND to (-), and D6 to the inward facing arrow on the first pixel. The second ring's first pixel is connected to the first ring's last (center) pixel so that each LED in the project is individually addressable, but if you wanted the rings to animate exactly the same patterns all the time, you could wire both rings' inputs to D6.

The tiny lipoly battery is connected to FLORA through the JST connector, and the tactile on/off switch interrupts one of its wires. FLORA's onboard switch will be hidden inside the earphone, so this switch can stick out one of the earphones and allow you to turn the circuit on and off!

Disassemble & Prep Headphones

Author Gravatar Image BECKY STERN
Grab a bin to store all the headphone parts. Even a big zip-top bag works! Think ahead about how you're going to keep all the parts together, especially if you're not doing the project all in one day.

Remove the foam pads from the ears and store them for later. Use a screwdriver to remove the earphones, being careful not to rip the delicate wires soldered to them (you can always re-solder it if one does break)
Drill a hole in the top of the earphones big enough for a three-conductor piece of ribbon wire to go through. This will connect the output of one LED ring to the input of the other. Leave plenty of slack in the wire, as you can always store it in the earphone but can't add more length later.

Make Pixel Rings

Author Gravatar Image BECKY STERN
For full light coverage, we made a ring from FLORA NeoPixels. However if you want to do less soldering, pick up two NeoPixel rings and skip this step!

Lay a piece of wide tape on your work surface, sticky side up. Tape this piece to the table at the edges so it doesn't slide around or lift up!

Use tweezers to arrange six pixels in a circle, with the + sides towards the inside of the circle.

Strip a piece of wire and form it into a circle appropriately sized to match up with all the + pads on the pixels and solder in place.

Remove the ring from the tape.
Place the ring in the jaws of a pair of helping hands, and use small staple-shaped bits of wire to connect the data lines as outlined in the circuit diagram (outward facing arrows to inward facing arrows) in all the gaps except one.
To diffuse inside the earphone, the LEDs need to be spaced a small distance away from the outer plastic surface. Solder small lengths of wire sticking straight out from all the - pads on the pixels. Make them longer than you think you need, since you can always trim them later.

Use a long piece of wire in another circle to connect all the grounds (-) together. To reduce the possibility of shorts, we used an insulated wire that's had the insulation stripped just in the spots where the wire meets the pixel.

Solder the circle to the "posts."

Connect the seventh pixel in the center, soldering + to the center circle, - with an insulated wire to the outer ground ring, and the data input from the data output of the last unconnected pixel in the ring as shown.
One ring finished! Now make another just like it.

Program & Test

Author Gravatar Image BECKY STERN
Hook up your rings to the FLORA main board with alligator clips and load up the NeoPixel test code to ensure they're working properly before proceeding.

Below is the animation code we used for the headphones, which is just a very minor modification to the standard strandtest sketch, altered to wipe the pixels to various colors. Copy and paste this code into the Adafruit Arduino IDE:
Copy Code
#include <Adafruit_NeoPixel.h>

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_RGB     Pixels are wired for RGB bitstream
//   NEO_GRB     Pixels are wired for GRB bitstream
//   NEO_KHZ400  400 KHz bitstream (e.g. FLORA pixels)
//   NEO_KHZ800  800 KHz bitstream (e.g. High Density LED strip)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(14, 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(200, 0, 218), 50); // Blue
  colorWipe(strip.Color(17, 249, 230), 50); // Blue
  colorWipe(strip.Color(235, 249, 17), 50); // Blue
  colorWipe(strip.Color(17, 93, 249), 50); // Blue
  colorWipe(strip.Color(255, 164, 56), 50); // Blue
  colorWipe(strip.Color(255, 56, 112), 50); // Blue
  colorWipe(strip.Color(56, 164, 255), 50); // Blue
  colorWipe(strip.Color(255, 56, 140), 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);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}

Install Circuit

Author Gravatar Image BECKY STERN
Replace the speaker/plastic earphone plate and screw it back together.

If your headphones have an easily-accessible channel running over the head, you can run your ribbon wire through it. Ours didn't so we just tucked the wire against the over-head piece and glued it in place (these Skullcandy headphones have a silicone over-head piece that necessitated a silicone-based adhesive).
Position the ring in the center of the earphone and use clear packing tape across the back and up the insides of the plastic earphone. The ring doesn't need much help to stay in place, so the tape helps just enough, and has the added bonus of insulating the back of the LED ring from the exposed contacts on the back of the earphone's speaker.

Use a pair of tweezers or pliers to gently pull a small amount of wire slack into the earphone through the hole you drilled earlier. This will allow you to easily adjust the headphones without yanking any of your solder joints.
Solder one wire to each power and ground (+ and -) lines of the pixel ring. Solder the third wire to the input of the first pixel in the ring. This is the "all alone" ring that goes in the second earphone.
Strip and tin the three wires of your ribbon cable that connects between earphones.
Trim down the spacer posts so they're all the same length. "Dry fit" the ring in the earphone to see if the posts are a good length. You want them to hold the ring away from the outer plastic, but not get in the way of closing the earphones up again.

The ring in the same earphone as the FLORA and battery may have to sit a bit closer to the outer plastic of the earphone to allow space for the additional components.
Run the ribbon wire into the other earphone and solder the power and ground wires to the + and - rings on the LED ring, as before, but solder the data wire to the output pad on the center pixel.

Following the circuit diagram, solder the ring's inner power bus to VBATT on the FLORA main board. Solder the ring's outer ground bus to any pad marked GND on FLORA.

Use tape to stick the ring in position, with FLORA sitting right on top of it. Plug in the charged tiny lipoly and flip the tiny power switch on FLORA to ON. Do all your pixels light up and change color? If so, great! If not, flip it off and check your circuit for shorts or missed connections, and double check your wiring against the circuit diagram.
Now we need a way to turn the circuit on and off from outside the earphones! Insert the leads of the tactile on/off switch through the hold you drilled in the earphone.

Make sure FLORA's power switch is set to OFF, and snip one of the battery's wires.
Soldering directly to the batteries leads can be dangerous! It's important to protect these wires from shorting to other parts of the circuit while working. DO NOT LEAVE UNATTENDED. Be sure to insulate each wire connection before moving on to the next step! Follow all safety warnings associated with using lipoly batteries in your projects.
Strip and tin the leads of the switch and the newly cut battery wire, then pair them up (one switch wire to one battery wire), twist and solder.

Use heat shrink tubing to insulate these new solder joints.
Set the FLORA's onboard switch to ON, and give your external power switch a click. Your circuit should power up, illuminating the earphones according to the Arduino code.

Tuck the wire connections in and use a little tape and/or Sugru to insulate the FLORA board from the headphone input board. If we had to do this project over, we'd swap the contents of each earphone so that the FLORA main board wasn't so crowded.
Home stretch! Re-install the speaker/earphone plate with the screws you removed earlier, and put the foam pads back on the headphones.

Wear 'em!

Author Gravatar Image BECKY STERN
Enjoy your new glowing headphones! Keep your volume down if you want to hear the compliments you'll get from passers-by.

To charge the battery or change the animations, you'll need to re-open the earphone containing the FLORA main board. Make sure your tactile switch is set to ON when charging the battery.
You can see that there's slightly less diffusion from the earphone containing the bulk of the electronics.

If your headphones have a LOT of room inside them, you could add an audio amplifier to the headphone input and make the animations sound-reactive!