Electrical – LM35 gives very high values in room tempratures, and decreases when we exposed it to a heat source!

arduinosensortemperature

So we bought five LM35DZ, in the previous days, when we use the multimeter to measure the voltage between Vout and GND, the results were correct and logic, and when we exposed LM35 to a heat source, the voltage increased, But the problem was with Arduino, the results were unstable and illogical! We checked internet, and we found some possible reasons!

  • Sharing the GND was one of them, but we only use the LM35, so we don't share the GND with any other device
  • Another possible reason is due to the unstable source, because we're feeding the Arduino from the USB and this can lead to wrong results, because of the ADC converter, there are some ways to eliminate such problem, we chose to read the 3.3 V pin of Arduino and use it as a reference

    unsigned int temp = 0;
    unsigned long temptot = 0;
    unsigned int REFtemp = 0;
    unsigned long REFtemptot = 0;
    
    int x;
    
    int REFSensor=  A1,
    LMSensor=A0;
    
    void setup() {
        pinMode(REFSensor,INPUT);
        pinMode(LMSensor,INPUT);
        Serial.begin(9600);
    }
    
    void loop() {
        temptot = 0;
        REFtemptot = 0;
    
        for(x = 0; x < 64; x++) { analogRead(REFSensor);}
    
        for(x = 0; x < 64; x++) {REFtemptot += analogRead(REFSensor);}
    
        for(x = 0; x < 64; x++) {analogRead(LMSensor);}
    
        for(x = 0; x < 64; x++) {temptot += analogRead(LMSensor);}
        temp = temptot >> 6;   
        REFtemp = REFtemptot >> 6;  
        float y= (float(REFtemp)*3.3)/676.; 
        Serial.print("Vcc: " ); Serial.print(y*1023./676.); Serial.print("v  "); 
        Serial.print("REF: " ); Serial.print(y); Serial.print("v  "); 
        float volt= (float(temp)*3.3)/float(REFtemp);
        // Serial.print("V.LM: " ); Serial.print(volt*1000.);  Serial.print("mv   ");
        Serial.print("T.LM: " ); Serial.print(volt*100);   Serial.println("C " ); 
    }
    
  • Another problem is the noise and many attempts to add a 100nF capacitor between Vcc and GND, we don't have 100nF so we used 10nF

  • Also to smooth the results we add another capacitor (1pF to 10pF) between Vout and Arduino pin (A0 in our case)

So today and after making all these changes, what happen is that the results were stable but illogical; in room temperature we read 10C to 12C, and when we removed one or both capacitors the results go crazy (between 100C to 10C) and the most strange event is that when we expose the LM35 to heat, the temperature decreases

We checked the LM35 using the multimeter and here the surprise! The voltage between Vout and GND was between 1000 mV to 3000 mV, and when we expose the LM35 to heat it decreases to 200 mV. I'm saying it is a surprise because all the five LM35 start acting in the same way. Is it possible that we burn all of them at once? If this is the case, how and when this happened? I remember we switched between the Vcc and GND of one of the LM35 which can cause damage, but as I said just one. Not all of them.

So anyone can help? We decided to buy another LM35 and check it, who knows!

UPDATE————————————————————————-

The big capacitor is between GND and Vcc it is about 100pF, sometimes we don't use it, in this case the signal become very unstable, the small one is about 1pF, sometimes we put it between Vout and Gnd! I don't know why we used it, but it made the signal more stable!


this is the signal between Vout and GND, we removed all capacitors, it gave 0v, I don't know why! it gave 1v to 3 volt using multimeter

we fed the LM35 with 5 volt

enter image description here
The signal here was taken between Vout and Vcc(5volt), it should be 5volt, because it is 0v between Vout and GND!

I don't know why it looks like that! apparently there is no big noise!


The last picture is between Vcc and GND, it gave 5volt as expected!

Now! I'm not sure why we got such illogical results! maybe the LM35 was damaged but even with this possibility, the signal between Vout and GND shouldn't be 0!

Best Answer

The usual problem with LM35 instability is excessive capacitive loading caused by cables, external capacitors or input capacitance. See Page 14 of the TI datasheet.

enter image description here

The 2K series resistor or the RC damper are not optional if the capacitive loading exceeds about 50pF. That's easily exceeded with even a short screened (shielded) cable.

Forget what the Arduino reads for now, leave it connected and debug the sensor using a simple multimeter.