Introduction
Parts of list:
- Arduino
- LCD Display
- LM35 temperature sensor
- Potentiometer
- Breadboard
- Hookup wire.
Connection from sensor to board:
- The first pin can be connected to the Vcc of the 5V to an Arduino board.
- The second pin can be connected to the A1 of analog side to an Arduino board.
- The third pin can be connected to the Gnd to an Arduino board.
Connection from LCD Display to Arduino:
Figure 2: LCD Display
- Fix the LCD in the 16 to 2 in the bread board.
- The 16 pin to the Gnd
- The 15 pin to the Vcc
- The 14 pin to the Digital pin 02
- The 13 pin to the Digital pin 03
- The 12 pin to the Digital pin 04
- The 11 pin to the Digital pin 05
- The 01 pin to the Gnd.
- The 02 pin to the Vcc.
- The 03 pin to the potentiometer.
- The 04 pin to the Digital pin 07.
- The 05 pin to the Gnd.
- The 06 pin to the Digital pin 06.
Connection from Potentiometer to Arduino:
Figure 3: Potentiometer
- Connect as per the preceding figure to the Arduino board and the LCD Display.
- The Vin connected to the LCD display in 03.
Programming
- #include <LiquidCrystal.h>
-
-
- LiquidCrystal lcd(2 ,3 ,4 ,5 ,6 ,7);
-
-
- float tempC;
- float tempF;
- int tempPin = 1;
-
- void setup(){
-
- lcd.begin(16, 2);
- lcd.print("Temp1=");
- lcd.setCursor(0, 1);
- lcd.print("Temp2=");
- }
-
- void loop(){
- tempC = analogRead(tempPin);
- tempC = (5.0 * tempC * 100.0)/1024.0;
- tempF = ((tempC*9)/5) + 32;
-
-
- lcd.setCursor(6, 0);
- lcd.print(tempC,1);
- lcd.print("'C");
-
- lcd.setCursor(6, 1);
- lcd.print(tempF,1);
- lcd.print("'F");
-
-
- delay(1000);
- }
Explanation
- It shows the current room temperature in the location.
- It will display in the LCD monitor as the Celsius to Fahrenheit.
- The temperature can be display as the temp1, temp2 in the monitor.
Output
Figure 4: Output
Read more articles on Arduino: