Thursday, October 23, 2008

int audioIn = 0;

int val = 0;

int ledPin1 = 0; // green

int ledPin2 = 2;// blue

int ledPin3 = 4; // yellowint

ledPin4 = 6; // triangle a redint

ledPin5 = 8; // triangle blue

int ledPin6 = 10; // border a

int ledPin7 = 12; //border z
void setup() {

pinMode(ledPin1, OUTPUT);

pinMode(ledPin2, OUTPUT);

pinMode(ledPin3, OUTPUT);

pinMode(ledPin4, OUTPUT);

pinMode(ledPin5, OUTPUT);

pinMode(ledPin6, OUTPUT);

pinMode(ledPin7, OUTPUT);

Serial.begin(9600);

}


void loop() {

val = analogRead(audioIn);

Serial.println(val);

//border a

if (val <=400){

digitalWrite(ledPin6, LOW);
}

else{digitalWrite(ledPin6, HIGH);
}

//border z

if (val <=400){

digitalWrite(ledPin7, LOW);
}

else{

digitalWrite(ledPin7, HIGH);
}

//yellow

if (val >400 && val <=450)

{

digitalWrite(ledPin3, LOW);
}

else{

digitalWrite(ledPin3, HIGH);
}

//blue

if (val >450 && val <=500){

digitalWrite(ledPin2, LOW);
}

else{digitalWrite(ledPin2, HIGH);
}

//green

if (val <>

digitalWrite(ledPin1, LOW);
}

else{digitalWrite(ledPin1, HIGH);
}

// 5 red triangle ,blu tri

if (val >440 && val <=470){

digitalWrite(ledPin4, LOW);

digitalWrite(ledPin5, LOW);
}else{

digitalWrite(ledPin4, HIGH);

digitalWrite(ledPin5, HIGH);}
}

}

last and final code

int audioIn = 0;int val = 0;int ledPin1 = 0; // green int ledPin2 = 2;// blue int ledPin3 = 4; // yellowint ledPin4 = 6; // triangle a redint ledPin5 = 8; // triangle blue int ledPin6 = 10; // border aint ledPin7 = 12; //border z
void setup() {pinMode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);pinMode(ledPin3, OUTPUT);pinMode(ledPin4, OUTPUT);pinMode(ledPin5, OUTPUT);pinMode(ledPin6, OUTPUT);pinMode(ledPin7, OUTPUT);Serial.begin(9600);}
void loop() {val = analogRead(audioIn);Serial.println(val);

//border aif (val <=400){digitalWrite(ledPin6, LOW);
}else{digitalWrite(ledPin6, HIGH);
}//border zif (val <=400){digitalWrite(ledPin7, LOW);
}else{digitalWrite(ledPin7, HIGH);
}//yellowif (val >400 && val <=450){digitalWrite(ledPin3, LOW);
}else{digitalWrite(ledPin3, HIGH);
}//blue if (val >450 && val <=500){digitalWrite(ledPin2, LOW);
}else{digitalWrite(ledPin2, HIGH);
}//greenif (val < 300){digitalWrite(ledPin1, LOW);
}else{digitalWrite(ledPin1, HIGH);
}// 5 red triangle ,blu triif (val >440 && val <=470){digitalWrite(ledPin4, LOW);digitalWrite(ledPin5, LOW);
}else{digitalWrite(ledPin4, HIGH);digitalWrite(ledPin5, HIGH);}
}

the new code !! the final one

int audioIn = 0;int val = 0;int ledPin1 = 0;int ledPin2 = 2;int ledPin3 = 6;int ledPin4 = 4;int ledPin5 = 8;int ledPin6 = 10;int ledPin7 = 11;
void setup() {pinMode(ledPin1, OUTPUT);pinMode(ledPin2, OUTPUT);pinMode(ledPin3, OUTPUT);pinMode(ledPin4, OUTPUT);pinMode(ledPin5, OUTPUT);pinMode(ledPin6, OUTPUT);pinMode(ledPin7, OUTPUT);Serial.begin(9600);}
void loop() {val = analogRead(audioIn);Serial.println(val);

//1 yellowif (val >600 && val <=750){digitalWrite(ledPin5, LOW);
}else{digitalWrite(ledPin5, HIGH);
}
//2 blue pattern if (val >500 && val <=550){digitalWrite(ledPin6, LOW);
}else{digitalWrite(ledPin6, HIGH);
}//3 green triangle if (val >550 && val <=600){digitalWrite(ledPin7, LOW);
}else{digitalWrite(ledPin7, HIGH);
}//4 blue traingle if (val >600 && val <=650){digitalWrite(ledPin4, LOW);
}else{digitalWrite(ledPin4, HIGH);
}// 5 red triangle if (val >600 && val <=700){digitalWrite(ledPin3, LOW);
}else{digitalWrite(ledPin3, HIGH);
}
// 6 yellow border near a if (val <=500){digitalWrite(ledPin2, LOW);
}else{digitalWrite(ledPin2, HIGH);
}
// 7 yellow border near z if (val <=500){digitalWrite(ledPin1, LOW);
}else{digitalWrite(ledPin1, HIGH);
}


}

