How to Measure Temperature and Humidity with DHT Sensor
DHT sensors
are used to measure the humidity and temperature of the surroundings. They are
widely used in IoT and Industrial applications. By the end of this article,
you will be able to operate the DHT sensor with Arduino, to measure the temperature and the humidity of your environment.
Required
Components:
1. Arduino Circuit Board
2. DHT 11 or DHT 22
3. Jumper wires
Circuit
Diagram
DHT sensors come
in two forms;
·
In form of a sensor
DHT-11 Sensor |
DHT-22 Sensor |
Here we have 4 terminals, VCC, DATA, NC, GND (moving from left to right)
Connections:
VCC à 5V of Arduino
DATA à Digital Pin 4(If you change pin number, make a change in code
as well)
NC à Leave Disconnected
GND à Arduino GND
Note: DHT-22 sensor will have the same pin configuration as shown above.
·
In form of Module
DHT-11 Module |
DHT-22 Module |
Here we
have 3 terminals, GND, DATA, VCC (moving from left to right)
Connections:
GND à Arduino GND
DATA à Digital Pin 4(If you change pin number, make a change in code
as well)
VCC à 5V of Arduino
Note: DHT 22 sensor will have the same
pin configuration as shown above.
Code
To use this
code, you would need to install the DHT.h library. Click here, to download the zip
file, and include it in your Arduino IDE. For a tutorial check how to install the DHT.h library.
After installing DHT.h library, upload the following code to your Arduino Board.
Demo
Video
For a better understanding watch the following project video. The video includes the Hardware Setup and a Working Description of the project.
EndNote
We hope you
enjoyed this article. Share it with your friends, and peers. Subscribe to our
newsletter to get an email notification every time we upload an article.
We value your
constructive feedback, in case you have any queries or suggestions, email us at suport@deeplift.tech or join us on
Social Media. Happy Learning!
Very Nice Work!
ReplyDelete