LM35 capteur température

Bonsoir,

Trouvé sur le forum Adafruit .. je n'ai pas testé .. en espérant que ça vous aide.

The problem is that the Atmega on the Arduino has one ADC that is multiplexed for all the analog pins.
When you do an analogRead(), a multiplexer connects the pin you are reading to the ADC. This works fine for low impedance voltage sources.

It takes time for a high impedance sensor like your temperature sensor to change the voltage at the ADC after this switch of pins. Temperature sensors must use low power and thus be high impedance to avoid IR heating.

Try the following:

      analogRead(5);
      delay(10);
      nTemp = analogRead(5) * 5000L / 1024L  / 10;

The first analogRead(5) will switch the pin to the ADC. The delay will allow the voltage at the ADC to stabilize and the second analogRead(5) should get a stable value.

Salutations