What is conversion system of LM35 (temperature sensor) in Celsius for Arduino?

What is conversion system of LM35 (temperature sensor) in Celsius for Arduino?

Submitted by erick on Sat, 07/23/2016 - 15:02

What is conversion system of LM35 (temperature sensor) in Celsius for Arduino?

for Arduinos is:

val = analogRead(tempPin);

float mv = ( val/1024.0)*5000;

float cel = mv/10;

 

Example:

//getting the voltage reading from the temperature sensor

int reading = analogRead(tempPin0);

float mv = ( reading / 1024.0) * 5000;

float cel = mv / 10;

Serial.print(cel); Serial.println(" degress C");