Now make your own temperature sensor by Arduino and LM35 Sensor
You required following parts
1-ARDUINO BOARD ANY VERSION
2-LM35 TEMPERATURE SENSOR
3-USB CABLE
4-COMPUTER WITH ARDUINO SOFTWERE
MAKE THE CONNECTION AS SHOWN IN IMAGE AND UPLOAD THE FOLLOWING CODE ON ARDUINO BOARD.
Open up the Arduino IDE and write the following code :
int val;
int tempPin = 1;
void setup()
{
Serial.begin(9600);
}
void loop()
{
val = analogRead(tempPin);
float mv = ( val/1024.0)*5000;
float cel = mv/10; //because every based datasheet 10mv as 1 *C
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();
*/
}
NOW SEE THE SERIAL MONITOR IN THE ARDUINO SOFTWERE ,
ITS DONE.
0 komentar:
Posting Komentar