I made a pair of light up Kanye West glasses for New Years!

Firstly, I want to say that I completely ripped off this idea from my very talented friend Jordan. The electrical design is mine, but the fashion design is all hers. I highly recommend you pay her blog a visit to see what kind of other stuff she's cooked up.

Electrical Design

This was my first time dealing with audio from scratch. I have designed a few filters in school, but never carried them all the way out in a real world application. You can see my schematic here (click to zoom):

The audio signal path has a few stages:

Gain

Right off the microphone, the signal is given a half-rail bias (provided by U1D) and sent through a gain stage. I used an inverting amplifier because it will provide an "infinite" input impedance to the extremely weak microphone audio signal.

Having never dealt with an electret microphone before (besides my ch00f-o-scope which hardly counts), I didn't know how much gain I was going to need. Being lazy, I simply configured a single 10k pot so that the brush contact connected to the inverting input of U1A and it alone provided both resistors. This is a good lazy solution if you need a gain of 10 or 20. For a gain of 200 though, it proves difficult because you need to carefully turn the pot until the resistance on one side is 1/200th the resistance on the other. Basically, if you split the 270 degrees of turning motion of my pot into 200 segments, you need to turn it to just one segment before the end without touching the end. This is basically impossible, so I did a last minute re-work to make it as you see it in the schematic.

Low Pass Filter

This stage is pretty straight forward. The passive LPF's cutoff frequency is determined by:

Freq = 1/(2*pi*R*C)

In this case, that's around 50Hz. This way, the glasses will only "hear" the base.

Envelope detector

The goal of an envelope detector is to give a voltage output that is proportional to the amplitude of the waveform input. As you can see in this graph, the green waveform is the audio, and the blue waveform is the envelope:

Fun fact, AM (or Amplitude Modulation) radio uses an envelope detector to turn the amplitude of an EM wave into the audio waveform that you hear (the actual carrier frequency is much much higher than the audible band).

A passive envelope detector simply passes the audio through a diode and into a capacitor/resistor pair. The idea is that as the waveform voltage increases, it will charge the capacitor through the diode, but when it decreases, the capacitor will be unable to discharge through the diode, and must instead slowly discharge through the resistor. The time constant of this pair needs to be fairly long or you'll end up with another waveform instead of an envelope.

EDIT: I noticed during the construction of my LED Jacket that the RC pair I have here is actually pretty darn big. As is, the time constant is .5 seconds. This means that after an impulse (a beat), it might take over two seconds (5 time constants) for the lights to die down! Actually, this isn't quite true. If I had tied the capacitor to the VCC/2 rail, that would be the case. Because I'm tying it to ground, I never give the cap a chance to discharge all the way. It will drop very sharply from its peak voltage down to VCC/2 and then stay there. The cap will discharge most quickly while its voltage is high, so instead of taking 5 or so time constants, it really takes less than one. To compensate, I needed a very large RC time constant in this circuit.

Here I am using an active envelope detector. The only difference is that the diode is placed inside the feedback loop of the opamp. This prevents you from having to deal with the .7v drop across a standard diode. The opamp will compensate for that.

The output of the envelope detector is no longer an AC waveform, but rather a DC-ish voltage level that will be somewhere between 1/2 rail voltage (silent) or full rail voltage (really loud).

Comparators

The output of the envelope detector is passed to six comparators that compare it to a threshold value set by the tree of resistors. All of the resistors in this tree are 10k except the top one which is 100k. Because of the limited voltage swing of opamps, the envelope waveform (and the audio waveform for that matter) will never reach the top rail, so I wanted to drop the highest threshold down to a more manageable level. It didn't really matter anyway because I could always change the gain on the gain stage to compensate.

The output of these comparators is open collector meaning that they are high impedance when off and a current sink when on.

TRIACS

As you'll read later, EL wire operates on a high-voltage AC supply. TRIACs are switches used for switching (often high-voltage) AC signals on and off. They are switched on by a current passing into or out of their gate, and they switch off again once the current through the TRIAC is zero (this happens twice a cycle). In complicated applications, they can be used to attenuate AC signals (like PWM can attenuate DC signals), but in simpler applications, a continuous current out of the gate will keep the AC running, and no current will stop it.

Most TRIACs require some kind of opto-isolator part to prevent any high-voltage stuff from accidentally frying your more sensitive components (an opto-isolator is literally an LED and a photodiode in a single package. There is nothing conductive connecting the input and output). I found a part that claims that no isolation is needed. It's a non-stock part on Digikey, but incredibly useful while they're in stock. As long as current is flowing from the common node out of a gate, this TRIAC will allow AC current to conduct from the common node to the output node. They're also three TRIACS to each chip, so that's nice too.

It's kind of hard to see what's going on in the schematic because of how I split up each gate, but you can see on the right side that the outputs of the comparators connect to the gates of the TRIACs. On the left side of the schematic, you can see that the common node is connected to the positive voltage rail. This is to ensure that the comparators can exert a negative voltage on the gates and suck current out of them.

