a problem with temperature measurement using LM35 DZ sensor

Hi

I am having serious trouble with temp measurement using lm 35 dz sensor , the code was written correctly and the connections are also correct with Arduino Uno , what i got was randomly changing values and many times I obtain 0 degrees C , it sometimes start with 44 deg C in serial monitor and the readings are then decreasing gradually till reaching zero . So i tried to check if the values got by the analogReference function are correct and also the voltage readings and they are both wrong , when I was measuring the vout voltage to gnd with digital MM i was getting a fixed value of 0.1 V , while values at serial monitor were changing and far away from that value .

so i changed the sensor with other new sensor and i got the same results. i am really so confused about that. I have no idea where the problem is . should i buy another sensor from other store ? or the is something i can do to solve this problem. please i need your help.
here is my code

float val = 0 ;
void setup()
{ 
 
Serial.begin(9600);
}
void loop()
{
val = analogRead(0);
float volt = val*0.004888 ; // also tried (val*5) /1023 and didn't work 
float cel = val * 0.4888 ; 
 Serial.print(val);
Serial.print("      ");
Serial.print(volt);
Serial.print("  V      ");
Serial.print(cel);
Serial.println("  C");
delay(500);
}

thanks

fixed value of 0.1 V

If you are indoors !? turn on the heater - it's only 10 deg C

Check connections / sensor. Something is terribly wrong.

I checked them many times , connections are correct , i wonder why the measured voltage by the digital MM much different from that got by the sensor , could the problem solved by adding caps and resistors in a certain way ?

Why didn't you continue your first thread.
http://forum.arduino.cc/index.php?topic=360636.0
Leo..

that was because i ordered another lm35 from the same store , and i gave up about the old one , i was shocked when it gave the same bad results . does it mean i should order one from other store ? or there is something i can do about it ?

This make me think of Chineese conterfeits.

I've never needed C nor R with LM35 (TO92)

Is there a place where i can order one that works properly for sure ?

yes.. Europe or US

Why not China ??

do.. if seller can promise original parts

last question please guys ,

I was really confused weather the problem was from my arduino or from the LM 35 sensors i got from a Chinese store , I checked the arduino analogRead function in a cds photocell and it worked fine and gave very closed voltage readings to my digital multimeter , so should I conclude that the problem is in the LM sensors i bought from that store and i should buy from other one ?

(BTW : all other sensors I bought from there worked perfectly except the LM 35 sensors , and all these sensors including LM 35 were included in the arduino kit)

loop for a TMP36 when buying the next one (or a digital one?)

You will understand why when you see the datasheet fig. 6 here

knut_ny:
loo[k] for a TMP36 when buying the next one (or a digital one?)

You will understand why when you see the datasheet fig. 6 here

Why?
They both are 10mV/degreeC.
The only difference is a 500mV offset, so you can measure lower temps easier with the TMP36.
You might or might not need that.
Leo..

..the '36 can measure freezing temp without additional parts

knut_ny:
..the '36 can measure freezing temp without additional parts

Sure, at the cost of loosing the upper range (>55C) if you use 1.1volt Aref.
Or instability and lower resolution if you use default Aref.
Leo..

ok i will order some other lm 35 sensors from other store and check their results , thanks guys .