It’s Alive! Alive I tell you!

Previous posts contain more information and pictures.

After a bunch of work, the EL Snowman is up and running, and it’s pretty nice. Here’s a video, though the video looks jerky on the faster animation rates (the actual animation is smooth), and the colors are off (the hat is blue and the arms are yellow).

The controller construction took about as much time as I expected. Here are a few shots (the full gallery with higher-resolution shots is here):

This is an early-stage view of the board. The 40-pin DIP socket for the 8515 microcontroller is on the left, and the series resistors for each channel of the 16 channels (connected to port A and port C on the 8515) is next to it. I have 4 of the 8 16-pin sockets hooked up – each will hold two triac relays.

The blue wire is 30-gauge wirewrap wire, nice and flexible and heavy enough to carry the 5mA it takes to trigger each relay.

Sixteen triac relays, AQH2223. You drive them with 5mA of current (5V and a dropping resistor), and that gives you a bunch of isolation between the microcontroller and the inverter that drives the EL. There are cheaper options but I had one on hand and could verify that it worked before I ordered them. About $2 each.

The back of the completed board. Functional, but not even close to pretty. So why does it look like that?

Well, there are a few options for construction:

The nicest option is to do a PC board. That’s a fair amount of work for a one-off project and I would have to deal with the turnaround time for creating the PCs and probably having to iterate to get the design to work. If I was doing something that required high-speed signals, it probably wouldn’t work with this sort of messiness, but we’re only talking a few KHz maximum here.

A second option would be to do a wire-wrapped board. I’ve done a few wire-wrapped designs and they work pretty well, but wire-wrapped sockets are *expensive* – about $2.50 each for a 16-pin socket, about 10x what a solder-tab socket costs.

So, that leaves point-to-point wiring. One technique that I use here to connect passive components (such as the resistors here) is to use a hand wire-wrap to wrap a piece of wire-wrap wire around the lead of the passive component. That isn’t sufficient on its own (wire wrap sockets work because the leads are square and the wrapping actually creates a gas-tight weld to the socket pin), but with a tiny bit of solder you get a very clean joint.

I’ve built 5-6 projects using this sort of construction, and they’ve worked well over the years.

 

The completed board in the project box. We have, from left to right:

  1. The EL wire inverter, potted in epoxy (it comes that way). It takes 12V in.
  2. An LM7805 linear regulator and filtering capacitors to give me 5V for the microcontroller.
  3. Above that, a small capacitor to provide some load to the inverter when all segments are off. I also connected a 3’ extra length of white EL wire to provide some load and to act as a pilot light. EL inverters don’t like operating without a load on them.
  4. The bank of 16 triac relays. The ribbon cable is wired in pairs – you have a switched wire from one of the triac relays, and then a wire that goes back to the inverter. The common wires are joined together and become the green wires that head back to the inverter.
  5. The empty socket for the microcontroller.

 

Here’s the completed display with the back spray painted white.

 

And a disturbing picture of the back. For each of the animation frames, I had to join 5 segments (two arms, 3 balls) together with the ribbon cable wire for that channel, and there was no nice way to do that (though there certainly could have been a nicer way than what I chose), so that’s the ugly yellow shrink wrap which is then sealed with hot glue.

 
The mess during the construction. The display was done in a different room.

Code

The code is written in C. I started out the project using CodeVisionAVR, a nice IDE that has a *very* useful wizard that will make the initial setup of the processor easier – code like this:

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: 7.813 kHz
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x05;
TCNT0=0x7D;
OCR0=0x00;

So I can just choose 7.813 kHz as a refresh rate rather than figuring out that I need to set TCCR0 to 0x05. That’s a big timesaver.

The big disadvantage of CodeVisionAVR (beyond that you have to pay for it) is the way that they handle licensing. When they release a new version, they’ll send you a email with a link to the download site and the decryption key for that version, but they don’t keep additional versions around on their website, so if you don’t download the version and miss a later email, you are SOL – the decryption key doesn’t work on the version that’s available on the website. When my laptop cratered, this was pretty annoying – I couldn’t download the version that I bought from the website so I had to pay for an update even though I didn’t care about the updated features. And when you do install a version, you have to send them a code in email, and then they send you the key that unlocks the product so you can finally use it. Their turnaround is pretty fast but it doesn’t help when you want to use it *right then* – you need to wait overnight, typically. They do have great tech support, and if you’re dealing with unfamiliar AVR variants the code wizard is a big timesaver.

Anyway, while I was waiting for my new unlock code to show up, I tried the AVR studio/gcc combination, and decided to stay with it for this project. The language is slightly newer (I can write “for (int i)” instead of having to declare “I” earlier), though programming is a bit more time consuming with more UI actions (there may be a way to make this easier).


So, what do you think ?