As computing becomes more ubiquitous in our objects, designers need to be more aware of how to design meaningful interactions into electronically enhanced objects. At the University of Washington, a class of junior Interaction Design majors is exploring this question. These pages chronicle their efforts.

Thursday, May 17, 2012

Robin & Carly's progress of the shaming bathroom

So we have been experimenting with the different components to our project with speakers and laser sensors and timers.


Last week we were able to figure out how to process the light sensor to detect when the light was broken and then would turn on and off the LED light.  This was the first step to figuring out how to determine if someone was entering the bathroom.  We messed with the numbers and were able to figure out how to change them within the processing to change it depending on the lighting in each room.

void setup() {
pinMode(4, OUTPUT);
pinMode(13, OUTPUT);
}

void loop (){
digitalWrite(4, HIGH);
if(analogRead(0) < 500){
digitalWrite(13, HIGH);
} else{
digitalWrite(13, LOW);
}
}


After this we then experimented with the speaker in which we would be having connected to the arduino in order to make the shameful sound that will shame the unsanitary person who tries to run out of the bathroom without washing there hands. We have been able to connect the speaker to make it work out next step is to create the tune or have it speak. Here it is connected to the light sensor, so whenever the laser beam is broken the noise goes off.


Our next step was to create a beam that was timed after its beam had been broken. This would be in the case that someone exits the bathroom and instead of washing their hands walks through the exit breaking the laser beam which would activate the shame sound automatically. We had to change some of the numbers to be able to figure out timing and light sensitivity correctly but we got it to work!


long startTime;
long elapsedTime;

boolean start =false;

void setup() {
pinMode(4, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);

}

void loop() {
digitalWrite(4, HIGH);
digitalWrite(12, LOW);
if(analogRead(0) < 500) {
digitalWrite(13, HIGH);
if(!start) {
start = true;
}else{
elapsedTime = millis() - startTime;
if(elapsedTime < 3000) {
digitalWrite(12, HIGH);
start = false;
delay(100);

} else{
digitalWrite(12, LOW);
start = false;
delay(100);

}
startTime = 0;
elapsedTime = 0;
}
delay(100);
}else{
digitalWrite(13, LOW);
digitalWrite(12, LOW);
if(start){
startTime = millis();
delay(100);


}

}
}



Now we have to start putting things together as one and experimenting with the system as a whole and the problems I am sure we will run into.


No comments:

Post a Comment