"Temparature monitor " using arduino.
//www.appuneurons.blogspot.com
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int sensor=A1; // Assigning analog pin A1 to variable 'sensor'
float tempc; //variable to store temperature in degree Celsius
float tempf; //variable to store temperature in Fahreinheit
float vout; //temporary variable to hold sensor reading
void setup() { pinMode(sensor,INPUT); // Configuring pin A1 as input
Serial.begin(9600); lcd.begin(16,2);
delay(500); }
void loop() { vout=analogRead(sensor);
vout=(vout*500)/1023; tempc=vout;
// Storing value in Degree Celsius
tempf=(vout*1.8)+32;
// Converting to Fahrenheit
lcd.setCursor(0,0);
lcd.print("in DegreeC= "); lcd.print(tempc);
lcd.setCursor(0,1); lcd.print("in Fahrenheit=");
lcd.print(tempf);
delay(1000); //Delay of 1 second for ease of viewing in serial monitor
}
Upload the sketch and enjoy.......
This can be used to measure your room temparature in two units....
PARTS NEEDED
Arduino uno
LCD 2x16
Lm35
Jumber wires
Optional power supply 9v
Bread board
Potentiometer 10k
Potentiometer 10k
Circuit diagram
Lcd connecting instructions
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin
* LCD R/W pin to ground
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
LCD pinouts
The program code//temparature sensor using lm35 and lcd 2*16
//www.appuneurons.blogspot.com
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int sensor=A1; // Assigning analog pin A1 to variable 'sensor'
float tempc; //variable to store temperature in degree Celsius
float tempf; //variable to store temperature in Fahreinheit
float vout; //temporary variable to hold sensor reading
void setup() { pinMode(sensor,INPUT); // Configuring pin A1 as input
Serial.begin(9600); lcd.begin(16,2);
delay(500); }
void loop() { vout=analogRead(sensor);
vout=(vout*500)/1023; tempc=vout;
// Storing value in Degree Celsius
tempf=(vout*1.8)+32;
// Converting to Fahrenheit
lcd.setCursor(0,0);
lcd.print("in DegreeC= "); lcd.print(tempc);
lcd.setCursor(0,1); lcd.print("in Fahrenheit=");
lcd.print(tempf);
delay(1000); //Delay of 1 second for ease of viewing in serial monitor
}
Upload the sketch and enjoy.......
Show working
END
Comments