Making Furniture Interactive

September 11, 2007

Kipum Lee’s Exercise 2:

Filed under: Exercise 2: Add a Switch,Kipum Lee — Kip @ 10:08 pm

Candle | LED Switch
How the candle switch works:
As the candle’s wax burns, the paper clip, connected to ground, sinks lower and lower, finally touching the base of the candle (aluminum) which connects to to the other candle, turning the LED on the other candle. This is one way to compare the two types of “lights” as well as having a feedback mechanism, letting someone know when all the wax has been burned.

Photosensing LED:

Photosensing LED’s with a quick fade in/out:

Code was modified from an arduino tutorial with the help of fellow classmate, Jamin Hegeman:
/*
* AnalogInput
* by DojoDave
*
* Turns on and off a light emitting diode(LED) connected to digital
* pin 13. The amount of time the LED will be on and off depends on
* the value obtained by analogRead(). In the easiest case we connect
* a potentiometer to analog pin 2.
*
* http://www.arduino.cc/en/Tutorial/AnalogInput
*/

int potPin = 2; // select the input pin for the potentiometer
int ledPin = 9; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
int value = 0; //variable to keep the actual value
int state = 0; //state variable. 0 = off.

void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
Serial.begin(9600);
}

void loop() {
val = analogRead(potPin); // read the value from the sensor
if(val < 90 && state == 0) { //turns on LED when light is off. change to make it turn on with light

//digitalWrite(ledPin, HIGH); // turn the ledPin on
for(value = 0 ; value = 100 && state == 1) {
//digitalWrite(ledPin, LOW); // turn the ledPin off
for(value = 255; value >=0; value-=10) // fade out (from max to min)
{
analogWrite(ledPin, value);
delay(5);
}
state = 0;
}
//delay(val); // stop the program for some time
Serial.println(val);
}

Advertisements

big steamy pile of failure

Filed under: Exercise 2: Add a Switch,Jenn Gooch — jenngooch @ 6:47 pm

Um, yeah. So I wanted to add a simple “The Clapper” style switch to my lamp, which would turn on and off with a loud sound, like a clap. I was going to throw in a Piezo Film Vibra Tab, which I’d used before, and be done – or at least concentrate on fine-tuning other parts of the code/lamp.

Turns out I don’t have a Piezo Film Vibra Tab, though I did (someone “borrowed” it). A friend, Gregory Witt, suggested I make my own with a speaker (preferably a mic, but I only had speakers) and an op-amp as a comparator. I wasn’t able to drop the voltage down enough to compare what little voltage the speaker was kicking out upon clapping, so I then hooked it up through the amplifier side of the op amp and used the comparator on the amplified signal. At this point the schematic Greg developed for the op-amp looked like this:

op amp schematic

I was getting so much noise, but still not picking up a clap. Tried putting in a few capacitors. Still so noisy that it would have taken forever trying to find out where the noise was coming from, what kind of noise it was, and how to fix it.

op amp

In the end I ended up with countless hours, which I won’t call wasted, but they definitely were not productive in that I didn’t end up with a product other than frustration.

So I did what anyone would do in my situation – I gave up. I slapped a non-creative switch on it just to show I could. It already had a photoresistor. And it’s still sticky.

switch

Thanks to Greg who always cringes when I come in his studio because it means I probably need to bum a resistor or ask him annoying questions in my attempt to bolster my astounding ineptitude with all this.

Assignment 2 | Synth Scream

Filed under: Exercise 2: Add a Switch,Matt Thompson — Mattt @ 6:21 pm

Unconstrained to the cyclical musings of his former self, He moves now with the pulse of the earth.

Seriosuly, though, it’s 3 LEDs with a buzzer in parallel off of a PWM pin on an Arduino. The Arduino is communicating serially with a Processing application that detects the live input volume of a microphone.

Go to the project page.

(More documentation to come–I’m out the door as I post this right now x_x)

destress sock

Filed under: Exercise 2: Add a Switch — deskenaz @ 5:28 pm

I thought it would be interesting to use simple home materials to create an object that would help you destress when coming home. Like a stress ball, I designed a sock that can be squeezed to let out your day’s frustrations. A blinking light is constantly on, so you keep squeezing the sock until the light just stays on and provides some nice light. If you let go, the light goes back to annoying blinking.

img_3643.jpgaluminum foil, sponge. simple.

img_3646.jpgthe ugly innards: foil, sponge, cotton balls, sticky tack.

img_3647.jpgthe final setup. laptop => arduino => sock . the light is blinking annoyingly

img_3651.jpgstress free!  I have ended the blink and kept the light on!

Using home materials wasn’t as nice as I had hoped. I had trouble working the code correctly also, I had originally wanted to be able to very slow turn the light off by squeezing, but wasn’t sure how to just dim the light and then keep it off until I let go. I’d like to try to use a pressure switch to detect how hard I am pressing, maybe that would work well.

Dan D.W. Kang Assignment Two: Part Two- Flood Warning System

Filed under: Dong Woo Kang,Exercise 2: Add a Switch — dwkang @ 3:55 pm

Part Two:

* Description:

For the second part of the assignment, I designed a “flood warning system.” This system will detect the amount of the rainfall and send out a warning signal if the water level gets too high. This system actually uses “water” to switch on the warning system. The signals only use the red LEDs to effectively deliver the message of “warning.” Three small LEDs will blink each time consecutively, then the large LED in the center will flicker. You can watch the video clip to see how it works.

http://www.youtube.com/watch?v=z__2tJGuz4k

dscn0562.jpg

dscn0568.jpg

dscn0570.jpg

 * Code:

The four different blinking LEDs use simple blink programming code. “Delay” value is 300 for the small LEDs and 80 for the big LED. The blink programming for the big LED is duplicated 8 times to create a flickering effect.

  

int LED1 = 13;                // LED connected to digital pin 13

int LED2 = 12;              //LED connected to digital pin 12

int LED3 = 11;               //LED connected to digital pin 11

int BIGLED = 10;               //LED connected to digital pin 10

void setup()                    // run once, when the sketch starts

{

  pinMode(LED1, OUTPUT);      // sets the digital pin as output

  pinMode(LED2, OUTPUT);    // sets the digital pin as output

  pinMode(LED3, OUTPUT);

  pinMode(BIGLED, OUTPUT);

}

void loop()                     // run over and over again

{

  {

  digitalWrite(LED1, HIGH);   // sets the LED on

  delay(300);                  // waits for a second

  digitalWrite(LED1, LOW);    // sets the LED off

  delay(300);                  // waits for a second

  }

  {

  digitalWrite(LED2, HIGH);   // sets the LED on

  delay(300);                  // waits for a second

  digitalWrite(LED2, LOW);    // sets the LED off

  delay(300);                  // waits for a second

  }

  {

  digitalWrite(LED3, HIGH);   // sets the LED on

  delay(300);                  // waits for a second

  digitalWrite(LED3, LOW);    // sets the LED off

  delay(300);                  // waits for a second

  }

  {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(80);                  // waits for a second

  }

    {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(80);                  // waits for a second

  }

    {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(80);                  // waits for a second

  }

    {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(80);                  // waits for a second

  }

    {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(80);                  // waits for a second

  }

    {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(80);                  // waits for a second

  }

    {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(80);                  // waits for a second

  }

    {

  digitalWrite(BIGLED, HIGH);   // sets the LED on

  delay(80);                  // waits for a second

  digitalWrite(BIGLED, LOW);    // sets the LED off

  delay(300);                  // waits for a second

  }

}

   

[Dan D.W. Kang] Assignment Two: Part One

Filed under: Dong Woo Kang,Exercise 2: Add a Switch — dwkang @ 3:45 pm

Part One:

 * Description:

For the first part of this assignment, I created a system that detects an approaching object and responds by turning on three different colors of LED; red, blue and green. The green LED is on when there is nothing in front of the sensor. As an object starts approaching towards the sensor, the green LED will switch off and the blue LED will switch on instantly. The blue LED will remain switched on for a while until the object gets very close to the sensor. This time, the blue LED will switch off and then you will see the light from the red LED. You can watch the video below to see how it works.

http://www.youtube.com/watch?v=R_gPTxlqml0

* Configuration:

The three wires from the sensor are connected to Analog pin0, Power GND, and 5V on Arduino board. Three LEDs are laid out almost exactly the same as the first assignment (Assignment Zero); the shorter leg (-) of each LED is placed on the same row and is connected to GND pin on Arduino board. The longer leg (+) of the red LED is connected to pin 11 on Arduino board, the blue LED to pin 10, and the green LED to pin 9. Each LED uses a resistor to prevent the burn-out.

 dscn0587.jpg  dscn0588.jpg  

 dscn0589.jpg

 

 

 dscn0581.jpg  dscn0579.jpg dscn0584.jpg   * Code:

To have each LED respond at the different distances, analogValue of less than 200 (the object is farther) was assigned for the green LED to switch on. If the analogValue gets higher than 200 (which means the object is closer), “digitalWrite(green, LOW)” is programmed. Same goes for the blue and red LEDs, with different number of analogValue assigned to each one, depending on the distance of the object to the sensor. Serial.begin(9600) / Serialprint (“Raw Sensor value: “) also had to be included to have my laptop read the values from the sensor.

int analogValue0 = 0;

 

int analogPin0 = 0;

  

int red = 11;

int blue = 10;

int green = 9;

  

void setup() {

  pinMode(analogPin0, INPUT);

  pinMode(red,OUTPUT);

  pinMode(blue,OUTPUT);

  pinMode(green,OUTPUT);

    Serial.begin(9600); // Set up the serial communication.

}

void loop() {

  analogValue0 = analogRead(analogPin0);

  Serial.print(“Raw Sensor value: “);

  Serial.println(analogValue0);

 

  if (analogValue0 < 200) {

    digitalWrite(green, HIGH);

  }

  if (analogValue0 > 200) {

    digitalWrite(green, LOW);

  } 

 

  if (analogValue0 > 200) {

    digitalWrite(blue, HIGH);

  }

  if (analogValue0 < 200) {

    digitalWrite(blue, LOW);

  }

  if (analogValue0 > 500) {

    digitalWrite(blue, LOW);

  }

   

  if (analogValue0 > 500) {

    digitalWrite(red, HIGH);

  }

    if (analogValue0 < 500) {

    digitalWrite(red, LOW);

  }

}

key lamp

Filed under: Exercise 2: Add a Switch,Marc Manzke,Uncategorized — marcmanzke @ 1:41 am

I’m constantly worried about leaving important personal items (keys, wallet, phone, etc.) where they shouldn’t be. Since leaving my wallet on the 28X Airport Flyer last year, I’ve made a conscious effort to know where my belongings are at all times. I’ve noticed recently that i’m prone to leaving my keys in the door of my apartment. Key lamp uses a homemade switch consisting of two aluminum plates, and a block of cherry wood to provide a handy key storage / warning device. When keys are inserted into the block, the keys themselves complete the circuit and dual 3000 mcd LEDs light in recognition of the presence of keys. The next step in this system would be to wire it into the deadbolt of my appt so when i leave the keys in the door the annoying flashing would remind me to take them out from inside the apartment.
key lamp components
Warning flash

I intended to code 3 states into my lamp. The default being off but still monitoring the switch for the presence of keys. the second is warning mode wherein the lamp would flash annoyingly in order to remind me to take my keys out. The final state would be to remain at full brightness to provide light for navigation. Because i get home from studio after midnight on a regular basis, i often run into things in the darkness of my apartment. The third state would provide minimal light until i can turn on appropriate lights. I have only managed to code the first two states, but the third is on its way.

September 10, 2007

Candle Lamp and Switch of Frustration

Filed under: Exercise 2: Add a Switch,Ronit Slyper — Ronit @ 11:18 pm

Candle Lamp

I built a lamp that acted as a candle – you blow on it and it goes out; you blow on it again and it goes back on (don’t all candles do that? 🙂 ). Steps:

1. Build the circuit using a microphone. The microphone wasn’t sensitive enough for what I wanted – to have the lamp respond to music – so I used a preamp circuit adapted from here. Still not sensitive enough, tired of going to RadioShack, so I went with a candle theme. (A piezo element had the same problem)

.circuitry1.jpgwiring.jpg

2. The code kept a running average of the mic’s output, looked for a change in voltage, and toggled the LED.

/* Candle
* by Ronit
*/

int ledPin = 13;      // led connected to control pin 13
byte val = 0;         // variable to store the value read from the sensor pin
int blowSensor = 2;
int window[100];
int avg;
int window_index;
int candle = 0;     // start out off

void setup() {
pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT
for (int i = 0, window_index = 0; i &lt; 100; i++)
window[i] = 0;
Serial.begin(9600);       // use the serial port
}

void loop() {
val = analogRead(blowSensor);    // read the sensor and store it in the variable "val"
-
if (val + 20 &lt; avg) {
if (candle==0) candle = 1; else candle = 0;
if (candle==0) digitalWrite(ledPin, LOW); else digitalWrite(ledPin, HIGH);
delay(1000);
}

if (candle==0)
digitalWrite(ledPin, LOW);
else
digitalWrite(ledPin, HIGH);

avg -= window[window_index];
window[window_index] = val;
avg += window[window_index];
Serial.println(val,DEC);
Serial.print("avg ");
Serial.println(avg, DEC);
delay(100);
}

3. House the candle.flame.jpgflame_lit.jpg

Switch of Frustration

Ever wish you could bang your head against the wall, a light would go off, and an idea would pop into your head? I accomplished the first two. An LED was connected from digital Pin 13 to ground with a break in the circuit taped to the wall. Conductive tape was unobtrusively placed on the forehead of the frustrated subject.switch_setup.jpgwall.jpgswitch_action_shot.jpg

unhealthy lamp

Filed under: Exercise 2: Add a Switch,Uncategorized — tomrgon @ 10:47 pm

i started to make this ashtray lamp by connecting the ground end from the digital to the metal napkin holder/encasement.  i then attached the positive from number 9 to the edge of an aluminum tea-candle case, suspended above the metal napkin case by the tension of the wire. photo-204.jpg When one ashes into the case, it becomes a bit heavier each time, photo-205.jpguntil, just before it is full, it is heavy enough to touch down and make contact with the napkin case, completing the circuit, lighting the leds, and letting you know you’d better empty it.photo-206.jpg

September 7, 2007

help sessions

Filed under: Class Updates,Exercise 2: Add a Switch — jbf1212 @ 12:34 pm

Help sessions will be in the codelab:

Sunday 4:30-5:30

Monday 4:30-5:30

-jared

« Previous PageNext Page »

Blog at WordPress.com.