Idea/ inspiration

Our group decided to work with light and sound and we came up with a number of ideas before finally landing at this . The associations we made with sound and light were that of celebration and festivity. Taking inspiration from the oncoming festival of Diwali (the festival of lights and sound)we came up with 'Timtim'.

Timtim ki harkatein! (what, where, how)

What does it do?
People make 'rangolis' outside their house during Diwali (lasting 5 days) and they often tire of maintaining and looking at the same thing over and over again! 'Timtim' is a dynamic and easy to maintain rangoli(pattern) that reacts to sound and keeps the spirit of festivity alive!

Where does it live?
During Diwali 'Rangolis' are generally placed on the floor outside ones house and that's where Timtim lives. Timtim can be used even after Diwali and can be placed on ceilings or walls.

How does it work?
Timtim reacts to sound and the leds light up proportional to it. It uses a microphone sensor to catch the sound. Various pre defined patterns light up at different frequencies according to the sound produced!

Process

What the new circuit looks like

Pattern time

Sunday, October 19, 2008

rangoli pattern


here is one option- its quite flexible...

Thursday, October 16, 2008

This is the new code using two led's
its finally working!!


int audioIn = 0;
int val = 0;
int ledPin1 = 2;
int ledpin2 = 6;

void setup() {
pinMode(ledPin1, OUTPUT);
Serial.begin(9600);
}

void loop() {
val = analogRead(audioIn);
Serial.println(val);
if (val <=370){
digitalWrite(ledPin1, LOW);
}else{
digitalWrite(ledPin1, HIGH);

}
if (val >=300 && val <=360){
digitalWrite (ledpin2, LOW);
}else{
if(val >=360){
digitalWrite (ledpin2, HIGH);
}

}


}

prototype

Wednesday, October 15, 2008

new idea!- LED rangoli


Earlier we had an idea about making a product for the festival of Diwali since it is the festival of lights and a time for celebration. After brainstorming, we came up with the idea of an LED based rangoli. We thought that often times ragolis made during Diwali get ruined before the end of the festival or people tire of looking at the same patterns.
The LED rangoli comes with a few pre fixed patterns and they light up according of the frequency of sound produced (fire crackers, music, bhajans etc..)
After Diwali it could be put on the wall, ceiling etc.

feedback on previous ideas

The feedback we got on the previous ideas was that light and sound are something that are associated with celebration and using it to control noise created by traffic made the idea weak. We thought of it as a group and agreed that the ideas (noise related) seemed rather forced.

Monday, October 13, 2008

Thursday, September 25, 2008

refined...

Problem

The mic works fine with the code till the led is added- when the led is added the mic stops functioning properly.

Code

code taken from: http://forum.sparkfun.com/viewtopic.php?t=11430&highlight=sound
modified with Anders's help


int audioIn = 0;
int val = 0;
int ledPin1 = 2;

void setup() {
pinMode(ledPin1, OUTPUT);
Serial.begin(9600);
}

void loop() {
val = analogRead(audioIn);
Serial.println(val);
if (val <=600){
digitalWrite(ledPin1, HIGH);
}
else{

digitalWrite(ledPin1, LOW);

}
}

work in progress





the led still doesn't work in sync with the mic

datasheet of electret microphone

Taken from the Spark Fun Electronics website:
http://focus.ti.com/lit/ds/symlink/opa344.pdf

schematic diagram

Project Description

Where does the product live?
This product is on the side of a busy road.

What does it do?
It reflects the noise level on the road and stops people from honking aimlessly. Drivers can see the product and judge the decibel levels produced by them collectively.

How does it work?
Sound captured by a mic acts as an input and lights up the led within the product (output). The sound is proportional to the number of lights that shine- the higher the sound, the more the lights shine.

(the form and the material of the product is still being thought of)