Hi I am using the temperature sensor which can be found here http://www.dfrobot.com/wiki/index.php?title=DFRobot_LM35_Linear_Temperature_Sensor_(SKU:DFR0023) the output voltage is suppose to be 10mV/C. When I measure the voltage on the sensor with a voltmeter I get about 250 mV, which is equivalent to 25 C. However when I read the sensor I am unable to have a formula that consistently gives an accurate temperature reading.
One formula that I have seen floating around on the internet is 5.0*analogRead(tempPin)100/1024 but after doing some research I found out that the 5.0 actually represents the AVcc, so the formula should actually be AVccanalogRead(tempPin)*100/1024 the problem of course is then of course reading the AVcc, fortunately i found this code https://code.google.com/p/tinkerit/wiki/SecretVoltmeter which read the AVcc of the Arduino board. So then I started using the formula readVcc()*analogRead(tempPin)/10240.0; which sometimes gives fairly accurate results but over time the temperature reading will be much higher then it should be. Does anyone have any suggestions to increase the accuracy and repeatability of this temperature sensor?