Jul 162011
 
Arduino and Temperature

I got some sensors from my favorite local electronics shop and one of them was a temperature sensor. Analog output, so I can use it for an XBee too.

I connected it to my FunnelIO board I bought some time ago, and about 10min later I had the room temperature printed on my screen. I really like Arduino boards:  while the CPU is very limited (1 KByte RAM, 14 kByte FLASH for user program), it gets simple things like this quickly done.

Here the loop of the test program:

  // read the value from the sensor:
  sensorValue = analogRead(sensorPin);
  Serial.print("A0=");
  Serial.print(sensorValue);
  Serial.print(" = ");
  //temperature=((sensorValue*3300.0/1024.0)-600.0)/10.0;
  //Serial.print(temperature);
  temperature=(sensorValue*322)-60000;
  Serial.print(temperature/1000);
  Serial.println(" Celsius");

The LM61 outputs 600mV at 0°C and 10mV for each degree more (or less) from -25°C up to +85°C.