OK, after going round and round in circles for the last few days, I'm not getting any closer to getting acceptable results out of this LM335 chip - see http://www.jaycar.com.au/products_uploaded/LM135.pdf for the datasheet. I'm getting SOME change in voltage at the sensor, but it's nowhere near the measured change in temperature.
For example, just sitting on the desk at 21.6 deg C, the sensor is passing 2.970 volts. Cranking up a small heater, the measured temp is 50.6 degrees and the voltage has increased to 3.210 volts, an increase of 240 millivolts. Since each 10mV represents 1 degree, the LM335 is measuring a 24 degree increase, as opposed to the actual 29 degrees. 5 degrees is a fairly big discrepancy but it's probably one that I can live with.
What's confusing me is trying to work out why, over the above temperature range, the analog pin readings only move from 590 to 626? My board's 5V output is actually 5.22V, hence there should be 5.22/1024=5.098 millivolts per ADC value, correct? So, 626-590 = 36, times by the step value of 5.098, gives 183.5 or so millivolts, nowhere near the 240mV I measured with the multimeter.
This is how I've got my sensor wired up:
------------+------<2K2 resistor>------<+5.22V>
|
|
<Analog pin 0>
I've searched everywhere I can think of for this LM335 interface, so if anyone has any ideas or can see where I've gone wrong, please let me know!
I'm not past trying something else either - initially I tried using some thermistors instead of the LM335, but I think that they may not be quite up to the task. If anyone can recommend exactly which type of thermistor I should be using that would also be appreciated...
Thanks for reading, again!!