0% found this document useful (0 votes)
4 views7 pages

Temperature

This document outlines a mini project for measuring temperature and humidity using a DHT11 sensor and an Arduino Uno. It includes a list of required components, a detailed procedure for connecting the hardware and uploading the code, and concludes with the expected result of displaying the readings on an LCD screen. The project aims to create a functional system that accurately measures and displays environmental conditions.

Uploaded by

afzalrdx1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views7 pages

Temperature

This document outlines a mini project for measuring temperature and humidity using a DHT11 sensor and an Arduino Uno. It includes a list of required components, a detailed procedure for connecting the hardware and uploading the code, and concludes with the expected result of displaying the readings on an LCD screen. The project aims to create a functional system that accurately measures and displays environmental conditions.

Uploaded by

afzalrdx1234
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

TEMPERATURE H

UMIDITY & SENSOR

MEASURMENT AND INSTRUMENTATION LAB MINI PROJECT

E3A2
RAZIN - 44
MUHAMMED ASLAM E SHIHABUDHEEN - 45
BADUSHA - 46
NISHAD - 47

NIKHIL - 48
NOEL - 50
AIM

-Detect temperature and humidity using


DH11 Sensor

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.

3. Connect the 9V battery with connector to the Vin pin of the


Arduino. Connect the two 18650 Li-Ion cells in series and connect
their positive and negative terminals to the Vin and GND pins of the
Arduino respectively.

4. Open the Arduino IDE and create a new sketch. Copy and paste the
following code:
//infinite Xpro

// firstly need to add i2c library

#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;

volatile unsigned long duration=0;

unsigned char i[5];

unsigned int j[40];

unsigned char value=0;

unsigned answer=0;

int z=0;

int b=1;

void setup()

lcd.init(); // initialize the lcd

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);

pinMode(gate,INPUT_PULLUP);//by default it will become high due to internal pull up


// delayMicroseconds(40);

duration=pulseIn(gate, LOW);

if(duration <= 84 && duration >= 72)

while(1)

duration=pulseIn(gate, HIGH);

if(duration <= 26 && duration >= 20){

value=0;}

else if(duration <= 74 && duration >= 65){

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];

if(answer==i[4] && answer!=0)

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.

You might also like