Issues with recently purchased LM35D

I have purchased a LM35D.

I have been trying pretty much every single code I could find on the web but each time the sensor has been giving me some strange readings.

I managed to get some sort of reading by inversing the ground and the "out" pin from the sensor and plugging them in the AREF analogReference(INTERNAL).

However, the output usually revolves around 16.5C (and wont go lower than 13.5C even if I put an icepack on it or go higher than 32C if I hold it in my hands).

Does anyone have clue as to why things are not working well ?

You should be posting code and circuit diagrams to help us. Circuit is especially import in this case, especially if you have long wires to the sensor.

The sensor is very sensitive to the voltage calibration. I have a library that uses the internal voltage reference to calibrate the sensor voltage. See the link to the repository below, in the signature block.