Sound-Reactive Earrings

by Rocktakon in Circuits > Wearables

4005 Views, 101 Favorites, 0 Comments

Sound-Reactive Earrings

soun-reactive_earrings1.gif
soun-reactive_earrings3.gif
soun-reactive_earrings2.gif
IMG_2449.JPG

Have you wished that your earrings were a little more dynamic in the club? I thought so. These earrings don't just light up... the lights pulse in time with the beat of whatever music/sound is around you. They have several different animations and colors. And they automatically adjust to environments of different volumes, so there's no need to fool around with settings. Just turn 'em on and enjoy.

Credit where it's due: this project is really a remix of several ideas with some of my own design and code. Anything you think is great about this project is due to them, and everything that doesn't work for you is my fault.

Inspirations...

This Adafruit tutorial for the original light-up hoops by the incomparable Becky Stern:

https://learn.adafruit.com/gemma-hoop-earrings

This Adafruit tutorial for LED sound-reactive drums by the Ruiz Brothers:

https://learn.adafruit.com/gemma-powered-neopixel-led-sound-reactive-drums

Other people had made fun LED hoop earrings... and sound reactive light-up gadgets... why not mash them up!?!? Read on for the how-to. And I'd be flattered if you give me your contest vote - I'd love to win tools and toys I can use to design more fun projects! I'd love to have my own laser cutter and 3d printer in the shop for making robot parts, and more electronics would sure help!

Materials

15 - 9 (Medium).jpg
15 - 2 (Medium).jpg

Materials you'll need include for a pair (if you only have one ear, you can divide everything by 2):

Total cost for pair of earrings: ~$70 (worth it!)

(NOTE: you'll also need a charger for the batteries. It won't be attached to the earrings. I use this $6 one: https://www.adafruit.com/products/1304)

Tools:

  • Solid-core wire
  • Solder
  • Soldering iron
  • Pliers
  • Wire strippers/cutters
  • Hot glue gun
  • needle and thread
  • Double-sided tape

You'll see in the pictures that I also used some wires with alligator clips on the end for prototyping and testing. This is optional, but usually a good idea to make sure all your components are working before you solder everything together.

Assembly

Sound-reactive-earrings_bb.png
15 - 12 (Medium).jpg
15 - 11 (Medium).jpg

Lay out your parts as shown in the diagram below. This is exactly the same layout as the wiring diagram for the sound reactive drums so feel free to reference that one instead if you like it better. Note that the diagram shows an adjustable-gain microphone but I used an auto-gain mic as you can see in the photos. This helps the earrings adjust to the volume of whatever room you're in.

Wiring

Please be safe and follow good soldering habits.

Because you want a compact package in the end that minimizes the weight of the earrings and minimizes the wires hanging out, you'll want to carefully plan an measure each of the wires so that they're as short as possible. Actually they should have just a little bit of extra play in them so that you can solder the parts with a little bit of space between them (wires extended) and then twist the parts together with the wires collapsing in between. Also be sure to pay attention to the directionality of the connections. You'll want to connect the wires on the front side of the Gemma and the back side of the microphone. You can connect the neopixel ring on either the front or the back side - I tried one each way and it doesn't seem to make much difference in the ultimate compactness of the finished package. Solder on the front side of the neopixel ring if you prefer a look that shows the wires more prominently or on the back side if you want to hide the wires a bit more. The photo above shows an assembly with the wires soldered to the front of the neopixel ring.

When you finish soldering, clip off extra bits of wire sticking out of the solder so that they don't poke you when you're wearing them.

Completing assembly

Do yourself a favor and charge the battery fully before you attach it. You want to tape the battery to the back (flat) side of the Gemma using the double-sided tape. I also used a needle and thread to also tie the battery onto the Gemma to be sure it doesn't come loose (safety first!) and to hold the power wires in place. Before you tape/tie the battery on, make sure that you've figured out an orientation that makes it easy to attach the switch to the neopixel ring and easy to plug the battery into the Gemma. DO NOT hot glue the battery onto the gemma. Lithium ion batteries and heat do not mix.

You'll stack your parts so that the microphone and LEDs are on the
front (mic in the middle of the LED ring, facing forward), then Gemma behind that, facing forward, then battery behind that. The switch should be just behind the LED ring, and you can hot-glue it to the ring after soldering everything else.

Make sure you attach the switch at a point in the battery wires that leaves plenty of wire between the switch and the JST connector (the little white connector at the end). You need this play to be able to unplug the JST connector occasionally to charge the battery. You want to be able to unplug the connector without accidentally tearing the switch off.

You may want to dab some hot glue on any point bits of metal left to make sure they don't poke you. While you're at it, you can dab some hot glue on the knots in your thread to make sure they don't come apart.

Finally, attach an earwire. I attached it through the hole for the unused "out" pin on the neopixel ring.

I left these earrings "bare" with all the electronics visible. If you want to, you could create an enclosure for them that would diffuse the lights a bit and hide the electronics. But the weight of all the components already makes them a bit on the heavy side for earrings so I wouldn't want to add much more.

Program and Finish

IMG_2449.JPG
soun-reactive_earrings2.gif
soun-reactive_earrings1.gif
soun-reactive_earrings3.gif

Once your earrings are fully assembled, all that's left is to program them. You can upload the code here over USB via the Arduino IDE.

The attached code began as the Color Organ code developed for the Adafruit sound-reactive drums project. I've modified it to add different animation modes and various color schemes. You can upload it and use it as-is and go ahead and use it. There are few things in there for you to play with if you want:

Timing: there are three key variables you can change to set the timing of various features of the animation:

colorDelay = 120000, // time between color schemes (120,000 = 2 min)
modeDelay = 180000, // time between animation mode changes (180,000 = 3 min)
directionDelay = 60000; // time between spin direction changes (60,000 = 1 min)

Colors: The program contains various "color schemes", each one made up of two values (colorLo and colorHi) used to map a range of colors. The color maps are contained in these two arrays:

mapLo[] = {255, 30, 85, 140, 110},
mapHi[] = {85, 150, 15, 65, 230},

These are arrays of high and low values for various color mappings. You can add additional pairs of 0-255 values (one each to mapLo and mapHi) to add them to color rotation. Each color mapping is a pair of values, one from each of these two arrays (e.g. the first value from the Lo array and first value from the Hi array). You can add new color schemes of your choice just by adding a number to each of these arrays.

The brightness of the LEDs is set pretty low, but I think it's plenty adequate for being in a dark room at night. Turning the brightness up to max would drain the battery much quicker and unless you're trying to guide a plane to a safe landing on a foggy runway, you probably don't want them that bright.

There are other values in the code you can tweak if you want to.

Now that you've finished your project, put 'em on, go out and find a rave, and impress everybody!

Downloads