I have an LM35DZ sensor connected to an Arduino MEGA.
When I warm up the sensor, the value given by AnalogRead goes down, and when I cool down the sensor the value goes up.
With the sensor connected directly to +5V, Pin0, and GND I was getting very noisy values. After reading other posts and experimenting, I found that putting a resistor & capacitor in series between Vout and GND stabilised the readings (Values 500Ω & 0.01uF as that's what I had on hand)
The sensor & other components are on a breadboard, connected to the Arduino by short (less than 10CM) wires.
The Arduino is powered by a 12V supply, though USB is still connected for the serial output.
I thought it might be an issue with my code, so I reduced it down to the simplest possible based on Arduino Playground - LM35HigherResolution and I'm still getting the same results
MarkT:
Compare printing with a genuine part, the font and layout may differ somewhat.
You cannot be sure about any parts from eBay, although they may be fine, sometimes they are not.
They look the same as all the photos that google images returns for "LM35DZ", but if I connect them directly to 5V and GND on the arduino then measure the voltage between Vout & GND with the my multimeter I get less than 10mV regardless of temperature, so I'm inclined towards them being fakes or a bad batch. I've ordered some more from a different seller so I'll see how those work out.