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.

Friday, May 18, 2012

Reema & Jill: Coffee Cup Progress_thermistor

This week, we wanted to work on our coffee cup holder being able to read the temperature of the beverage inside the cup. This changed from our original idea (in which the temperature sensor was on the outside of the cup), to be more accurate with the sensor reading the actual liquid temperature. We hooked up our thermistor and wires to our arduino, and then placed it into the top of our beverage cup (without touching the drink). After altering some code we found online and on the arduino.cc website, we got the code to work and used the serial port to read the temperature. The room temperature was around 21 degrees Celsius and our hot cocoa was around 26 degrees Celsius when we tested it (which was cooled a bit from the original temperature). See our process images and code below.

 

code:


// File: ThermistorTemperature.pde


void setup() {

Serial.begin(9600); // open serial port and set data rate to 9600 bps

Serial.println("Thermistor temperature measurement:");

Serial.println("\n Vo Rt T (C)");

}

// -- loop() is repeated indefinitely

void loop() {

int ThermistorPin = 1; // Analog input pin for thermistor voltage

int Vo; // Integer value of voltage reading

float R = 9870.0; // Fixed resistance in the voltage divider

float logRt,Rt,T;

float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;

Vo = analogRead(ThermistorPin);

Rt = R*( 1023.0 / (float)Vo - 1.0 );

logRt = log(Rt);

T = ( 1.0 / (c1 + c2*logRt + c3*logRt*logRt*logRt ) ) - 273.15;

Serial.print(" "); Serial.print(Vo);

Serial.print(" "); Serial.print(Rt);

Serial.print(" "); Serial.println(T);

delay(200);

}



No comments:

Post a Comment