Excessively high temperature reading with LM35

4.15V from Vout to GND with short wires and 5V supply is totally wrong. Either you have the connections wrong or the LM35 is toast. Please double-check the connection vs. the datasheet.

I suspect just because of that particular voltage reading that you may have the connections mixed up.

Edit: Thanks for the photo. Looking at the part from the front (the part with the markings) from left to right, the pin order is:

enter image description here

Vs, Vout, GND = +5, Vout, GND

In your photo I see +5, Vout, GND as it should be. So it it's reading more than 10mV/°C at Vout with the blue wire disconnected from the Arduino (and 5V/0V on the orange and black wires respectively) I would say it's dead. Perhaps the power got momentarily reversed on it?


You say you "measure 0.5V between 5V input and the output". If you mean it exactly as you say it: There's something wrong with your sensor or your setup, because then the output is 4.5V from ground, which is 450degrees Centigrade, which would indeed mean the sensor is very close to smoking, regardless of the fact it doesn't work at all any more at that point.

If you mean you are measuring 0.5V at the output relative to ground, that would be about 50 degrees Centigrade, which is possible if you've been soldering recently or have intentionally heated it up.

Then we come to the math: This seems acceptable to me, assuming Arduino measures in 10bit accuracy mode. I think that's safe to assume. I am not knowledgeable about Arduino, but the Atmels inside do support 8bit and 10bit mode. As to 16bit int and/or float issues I defer to someone who knows more about the Arduino standards.

It is programatically/semantically advisable to not use "inputvoltage" to store the result, as it is not the inputvoltage. This will cause confusion if you start building this test out into something more serious and eventually forget to change it, because it now suddenly is fully integrated into all of your coding.