0% found this document useful (0 votes)
10 views

IOT Assignmenet

The document discusses using a DHT22 sensor to measure temperature and humidity with an Arduino board. It describes the features and specifications of the DHT22 sensor and compares it to the DHT11 sensor. It then explains how to connect the DHT22 sensor to an Arduino board and use its library to retrieve temperature and humidity readings which can be printed to the serial monitor or an LCD display.

Uploaded by

Keshav Bhumaraju
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

IOT Assignmenet

The document discusses using a DHT22 sensor to measure temperature and humidity with an Arduino board. It describes the features and specifications of the DHT22 sensor and compares it to the DHT11 sensor. It then explains how to connect the DHT22 sensor to an Arduino board and use its library to retrieve temperature and humidity readings which can be printed to the serial monitor or an LCD display.

Uploaded by

Keshav Bhumaraju
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

BMS INSTITUTE OF TECHNOLOGY & MANAGEMENT

YELAHANKA, BENGALURU - 560064

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

IOT ASSIGNMENT REPORT

Even Semester - 2023-24

Report of
“DHT22 Sensor for Measuring Temperature and Humidity with the Arduino Board”

VIII Semester
Section - C

Submitted By

Ravi Kiran Poudel


(1BY20CS147)

Under The Guidance Of

Mr. Jagadish P
Assistant Professor
Department of CSE

2023-2024
CHAPTER 1

INTRODUCTION

The DHT22 sensor is a versatile device widely used for measuring temperature and humidity
in various applications. When combined with an Arduino board, it becomes a powerful tool
for environmental monitoring, climate control, and data logging projects. This report provides
an overview of the DHT22 sensor, its features, and how to interface it with an Arduino board
for temperature and humidity measurement.

1.1 Overview

The DHT22 is the more expensive version which has better specifications. Its temperature
measuring range is from -40 to +125 degrees Celsius with +-0.5 degrees accuracy, while the
DHT11 temperature range is from 0 to 50 degrees Celsius with +-2 degrees accuracy. Also,
the DHT22 sensor has a better humidity measuring range, from 0 to 100% with 2-5%
accuracy, while the DHT11 humidity range is from 20 to 80% with 5% accuracy

Figure 1.1: DHT22 Sensor

The DHT22 sensor, also known as the AM2302, is a digital sensor manufactured by Aosong
Electronics. It utilizes a capacitive humidity sensor and a thermistor to measure relative
humidity and temperature, respectively. It operates on a wide voltage range (3.3V - 6V) and
communicates via a single-wire digital interface, making it easy to integrate into
microcontroller-based projects.
DHT22 Sensor for Measuring Temperature and Humidity with the Arduino Board CHAPTER 1

1.2 Features of DHT22 Sensor

The DHT22 / AM2302 is more accurate and better over a larger range of temperatures, and
the complete range of relative humidity. Some of its features are listed below:

● High accuracy and stability in measuring temperature and humidity.


● Wide operating voltage range, making it compatible with various microcontroller
platforms.
● Low power consumption, suitable for battery-powered applications.
● Long-term reliability with low drift in sensor readings.
● Compact size and ease of use, ideal for DIY projects and prototyping.

1.3 DTH11 vs. DTH22

There are two versions of the DHT sensor, which look a bit similar and have the same pinout,
but have different characteristics. A comparison between these two sensors are shown below:

There are two specifications where the DHT11 is better than the DHT22. That’s the sampling
rate which for the DHT11 is 1Hz or one reading every second, while the DHT22 sampling
rate is 0.5Hz or one reading every two seconds, and also the DHT11 has a smaller body size.
The operating voltage of both sensors is from 3 to 5 volts, while the max current used when
measuring is 2.5 mA.

Department of CSE, BMSIT&M 2023-2024 Page No. 2


CHAPTER 2

WORKING PRINCIPLE

The DHT22 sensor operates based on the principles of capacitive humidity sensing and
resistance temperature detection. They consist of a humidity-sensing component, an NTC
temperature sensor (or thermistor), and an IC on the back side of the sensor.

Figure 2.1: Parts of DHT22 Sensor

For measuring humidity they use the humidity sensing component which has two electrodes
with moisture-holding substrate between them. So as the humidity changes, the conductivity
of the substrate changes, or the resistance between these electrodes changes. This change in
resistance is measured and processed by the IC which makes it ready to be read by a
microcontroller.

Figure 2.2: Moisture substrate for humidity sensing

Department of CSE, BMSIT&M 2023-2024 Page No. 3


DHT22 Sensor for Measuring Temperature and Humidity with the Arduino Board CHAPTER 2

On the other hand, for measuring temperature these sensors use a NTC temperature sensor or
a thermistor.

A thermistor is a variable resistor that changes its resistance with a temperature change.
These sensors are made by sintering semiconductive materials such as ceramics or polymers
to provide larger changes in the resistance with just small temperature changes.

Figure 2.3: NTC temperature sensor

The term “NTC” means “Negative Temperature Coefficient”, which means that the resistance
decreases with an increase in temperature.

Department of CSE, BMSIT&M 2023-2024 Page No. 4


CHAPTER 3

IMPLEMENTATION

3.1 Circuit Schematics

The DHT22 sensors have four pins, VCC, GND, data pin, and a not connected pin which has
no usage. A pull-up resistor from 5K to 10K Ohms is required to keep the data line high and
to enable communication between the sensor and the Arduino Board. Some versions of these
sensors come with a breakout board with a built-in pull-up resistor and they have just 3 pins.

Figure 3.1: Circuit diagram


The DHT22 sensors have their own single wire protocol used for transferring the data. This
protocol requires precise timing and the timing diagrams for getting the data from the sensors
can be found from the datasheets of the sensors. However, we don’t have to worry much
about these timing diagrams because we will use the DHT library which takes care of
everything.

3.2 Source Code

First, we need to include the DHT library which can be found on the Arduino official
website, then define the PIN to which our sensor is connected and create a DHT object. In the
setup section, we need to initiate the serial communication because we will use the serial
monitor to print the results. Using the read22() function we will read the data from the sensor
and put the values of the temperature and the humidity into the t and h variables. If you use
the DHT11 sensor you will need to you the read11() function. At the end, we will print the
temperature and the humidity values on the serial monitor.

Department of CSE, BMSIT&M 2023-2024 Page No. 5


DHT22 Sensor for Measuring Temperature and Humidity with the Arduino Board CHAPTER 3

After we upload this code to the Arduino board, the temperature and humidity results from
the sensor can be seen on the Serial monitor which is shown below:

Department of CSE, BMSIT&M 2023-2024 Page No. 6


DHT22 Sensor for Measuring Temperature and Humidity with the Arduino Board CHAPTER 3

We can also display the results on an LCD using the source code given below:

After we upload this code to the Arduino board, the temperature and humidity results from
the sensor can be seen on the LCD which is shown below:

Department of CSE, BMSIT&M 2023-2024 Page No. 7

You might also like