El Wire Color

By: paul

2011-07-12 04:39:39

I recently got around to making a color fading el wire driver, which actually tries to shift the color by changing the AC frequency. "Read more" for technical details.... Here is a little video I tried to make. I think I spent more time trying to edit this video than building the whole project!! Update: "dcroy" built this same thing a few months before I did, and using only a 555 timer! Looks like it's not as unique as I thought! This is the schematic. Most of the parts are small surface mount and they're hidden under the transformer. Here's the code from the Arduino IDE. Pretty simple stuff. But beware, if you try this, it's essential to drive each transistor for the same length of time, and not more than about 1ms. If you drive one more than the other, or leave either on too long, the transform sees a DC or low frequency signal. That could result in far too much current, probably destroying the transistors if the battery is fresh.
const int pin1 = 12;
const int pin2 = 19;

void setup() {
  Serial.end();  // USB off, to save power
  for (byte i=0; i<25; i++) {
    pinMode(i, OUTPUT);    // all unused pins low
    digitalWrite(i, LOW);  // to avoid wasting power
  }
  pinMode(pin1, OUTPUT);
  pinMode(pin2, OUTPUT);
}

unsigned int us = 250 * 64;
const int usMax = 500 * 32;
const int usMin = 120 * 32;
byte dir = 0;

void loop() {
  digitalWrite(pin1, HIGH);
  delayMicroseconds(us / 32);
  digitalWrite(pin1, LOW);
  if (dir) {
    us = us + 1 + us / 2048;
    if (us >= usMax) dir = 0;
  } else {
    us = us - 1 - us / 2048;
    if (us <= usMin) dir = 1;
  }
  digitalWrite(pin2, HIGH);
  delayMicroseconds(us / 32);
  digitalWrite(pin2, LOW);
}
Back to archive index