Today I finished the EL sequencer I’ve been working on since February, so in celebration I’m posting the picture of the final prototype hardware and all the code it takes to make this thing run. Maybe someone will find this useful
Lots of thanks to my Co-worker Bill at XMission for patiently answering many questions about c and basic electronics, and my friends Paul and Jeff who offered lots of useful advice on writing code!

This microcontroller project using the Arduino platform allows custom sequences to be written for strands of EL-Wire. Off the shelf sequencers have hard-coded sequences that are not customizable limiting how an artist must implement them. With this setup one can write their own sequences and even use input from a variety of sensors (in this case a photoresistor) to modify the running sequence. The example code included below has 2 very basic patterns (chase and alternate), but includes most of the building blocks necessary for creating more elaborate and interactive sequences.

// this sketch was taped together by p3t3
// project2501]at[gmail]dot[com
// please include this info if you use or repost this code// set which pins have el wire connected to them
int eL7 = 7;
int eL8 = 8;
int eL9 = 9;
int eL10 = 10;// arrays to address groups of pins simultaneously
int evens[] = {2,4,6,8,10,12};
int numEvens = 6;
int odds[] = {1,3,5,7,9,11,13};
int numOdds = 7;int sensorInput= 0;
void setup()
{
int i;// set pins 1-13 as output. im sure theres a better way to do this
for (i = 0; i < numEvens; i++)
pinMode(evens[i], OUTPUT);
for (i = 0; i < numOdds; i++)
pinMode (odds[i], OUTPUT);Serial.begin(9600);
}void loop()
{
int sensorInput = analogRead(0); //check sensor input on pin 0// chasing mode
if(sensorInput <= 511){
digitalWrite(eL7, HIGH);
delay(100);
digitalWrite(eL8, HIGH);
delay(100);
digitalWrite(eL9, HIGH);
delay(100);
digitalWrite(eL10, HIGH);
delay(100);
digitalWrite(eL7, LOW);
delay(50);
digitalWrite(eL8, LOW);
delay(50);
digitalWrite(eL9, LOW);
delay(50);
digitalWrite(eL10, LOW);
delay(50);Serial.print(sensorInput); // tell the console what you're seeing
Serial.print("\t");
}// alternating mode
if(sensorInput >=512){
int i;for(i = 0; i < numEvens; i++){
digitalWrite(evens[i], HIGH);
}delay(1000);
for (i = numEvens - 1; i >= 0; i–){
digitalWrite(evens[i], LOW);
}for(i = 0; i < numOdds; i++){
digitalWrite(odds[i], HIGH);
}delay(1000);
for (i = numOdds - 1; i >= 0; i–){
digitalWrite(odds[i], LOW);
}
Serial.print(sensorInput);
Serial.print(“\t”);
}
}
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.