Wednesday, May 21, 2014

Keeping Multiple Electroluminescent Wires Bright With An Arduino

I recently helped a student with a nice, provocative installation with kitschy religious imagery that used EL wires to simulate a neon sign. She had a border, made by a yellow wire, framing three words in orange, each made by its own wire. She wanted the border to stay lit while the words blinked on and off. If you've ever worked with EL wires you will know that if they have the same power source, such as an Arduino (with El Escudo Dos controller) the more wires that are lit at once the dimmer they all get, since the voltage is shared. She really should have done the words with one wire but she
wanted the option to blink the words in series instead of at once.
As soon as we got them blinking, we saw the problem. The border significantly dimmed when the words came on, then got nice and bright when they went off. Not a nice effect. That was using this program:

const int border = 2;
const int wire1 = 3;
const int wire2 = 4;
const int wire3 = 5;
const int numberOfWires = 4;
const int delayTime = 750;

int wires[] = {
  wire1,wire2,wire3,border};

void setup() {                
  for(int i = 0; i < numberOfWires; i++) {
    pinMode(wires[i], OUTPUT);     
  }
  digitalWrite(border, HIGH);
}

void loop() {
  for(int i = 0; i < numberOfWires-1; i++) {
    digitalWrite(wires[i], HIGH);  
  }  
  delay(delayTime);
  for(int i = 0; i < numberOfWires-1; i++) {
    digitalWrite(wires[i], LOW);  
  }  
  delay(delayTime);
}
I had an idea it might be possible to get around the significant dimming by strobing the border and word wires imperceptibly fast to maintain the high power to the border, and it worked! Here is that code:


const int border = 2;
const int wire1 = 3;
const int wire2 = 4;
const int wire3 = 5;
const int numberOfWires = 4;
const int delayTime = 750;

int wires[] = {
  wire1,wire2,wire3,border};

void setup() {                
  for(int i = 0; i < numberOfWires; i++) {
    pinMode(wires[i], OUTPUT);     
  }
  digitalWrite(border, HIGH);
}

void loop() {

  for(int i = 0; i < 50; i++) {
    for(int i = 0; i < numberOfWires-1; i++) {
      digitalWrite(wires[i], HIGH);  
    }  
    digitalWrite(border, LOW);
    delay(15);
    for(int i = 0; i < numberOfWires-1; i++) {
      digitalWrite(wires[i], LOW);  
    }  
    digitalWrite(border, HIGH);
    delay(15);
  }    
  for(int i = 0; i < numberOfWires-1; i++) {
    digitalWrite(wires[i], LOW);  
  }  
  digitalWrite(border, HIGH);
  delay(delayTime);  
}
You can see how nicely it worked in these two pictures comparing the on and off states. The video below actually picks up the strobing but you lose the brightness:



No comments :