Monday, April 02, 2007

Final project idea - Affection

Taking care of plant is very difficult. If the person doesn 't take care of the plant, it will die because of the lack of water or sunshine. If the person takes too much care of the plant, such as giving too much water or over extended exposure to sunlight, it will die too. The plant needs proper level of affection to ensure vivid growth and ability to bloom. It is the same in the relationship between people or any life. There should be a certain distance to keep good relationship all the time.

This projects "Affection" is about the relationship between people and plants which also implies the right amount of affection for all relationship. If the user is far away from flowers, the lightings of the flowers will appear to be deem and will produce a dull sound. If the user gets close to the flowers, they will appear to be more bright, and will trigger a fast tempo music. However, if the user moves too much close the flower, it will blink the lights and will produce a high tempo sound; eventually the flowers will suddenly be turned off.

The light and sound are the metaphor of the plant 's life. So, the user will recognize the flowers becoming more alive, based on the brightness of the lights and speed and pitch of the sound. The physical distance will be used to define the affection level because the proper amount of attention is needed for a happy and healthy life. The project will be installed on top of the mirror with several flower shapes of fiber optic. It will be attached a distance sensor to detect the distance between the user and flowers.

Final project idea - center of the universe

When people look at stars on the sky, they are often impressed of how infinite night sky is. They begin to feel like they are the center in the universe. In eastern culture, there are some theories that the life forces of humans create movement in universe. So, if humans are the center point of the universe, then the universe can be moved by the free will of human.
This project will be creating an infinite night sky with lots of star to make people the center of the world, rather the center of the universe. This project will give people the feeling of importance of their identity. To create this universe, small lights, using LED or fiber optic, will be attached on mirrors inside of box. People ' s head will be placed in the box surrounded by hanging lightings

Wedding Cake arduino code for switches, dc motor and mp3 player


int wedCurrentState = 0;
int rightSwitch = 2;//switch that controlls the direction of the servo
int wrongSwitch = 3;
int rightSwitchState = 0;//variable for the switch state
int wrongSwitchState = 0;//variable for the switch state

int servoPin1 = 4; // signal pin for servo motor
int servoPin2 = 5; // signal pin for servo motor
int minPulse =500; // Minimum servo position
int maxPulse = 2500; // Maximum servo position
int pulse = 0; // var for the pulse
int speed1 = 10;//sets the speed of the servo range 0 - 5
int speed2 = 10;//sets the speed of the servo range 0 - 5

long lastPulse = 0; // the time in milliseconds of the last pulse
int refreshTime = 20; // the time needed in between pulses

int dcMotor = 6;

int firstMp3Play = 7;
int firstMp3Forward = 8;
int firstMp3PlayCounter = 0;
int secondMp3PlayCounter = 0;
int thirdMp3PlayCounter = 0;
int fourthMp3PlayCounter = 0;

int firstLayerLEDs = 9;
int secondLayerLEDs = 10;
int thirdLayerLEDs = 11;

//int loveLEDs = 12;
int resetSwitch = 13;
int resetSwitchState = 0;//variable for the switch state

int micDigital = 12; //analogue input
//int microPhone = 1; //analogue input
//int AmpVar = 0;
int micVal = 0;
//int THRESHOLD = 400;
int micCounter = 0;

void setup() {
pinMode(rightSwitch, INPUT);//initialize the switchPin as an INPUT
pinMode(wrongSwitch, INPUT);
pinMode(servoPin1, OUTPUT); // initialize the servo signal pin as an OUTPUT
pinMode(servoPin2, OUTPUT); // initialize the servo signal pin as an OUTPUT
pulse =maxPulse; // Set the motor position value to the minimum

pinMode(dcMotor, OUTPUT);

pinMode(firstMp3Play, OUTPUT);
pinMode(firstMp3Forward, OUTPUT);

pinMode(firstLayerLEDs, OUTPUT);
pinMode(secondLayerLEDs, OUTPUT);
pinMode(thirdLayerLEDs, OUTPUT);

//pinMode(loveLEDs, OUTPUT);
pinMode(micDigital, INPUT);
pinMode(resetSwitch, INPUT);

Serial.begin(9600);//initialize the serial

digitalWrite(firstMp3Play,HIGH);
delay (3000);
digitalWrite(firstMp3Play, LOW);
delay (500);
Serial.println("firstMp3Play was pressed onece - turn on");
}

