DHT11 – Learn how to use with Arduino

Learn how to use DHT11 temperature and humidity sensor with Arduino. In this post we’ll go over the sensor pins, the connections to an Arduino UNO, the sensor specs, how to program in Arduino, the required libraries, and testing of the DHT11.

DHT11 Operating voltage, range, and accuracy

Sensor Voltage: 3.0V – 5.5V

Sensor Operating Range:

Relative Humidity:

TemperatureRange (RH)
0oC (32oF)30% – 90%
25oC (77oF)20% – 90%
50oC (122oF)20% – 80%

Temperature:

0oC to 50oC (32oF to 122oF)

Sensor Accuracy (error):

Temperature: ±2oC (±3.6oF)
Relative Humidity: ±5%

For more details on the sensor specs, see the datasheet.

DHT11 Sensor Pins

DHT11 Sensor Pins

Connection to Arduino UNO

DHT11 Connection to Arduino

Click to enlarge

Downloading the libraries

Download the Simple DHT library (Zip file) – LINK. Once downloaded, we will go ahead and install in Arduino IDE.

Installing the Simple DHT library

Once the Zip library has been downloaded, you need to import it within the Arduino IDE. To do this, go to the top menu, then click Sketch, Include Library, Add .Zip Library… Then, find the Zip file in the folder in which you downloaded it, select the Zip file and click open to import into Arduino IDE.

Once you do this, we will be ready to go into programming in Arduino!

Click to enlarge

Click to enlarge

Arduino Code

Run Arduino Code

Testing the DHT11 Sensor

I tested the DHT11 temperature and humidity sensor by integrating it with a 1602 LCD and placing the sensor under different conditions. One was next to my thermostat, and the other was next to a pot of boiling water.

DHT11 Testing

Components used in this example

*As an Amazon & Ebay Associate I earn from qualifying purchases.

ComponentLink
Arduino UNOhttps://amzn.to/3uYVAMC
https://ebay.us/veZdKX
DHT11https://amzn.to/3ttK6Ar
https://ebay.us/ZEIZZJ
1602 LCDhttps://amzn.to/2P146LY
https://ebay.us/sofDTP
Breadboard (Elenco 9440)https://amzn.to/3x23dnq
https://ebay.us/FcwSdb

Leave a Reply

Your email address will not be published. Required fields are marked *