How to use the DHT11 Temperature & Humidity Sensor with Arduino
With global warming happening and mother nature doing its thing, it pays to keep up to date on the temperature and humidity of your surroundings.
This is where an Arduino and a DHT11 Temperature & Humidity Sensor can help you. You can get the DHT11 Sensor and much more to explore the wonderful world of Arduino in the Monster Starter Kit.
Today we are going to learn how to connect the sensor with an Arduino and code it.
First, here are the parts we need for this project.
DHT11 Sensor
3 Male-Female Jumper Wires
An Uno R3 Arduino-compatible board
Here are the pin connections:
S: Pin 2
V: 5V
G: GND
You will need to install a couple DHT libraries to use this sensor. See below.
After downloading these libraries, unzip and copy them to the Arduino Library folder.
Or you can do it from the Arduino IDE, go to Sketch->Include Library->Add Zip. Library.
Now you can load the examples that is already built in the libraries by going to Files->Examples->DHT Sensor Library-> DHT Tester
Now make sure you define the correct type of DHT sensor under #defineDHT11.
Next, upload the sketch and open the serial monitor.
You should see your room temperature and humidity information of the serial monitor. Now you are up to date on the latest temperature of your surroundings!
There are also plenty other tutorials for the DHT11, just google and you will not be disappointed. Just remember to use the correct libraries with the correct code according to the tutorials you watch.
Have fun and god speed on the future heat waves of polar vortexes.