Tuesday, May 19, 2015

LM35 Temperature Sensor Interfacing with Arduino


Description:

LM35 is a precision temperature sensor with its output proportional to the temperature (in oC). With LM35, temperature can be measured more accurately than with a thermistor. It also possess low self heating and does not cause more than 0.1 oC temperature rise in still air.   
The operating temperature range is from -55°C to 150°C. The output voltage varies by 10mV in response to ambient temperature, its scale factor is 0.01V/ oC.

Connection Diagram:

temp = (1.1 * analogRead(tempPin) * 100.0) / 1024;
To change aRef to 1.1V, you use the command "analogReference(INTERNAL);"

Code:


float tempC;
int reading;
int tempPin = 0;

void setup()
{
  analogReference(INTERNAL);
  Serial.begin(9600);
}

void loop()
{
  reading = analogRead(tempPin);
  tempC = reading / 9.31;
  Serial.print("Temprature= ");
  Serial.print(tempC);
  Serial.print("*C");
  Serial.println();
  delay(1000);
}


Output:
    Click on Tools >> Serial Monitor in Arduino Software



  

No comments:

Post a Comment