Your "well-known formula":temp = (5 * analogRead(0) * 100.0) / 1024.0needs to replace "5" with the actual board voltage, 4.81V, 5.17V, etc. So it is not surprising that you get a large temperature error if you have a large reference voltage error.
temp = (5.17 * analogRead(0) * 100.0) / 1024.0
I'm working with the LM35 in a project of mine also (a solar water heater controller). It reads 5 LM35 sensors (ambient, panel temp, tank temp, pump outlet temp, and tank inlet temp).I noticed this variation as well, and a made a calibrate function (accessed with a DR Robot LCD Keypad shield). What it does is lets me "calibrate" by comparing an LM35 reading with a known reading.. I enter the correct reading and it computes and stores a multiplier to use (multiplier = actual_temp / lm35_temp )... Then I add it into the formula to be:temp = ((5.0 * multiplier) * analogRead(0) * 100.0) / 1024.0One of the reasons I had to implement this multiplier calibration technique is that each LM35 has different length leads running to them (from about 5' to around 20'), so each one needs calibrated individually to compensate for voltage drop, etc. In the end it seems to work pretty well!
It's true! See this circuit for a related problem:http://ruggedcircuits.com/html/circuit__13.htmlNote at the bottom that there are references to how an Arduino can measure its own voltage by using the built-in 1.1V bandgap voltage.--The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons