1EAS1:
Here's something I found that you might be interested in:
//TEMP in deg C ~ /10000
//The sensor isn't very accurate - the data sheet says ±10°C. But once you've worked out the offset and correct for it, accuracy improves
//This sensor is pretty useless unless you calibrate it against a known temperature.
//The sensor outputs in approximately 1°C steps.
long readTemp() {
long result;
// Read temperature sensor against 1.1V reference
ADMUX = _BV(REFS1) | _BV(REFS0) | _BV(MUX3);
delay(2); // Wait for Vref to settle
ADCSRA |= _BV(ADSC); // Convert
while (bit_is_set(ADCSRA,ADSC));
result = ADCL;
result |= ADCH<<8;
result = (result - 125) * 1075;
return result;
}
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println( readTemp(), DEC );
delay(1000);
}
I just ran the code last night and it gave me an avg temp (on the arduino board) of 26 C ~ 78.8 F. I'm going to compare the arduino value to another digital thermometer (infared? I think) for accuracy as soon as I can find it. You may not have much use for this because it measures the temp of the board, but you never know when it might be useful.