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.

Tuesday, June 9, 2015

Final Idea Drawing // Stephen and Cami (Post #4)




The above image was our final drawing for the sound detecting lamp. We plan on hiding everything inside the lamp shade, since the textured shade does not show what is behind it.

In our final design, a phone alarm goes off, and a microphone reads the sound. Once the volume threshold is met, the light fades on. A mosfet is going to be used to control the voltage that the light gets, and an outside power source will power the light.

When we started working on this, the first code we used was a simple one to measure sound and turn on an LED. We got a lot of help from this website: http://www.learningaboutelectronics.com/Articles/Sound-detector-circuit.php

Here is an image of this preliminary circuit:

The "sound detector unit" refers to the microphone we used. 




//these define the pin connections
const int microphonePin= 0; //the microphone positive terminal will connect to analog pin A0 to be read
const int ledPin=13; //the code will flash the LED connected to pin 13

int sample; //the variable that will hold the value read from the microphone each time

const int threshold= 800;//the microphone threshold sound level at which the LED will turn on

void setup() {
pinMode (ledPin, OUTPUT);//sets digital pin 13 as output
Serial.begin(9600); //sets the baud rate at 9600 so we can check the values the microphone is obtaining on the Serial Monitor
}

void loop(){
sample= analogRead(microphonePin); //the arduino takes continuous readings from the microphone
if (sample > threshold)
{
digitalWrite (ledPin, HIGH); //if the reading is greater than the threshold value, LED turns on
delay (500); //LED stays on for a half a second
digitalWrite (ledPin, LOW); //LED turns off
}
else{ digitalWrite(ledPin, LOW); }
}

No comments:

Post a Comment