Temperature reading from LM335A not making sense.

Hi there,

My current setup is based on http://www.oomlout.com/a/products/ardx/circ-10; the temperature reading is way off, i'm getting a reading of 365.04 degrees centigrade... :o

i'm very new at this, can anyone advise me? thanks alot in advance!

Well we know what you thought you did and that works. What we have to find out is what you actually did. I know you are going to say you did this but you wouldn't be the first to make a mistake in thinking that, it happens to us all.

So what you have to do is to do some experiments to see if everything is as it should be.
First off write a sketch that just constantly prints out the number read from the analogue input port.
Does it change when you hold the sensor between your fingers? Are the readings by an large steady?

thanks for the quick reply! so now i have stripped down the codes to a bare minimum:

//LM335A Pin Variables
int temperaturePin = 0; 

/*
 * setup() - this function runs once when you turn your Arduino on
 * We initialize the serial connection with the computer
 */
void setup()
{
  Serial.begin(115200);  //Start the serial connection with the copmuter
                       //to view the result open the serial monitor 
                       //last button beneath the file bar (looks like a box with an antenae)
}
 
void loop()                     // run over and over again
{
 float temperature = analogRead(temperaturePin);
 Serial.println(temperature);                     //printing the result
 delay(1000);                                     //waiting a second
}

with this set of code, it is now reading a constant value of 850.0.
when i hold the sensor, it only goes up by +1/2, i.e. 851.0-852.0

That would seem to suggest that the sensor is not wired up correctly. I would have expected to see it move by about 10.
Check again that you have identified the pins correctly and that the power and ground as well as the signal make it back to the arduino.

i just tried to re-wire it, and place it on a different location on the breadboard, but the reading is still constant, with little fluctuation when i squeeze it...

could it be because i'm in a cold place?

could it be because i'm in a cold place?

No your body heat should take the temperature of the sensor up by 5 to 10 degrees in a few seconds. As you are not getting this I suspect you might have miss identified the pin out of the sensor. Check the data sheet and if possible post a picture of what you have made so we can see the wiring. The other alternative is that you have a faulty sensor.

i emailed the vendor providing the schematics, apparently the setup given was not correct... waiting for them to get back to me on it...

thanks for the help! will update once i have further news.

Here is a link to the datasheet.

http://www.national.com/ds/LM/LM135.pdf

I had the same. Please note that the Datasheet has a bottom view for the TO-92 or TO-46 package. Most likely you switched the GND and +. In my case the package got extremely hot but was still working after I switched to the right wiring.