This page is to Setup and Config LM35
Hardware and Software
Hardware
LM35 & Arduino
Software
1.
Support :
- http://blog.circuits4you.com/2015/05/lm35-temperature-sensor-interfacing.html
- https://playground.arduino.cc/Main/LM35HigherResolution
- http://www.instructables.com/id/ARDUINO-TEMPERATURE-SENSOR-LM35/
Sanki Notes
Examples
-
int val;
int tempPin = 1;
void setup()
{
Serial.begin(9600);
}
void loop()
{
val = analogRead(tempPin);
//float mv = (5.0 * val * 100)/1024;
float mv = ( val/1024.0)*5000;
float cel = mv/10;
//float cel = mv;
float farh = (cel*9)/5 + 32;
Serial.print("TEMPRATURE = ");
Serial.print(cel);
Serial.print("*C");
Serial.println();
delay(1000);
/* uncomment this to get temperature in farenhite */
Serial.print("TEMPRATURE = ");
Serial.print(farh);
Serial.print("*F");
Serial.println();
}
Second Example
-
float tempC;
int reading;
int tempPin = 0;
void setup()
{
analogReference(INTERNAL);
Serial.begin(9600);
}
void loop()
{
reading = analogRead(tempPin);
tempC = reading / 9.31;
Serial.println(tempC);
delay(1000);
}
|