Project Report
Project Report
Project Report
Project Report
Temperature fi Humidity Sensor
Introduction:
Humidity and temperature are common parameters to measure environmental
conditions. In this Arduino based project we are going to measure ambient
temperature and humidity and display it on a 16x2 LCD screen. A combined
temperature and himidity sensor DHT11 is used with Arduino uno to develop this
Celsius scale thermometer and percentage scale humidity measurement project.
This project consists of three sections - one senses the humidity and temperature
by using humidity and temperature sensor DHT11. The second section reads the
DHTsensor module’ output and extracts temperature and humidity values into a
suitable number in percentage and Celsius scale. And the third part of the system
displays humidity and temperature on LCD.
Applications:
It can be used for measuring humidity and temperature values in heating,
ventilation and air conditioning systems. Weather stations also use these sensors
to predict weather conditions. The humidity sensor is used as a preventive
measure in homes where people are affected by humidity. Offices, cars, museums,
greenhouses and industries use this sensor for measuring humidity values and as a
safety measure.
Hardware:
• Arduino UNO
• Jumper Wires
Input Diagram:
This project consists of three sections - one senses the humidity and temperature by using
humidity and temperature sensor DHT11. The second section reads the DHTsensor
module’s output and extracts temperature and humidity values into a suitable number in
percentage and Celsius scale. And the third part of the system displays humidity and
temperature on LCD. Working of this project is based on single wire serial communication.
First arduino send a start signal to DHT module and then DHT gives a response signal
containing temperature and humidity data. Arduino collect and extract in two parts one is
humidity and second is temperature and then send them to 16x2 LCD.
Complete Working:
First of all arduino sends a high to low start signal to DHT11 with 18µs delay to
ensure DHT’s detection. And then arduino pull-up the data line and wait for 20-40µs
for DHT’s response. Once DHT detects starts signal, it will send a low voltage level
response signal to arduino of time delay about 80µs. And then DHT controller pull
up the data line and keeps it for 80µs for DHT’s arranging of sending data.
When data bus is at low voltage level it means that DHT11 is sending response
signal. Once it is done, DHT again makes data line pull-up for 80µs for preparing data
transmission.
Data format that is sending by DHT to arduino for every bit begins with 50µs low
voltage level and length of high voltage level signal determines whether data bit is
“0” or “1”.
One important thing is to make sure pull up resistor value because if we are placing
DHT sensor at <20 meter distance, 5k pull up resistor is recommended. If placing
DHT at longer the 20 meter then use appropriate value pull up resistor.
Circuit Diagram:
FlowChart:
Programing Description:
In programming, we are going to use pre-built libraries for DHT11 sensor and LCD display module.
Then we haved defined pins for LCD and DHT sensor and initialized all the things in setup.
Then in a loop by using dht function reads DHT sensor and then using some dht functions
we extract humidity and temperature and display them on LCD.
Here degree symbol is created by using custom character method.
Complete Code:
#include<dht.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,16,2);
byte degree_symbol[8] =
{
0b00111,
0b00101,
0b00111,
0b00000,
0b00000,
0b00000,
0b00000,
0b00000
};
int gate=11;
delay(1000); while(1)
{
delay(1000); pinMode(gate,OUTPUT); digitalWrite(gate,LOW); delay(20);
digitalWrite(gate,HIGH);
pinMode(gate,INPUT_PULLUP);
delayMicroseconds(40);
z=0; i[0]=i[1]=i[2]=i[3]=i[4]=0;
}
Output :-