El Wire MIDI Control

Submitted by paul on Wed, 2012-05-16 19:50

Last week I wrote firmware to control el wires by MIDI.

Hand-Eye Supply will be using it for their float in this year's Starlight Parade.

"Read more" for details....

Last year's float was controlled by the Vixen X-mas lighting software. This year, Laurence wants to make the float interactively respond to sounds. Tobias investigated different software and found excellent sound processing software, but no way to interface it to Vixen or last year's firmware using Renard protocol. All sound processing software works with MIDI, so I decided to reprogram the controllers.

I wrote the MIDI firmware last week, just in time for their float kick-off party where the announce the winners of a contest for who will ride on the float. Lots of pictures and info on that Core77 page. This blog is about the technical details, making the el wires respond to MIDI control this year.

The el wires are controlled by this modified Sparkfun el wire sequencer.

This is the same board that had many problems last year. You can see in the photo 3 of the triacs blew on this board and were replaced with TO-92 through hole versions.

Here are Laurence Sarrazin and Tobias Berblinger reprogramming the sequencers, while Kathryn tries "playing" the lights.

The float runs on 15 sequencers, with 5 plexiglass panels having 3 sequencers and 3 cool neon "big boy" inverters per panel.

Here is the actual hardware I built for this year.

There's no microcontroller. It just takes MIDI IN, goes through an opto-coupler, and then buffers the signal. Most of the space is a simple linear regulator to make 5 volts to send to the sequencers. Here's a schematic:

Here's a hi-res copy.

An important point is the 4.7K resistors in the cable. The sequencers have AVR chips running at 3.3 volts, so these resistors prevent the 5 volt signal from damaging them.

The same signal goes to all 15 boards. Jumpers on the edge of the board configure which 8 notes each board will "play".

The firmware only listens for MIDI channel #1. It is "velocity sensitive", with the following code:

uint8_t midi2intensity(uint8_t velocity)
        if (velocity 

Intensity 8 corresponds to fully on. Lower numbers, from 1 to 7, output PWM-like drive to the triacs for dimming.

The idea behind these scalings is most of the MIDI velocity range will make the el wires fully illuminate. El wire isn't terribly bright anyway. But if someday dimming effects are desired, that low section of the range can be used (without having to reprogram all 15 boards again).

Unfortunately, the Sparkfun sequencer lacks any information about the phase of the AC waveform to the el wire, so the pulses must be many cycles instead of switching individual cycles (you don't want to do fractional-cycle dimming, as would be done on resistive or inductive loads). The lowest couple intensities sometimes flicker as a result.

Here is the source code which runs on those sequencer boards.

In that lengthy post, I described all the workarounds I used. It's been over a year now, so it's not fresh in my memory as it was when I wrote that post. I remember replacing the 8 gate drive resistors to lower value, wiring the high voltage ground to 3.3 volts so the triacs were used in their best modes, and issues with the board resetting if a wire was connected to one of the 6 serial port pins. I recently converted those boards to accept MIDI. You can find the firmware on my blog here. A few boards had blown triacs, which I replaced this year. With a long el wire, there's a lot of capacitance and these controllers operating async to the AC waveform, so switching on at the crest of the waveform causes a huge current spike that can blow the triac. I haven't solved that, other than desoldering them and replacing them with new ones. Truly, the best info I can give you is buried in that lengthy post from last year.