Power supply

Each strand of EL wire that I ordered came with a power supply. Rather than trying to build my own, I figured I'd keep the supply intact and simply use my circuit to switch it on and off.

I connected the live terminal of the supply to the "LIVEFROMPSU" terminal and the neutral end to the "LIGHTNEUTRAL" terminal (the VCC rail). Technically, I could have just connected the live terminal straight to the EL wire, but I wanted the opportunity to place a very large resistor between the terminals of the power supply.

I believe these supplies are resonant supplies, and without some kind of load, they will build up a charge somewhere and eventually break down (think of that video of the bridge resonating and exploding). This added resistor provides a dampening effect that will prevent damage. Expecting there to be times when my glasses are totally off (when it's quiet), I wanted to provide some minimum load to protect the supply.

I'm not sure if this is entirely necessary, or if 470k is even the correct value, but so far the supply still works.

Mechanical Design

Unlike most of my projects, the mechanical assembly of these glasses was more of a pain than the circuit itself. This is mostly due to the EL wire.

EL Wire

EL wire, or "ElectroLuminescent wire" is weird stuff. There are two conductors separated by some kind of fluorescent material. The two conductors act as a long capacitor, and passing a high frequency, high voltage through this capacitor causes the phosphorescent material to light up. Unlike most light-producing components, DC current doesn't really pass from one terminal to the other. They stay isolated throughout the entire length. You can see a cross section here:

There are a limited number of colors for the phosphorescent layer, so some of the colors (like the red and pink) just have a blue inner layer with a colored outer layer that reacts with the blue to produce the desired color. Think of how some pigments react with UV light.

Let me just say that stripping EL wire is a pain in the ass. I developed a few techniques, but never really mastered it. The real issue is stripping the clear layer carefully enough to keep the outer conductors intact and not strip the coating off the inner conductor. I found that heating the wire with a flame could sometimes help loosen or soften the coating, but it still typically took me at least three tries every time. I recommend investing in WAY more EL wire than you plan on using.

Glasses

For mounting the EL wire, I simply drilled some holes in the glasses and slipped the stripped ends of the EL wire into those holes. A single dot of super glue keeps the wire from sliding around on the shade.

EL wire operates at around 100V or so. The current is low enough to prevent injury, but that high of a voltage can produce a rather painful shock. I had to be careful when designing the glasses to not allow both conductors to touch my skin.

If you recall from before, for each wire, one of the conductors is traveling straight to the power supply while the other is switched on and off by the TRIACS. Those going straight to the supply are all tied together, while the others are tied individually to my board. At first, I thought there was some importance to the polarization of the EL wire and tried to maintain the polarization used in the power supply I was provided. With this orientation, the inner conductors were all tied together while the outer conductors were connected to the power supply individually.

Mechanically, this was an issue because the outer conductors are extremely fragile, and any sort of tugging on the wires going to my circuit would break them. To fix this, I reversed their roles. I tied all of the outer conductors together, so that all of the strain was going to the stronger inner conductors:

The connections on the inner conductors were wrapped safely in electrical tape to prevent electrocution of my face.

Here's a schematic doodle:

To bridge the nose, I simply connected the inner conductors of the wire on one side to the inner conductors on the other. All of the outer conductors were tied together for stability and redundancy.

All of this wiring is out of my field of view (as if you can see anything out of these glasses anyway), and above the nose piece, so I actually can't feel it at all. I'm a little weary of folding the glasses though as the wiring on the right side is a little tight.

Conclusion

I was in a super big hurry to finish this project before New Years, so I was a little hasty with the design. There are numerous ugly reworks of my circuit, and as you can see in the image above, I wasn't too concerned with aesthetics when cutting a hole out for the gain adjustment knob. The circuit will sometimes enter a mode where all of the lights turn on regardless of incoming audio which can only be fixed by power cycling. I'm not entirely sure why that is, but if I was planning on using these again, I would just redo the circuit entirely. After all as I said before, the glasses were the hard part.

The sound reactive effect of the glasses is really a sight to behold. I'm super impressed with myself. Enjoy!

Edit:

Also, I just had to share this:

So it's "Maximum UV Protection" for the parts that are actually...opaque.

Update:

Well, it was a wild and crazy night. I got a lot of compliments and one guy offered to buy them off me for a whopping $20! Here's a pic of my friend and I right before heading out (she's got pretty cool glasses herself):

Bill of Materials

For those of you who want to try making these on your own, here's a bill of materials. All you really need are the "DIGIKEYPARTNO"s. It's in .csv format.

I had several requests for photos of the circuit board, so here they are:

Relevant Reader Mail:

EL wire circuits advice

Schematic Stronger Glasses

For more on EL wire power supplies, click here.

For more on EL panels and dimming EL materials, click here.

Project files can be found here: Stronger Glasses package v1.0