void loop() {

wrongSwitchState = digitalRead(wrongSwitch);//read the state of the switch
switch (wrongSwitchState){
case 1:
firstMp3PlayCounter = firstMp3PlayCounter+1;
if (firstMp3PlayCounter == 1){
digitalWrite(firstMp3Play,HIGH);
delay (500);
digitalWrite(firstMp3Play, LOW);
delay (5000);
Serial.println("firstMp3Play was pressed twice - play");
digitalWrite(firstMp3Play,HIGH);
delay (500);
digitalWrite(firstMp3Play, LOW);
//digitalWrite(loveLEDs, HIGH);
//delay (1000);
//digitalWrite(loveLEDs, LOW);
Serial.println("firstMp3Play was pressed third - stop");
}

break;
case 0:
firstMp3PlayCounter = 0;
break;
}

rightSwitchState = digitalRead(rightSwitch);//read the state of the switch
switch (rightSwitchState){
case 1:
if(pulse>minPulse){
pulse--;
delay(speed1); // 0-5 slow to fast
}
break;
case 0:
if(pulse 0) {
micCounter = micCounter+1;
}
//micRead();

/*if (micVal>=512){
AmpVar = micVal-512;
}
else {
AmpVar = 512-micVal;
}
micValue = AmpVar; // read the analog input

//Serial.println(AmpVar);
//Serial.println(micVal);

if (AmpVar > THRESHOLD) {
micCounter = micCounter+1;
}
*/


if (micCounter == HIGH){
digitalWrite(dcMotor, LOW);
thirdMp3PlayCounter = thirdMp3PlayCounter+1;
if (thirdMp3PlayCounter == 1){
digitalWrite(firstMp3Forward,HIGH);
delay (500);
digitalWrite(firstMp3Forward, LOW);
delay (500);
Serial.println("firstMp3Forward was pressed onece - mic change");
}
//digitalWrite(loveLEDs, HIGH);
digitalWrite(firstLayerLEDs, LOW);
digitalWrite(secondLayerLEDs,LOW);
digitalWrite(thirdLayerLEDs, LOW);
delay(500);
//digitalWrite(loveLEDs, LOW);
digitalWrite(firstLayerLEDs, HIGH);
digitalWrite(secondLayerLEDs, HIGH);
digitalWrite(thirdLayerLEDs, HIGH);
delay(500);
}

resetSwitchState = digitalRead(resetSwitch);//read the state of the switch

switch (resetSwitchState){
case 1:
Serial.println("resetSwitch on");
micCounter = 0;
firstMp3PlayCounter = 0;
secondMp3PlayCounter = 0;
thirdMp3PlayCounter = 0;
digitalWrite(firstLayerLEDs, LOW);
digitalWrite(secondLayerLEDs,LOW);
digitalWrite(thirdLayerLEDs, LOW);
//digitalWrite(loveLEDs, LOW);
digitalWrite(dcMotor, LOW);
fourthMp3PlayCounter = fourthMp3PlayCounter+1;
if (fourthMp3PlayCounter == 1){
digitalWrite(firstMp3Forward,HIGH);
delay (500);
digitalWrite(firstMp3Forward, LOW);
delay (1000);
Serial.println("firstMp3Forward was pressed onece - change");
digitalWrite(firstMp3Play,HIGH);
delay (500);
digitalWrite(firstMp3Play, LOW);
delay (1000);
Serial.println("firstMp3Play was pressed onece - stop");
}

break;
case 0:
fourthMp3PlayCounter = 0;
break;
}

}

void movetheServo(){
if (millis() - lastPulse >= refreshTime) {
digitalWrite(servoPin1, HIGH); // Turn the motor on
digitalWrite(servoPin2, HIGH); // Turn the motor on
delayMicroseconds(pulse); // Length of the pulse sets the motor position
digitalWrite(servoPin1, LOW); // Turn the motor off
digitalWrite(servoPin2, LOW); // Turn the motor off
lastPulse = millis(); // save the time of the last pulse
}
}

Wedding Cake arduino code for mic

int microPhone = 0; //analogue input
int AmpVar = 0;
int micCounter = 0;
int micCurrentState = 0;
int micPreviousState = 0;
int micVal = 0;
int THRESHOLD = 400;

int resultLEDs = 7;
int resultOutPin = 8;

void setup() {

pinMode(resultLEDs, OUTPUT);
Serial.begin(9600);//initialize the serial
}

void loop() {
micVal = analogRead(microPhone);

if (micVal>=512){
AmpVar = micVal-512;
}
else {
AmpVar = 512-micVal;
}
micVal = AmpVar; // read the analog input

Serial.println(AmpVar);

if (AmpVar > THRESHOLD) {
digitalWrite(resultLEDs, HIGH);
digitalWrite(resultOutPin, HIGH);
delay(1000);
digitalWrite(resultLEDs, LOW);
digitalWrite(resultOutPin, LOW);
delay(1000);
}
}

Wedding Cake proejct URL


how to make flowers with wax papers and LEDs




1. make star shape using 5 ultra white LEDs and make sure connect power and ground of LEDs in parallel.


2. connect to wires and test turning on lights


3. cut wax paper like petals of a flower


4. attach petals to LEDs and make shape like flower



Secret Tree project site


http://itp.nyu.edu/~jsl398/tree/