I found code in the internet but i don't know how it exactly works i mean the part with dividing by 1024 and other math actions. And temeprature is way too high when using it.
I'm not sure why this happens, but if you are running other hardware on the arduino, it will cause the readings to go crazy. I tested this a little and found out that if you read the analog output voltage of the voltage going into a led, it will say 5, which it should be, but if you hook the analog pin to the ground pin of the led, and disconnect the actual ground, you will see the analog reading vary as other devices are powered. Pretty sure that's the reason the temp sensor goes crazy when other devices are used. I think it has something to do with current or amps supplied/used by the other devices but i'm not sure.
The only way I was able to get the temp sensor to work without any interference from powering other devices at the same time was to use a temp sensor that had its own independent power source.
Hope this helps, it was very frustrating for me to figure out.
Thomas
I've got some leds connected to digital inputs and that's all, when i multiply by 10 it show pretty good temp. Should sensor be very, very hot when it's working? can't even touch it?
The sensor outputs 10mV/degC, so you have to read 0.25V with a voltmeter at its output at room temperature (provided you room temperature is 25degC). Read the LM35 datasheet..