LM35 ARDUINO
LM35:-It is a temperature sensor whose voltage varies as temperature increases or decreases. With 1° C change in temperature, there is a change of 10 millivolts therefore if temperature rises by 1 degree then 10 millivolts will be added similarly if temperature is reduced by 1 degree then 10 millivolts will be reduced.
Summary in mathematical equation:-
1°C = 10mV
LM35 PINOUT
GND PIN- connected to GND pin of Arduino.
OUTPUT– it is an output pin.
VCC PIN- connected to VCC pin of Arduino.
First we have to connect VCC pin of Arduino to 1st terminal of LM35.
Then we have to connect 2nd pin of LM35 to A0 pin of Arduino.
Then connect GND pin of Arduino to 3rd pin of LM35.
char input;
float temperature;
void setup()
{
pinMode(A0,INPUT);
Serial.begin(9600);
}
void loop()
{
temperature=0.48828125 * analogRead(A0);
input=Serial.read();
if (input=='t')
{
if (temperature>48)
{
Serial.println(" It's too hot");
}
else if(temperature<20)
{
Serial.println(" It's too cold");
}
else
{
Serial.println("It's normal temperature");
}
}
delay(100);
}
___________________________________
To learn this project in more detail, click here or on this picture to watch on YouTube.





Comments
Post a Comment