LM35- Temperature sensor:
LM35 is a precision IC temperature sensor with its output proportional to the temperature (in degree Celsius).
Hardware Required:
Software Required:
Steps to Connect:
Step 1 : Connect 5v supply to the Vcc of arduino
Step 2 : Connect GND of LM35 to GND of arduino
Step 3: Connect Analog pin of LM35 to the Analog pin A0 of arduino
The Analog to Digital Converter (ADC) converts analog values into a digital approximation based on the formula ADC Value = sample * 1024 / reference voltage (+5v). So with a +5 volt reference, the digital approximation will = input voltage * 205
Code:
float temp;
int tempPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125; // to obtain temperature in celsius
Serial.print("TEMPRATURE = ");
Serial.print(temp);
Serial.print("*C");
Serial.println();
delay(1000);
}
Go to serial monitor and see the temperature readings
LM35 is a precision IC temperature sensor with its output proportional to the temperature (in degree Celsius).
LM35 terminals |
Hardware Required:
- LM35 sensor
- Arduino
- Arduino UNO
Step 1 : Connect 5v supply to the Vcc of arduino
Step 2 : Connect GND of LM35 to GND of arduino
Step 3: Connect Analog pin of LM35 to the Analog pin A0 of arduino
Arduino with LM35 |
Code:
float temp;
int tempPin = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125; // to obtain temperature in celsius
Serial.print("TEMPRATURE = ");
Serial.print(temp);
Serial.print("*C");
Serial.println();
delay(1000);
}
Go to serial monitor and see the temperature readings
No comments:
Post a Comment