I have been working with my Arduino Mega ADK and a nice little TO92 temp sensor, the TSIC 301. (Datasheet here) I have been playing with a very basic sketch, all it is doing at the moment is looping around "read value and display on serial"

const int IN_PIN = 0; // analogue input pin
const int DELAY = 1000; // a constant value for the delay.
int value = 0; // declare and initialise the variable for the value

void setup()
{
  Serial.begin(9600); // setup serial connection
}

void loop()
{
  value = analogRead(IN_PIN); // read the value of the sensor
  Serial.println(value); // display it in the serial monitor
  delay(DELAY); // wait 1 second then start the loop again although this can be altered easily
}

I am using this as the basis for a couple of ideas, one is to indicate high and low temperatures via LED display, maybe a "traffic light" systems that has different LEDs lit at certain temps or maybe a RGB LED would be best?(Suggestions please) Another idea is to tie this up with a stepper motor and use this sort of sketch to open and close a window in a greenhouse or similar.(All these ideas are being used as "proofs of concept" or should that be "proofs of concepts"?

I have been able to see the output value change from 78 in a normal run to 60 with an air duster blowing on it to 85 with a good  old fashioned "huff".I do not have a thermometer here to test the values, I will see if I can get hold of one to check.Apparently this can measure from -50C to +150C, (-58 to 302 to you Fahrenheit lovers :-) )

 

TO92 TSIC301 Temp Sensor_bb.png

The sensor in this Fritzing image is the correct form, TO-92, with the correct polarity with 1 being gnd, 3 being 3.0V to 5.5V and 2 being the actual sensor output.I am going to be using this sketch as the basis for a function, it is nice and small and won't take up a lot of memory.(4134 bytes)