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, April 26, 2012

Reema + Jill: Arduino Research & Sensors

After our last critique, we decided to go in a completely new direction. Although our bike idea was compelling, it would be too complicated to execute. Our new idea is a cup holder (similar to a coffee sleeve) that tells the user when their beverage is at the perfect temperature.

World: Someone has a hot beverage and doesn't know when it has cooled down enough. They don't want it to be too cold either, so finding the ideal temperature is very important.
Input: Person touching/holding the cup. The heat of the beverage.
Sensor: A capacitive touch sensor senses when the cup is being held or touched. An analog temperature sensor is measuring the heat of the beverage.
Brain: The brain must interpret the temperature as being to hot, just right, or too cold. It also must pick up on the cup holder being touched and be able to tell the actuators how to react.
Actuator: Depending on the temperature, an LED lights up (red for too hot, green for just right, and blue for too cold) and a speaker plays one of three audio samples (with lyrics relating to the temperature of the beverage).
Output: The person can drink their beverage at the perfect temperature!

After browsing the internet, we tried to make our own capacitive touch sensor using an aluminum can:























/*

This code turns the LED on while the sensor is in contact
with a conductive material (e.g. when someone touches it
with their bare skin/fingers)

Setup:
Attach a high value resistor (1-10M Ohm) between an output
pin 4 and input pin 5. Also connect a short bare copper or
aluminum wire/foil to the input pin5. Connect an LED to
output pin13 and GND.

By: Naureen Mahmood.

*/

#define LED        13
#define THRESHOLD   5

int capI;      // interval when sensor pin 5 returns LOW

void setup()
{
  Serial.begin(9600);
  pinMode(LED, OUTPUT);
  pinMode(4, OUTPUT);     // output pin
  pinMode(5, INPUT);      // input pin
}

void loop()
{
  capI = 0;      // clear out capacitance measure at each loop

  // transition output pin4 LOW-to-HIGH  to 'activate' sensor pin5
  digitalWrite(4, HIGH);     

  // On activation, value of pin 5 stays LOW for a time interval T = R*C.
  // C is big if the sensor is touched with a conductive object.
  // Increment capI for the interval while pin5 is LOW
  int val = digitalRead(5);  // read the input to be checked
  while (val != HIGH){   
    capI++;   
    val = digitalRead(5);    // re-read the input to be checked
  }
  delay(1);
  // transition output pin4 HIGH-to-LOW to 'deactivate' sensor pin5
  digitalWrite(4, LOW);     
  Serial.println(capI, DEC);  // print out interval

  if (capI > THRESHOLD)       // Turn LED on if capI is above threshold
    digitalWrite(LED, HIGH);
  else 
    digitalWrite(LED,  LOW);
}

No comments:

Post a Comment