Temperature
Temperature
E3A2
RAZIN - 44
MUHAMMED ASLAM E SHIHABUDHEEN - 45
BADUSHA - 46
NISHAD - 47
NIKHIL - 48
NOEL - 50
AIM
COMPONENTS REQUIRED
(x1) Arduino Uno
(x1) Breadboard
(x1) 16x2 16 pin LCD screen
(x1) DHT11
(x1) 9V battery with connector
(x1) 10K Potentiomete
PROCEDURE
1. Connect the DHT11 sensor to the breadboard using the Dupont
wires. Connect the positive and negative pins of the sensor to the 5V
and GND pins of the Arduino respectively. Connect the data pin of
the sensor to pin 2 of the Arduino.
2. Connect the 16x2 LCD screen to the breadboard using the Dupont
wires. Connect the VSS pin of the LCD screen to GND, VDD pin to 5V,
VO pin to the middle pin of the potentiometer, RS pin to pin 12 of the
Arduino, RW pin to GND, EN pin to pin 11 of the Arduino, and D4-D7
pins to pins 5-8 of the Arduino respectively.
4. Open the Arduino IDE and create a new sketch. Copy and paste the
following code:
//infinite Xpro
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display
byte degree_symbol[8] =
0b00111,
0b00101,
0b00111,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};
int gate=11;
unsigned answer=0;
int z=0;
int b=1;
void setup()
lcd.init();
lcd.backlight();
lcd.print("Temp = ");
lcd.setCursor(0,1);
lcd.print("Humidity = ");
lcd.createChar(1, degree_symbol);
lcd.setCursor(9,0);
lcd.write(1);
lcd.print("C");
lcd.setCursor(13,1);
lcd.print("%");
void loop()
delay(1000);
while(1)
delay(1000);
pinMode(gate,OUTPUT);
digitalWrite(gate,LOW);
delay(20);
digitalWrite(gate,HIGH);
duration=pulseIn(gate, LOW);
while(1)
duration=pulseIn(gate, HIGH);
value=0;}
value=1;}
else if(z==40){
break;}
i[z/8]|=value<<(7- (z%8));
j[z]=value;
z++;
answer=i[0]+i[1]+i[2]+i[3];
lcd.setCursor(7,0);
lcd.print(i[2]);
lcd.setCursor(11,1);
lcd.print(i[0]);
z=0;
i[0]=i[1]=i[2]=i[3]=i[4]=0;
}
5. Upload the code to the Arduino board.
6. Turn on the power supply and the LCD screen should display the
temperature and humidity readings from the DHT11 sensor. The
readings will be updated every 2 seconds. Adjust the potentiometer
to adjust the contrast of the LCD screen if necessary.
CIRCUIT DIAGRAM
RESULT
The result of this project is a system that can accurately measure and display
the temperature and humidity of the surrounding environment on the LCD
screen. The DHT11 sensor provides accurate readings of the temperature and
humidity, which are then displayed on the LCD screen using the Arduino Uno
board.