DHT11 Sensor Features
The DHT11 is a digital temperature and humidity sensor. This sensor is able to measure the humidity in the range of 20% to 80% with an accuracy of 5%. It can also measure the temperature in the range of 0 to 50 degrees Celsius with an accuracy of 2 degrees.
The sampling frequency of this sensor is 1Hz. As a result, there must be at least one second between every readings of the sensor, otherwise the reading values will be incorrect.
You can download the DHT11 temperature and humidity module datasheet here.
DHT11 Sensor Module Pinout
This module has 3 pins:
- VCC: Module power supply – 5 V
- GND: Ground
- Data: Sensor output
- TX: Send information via serial protocol
You can see Pinout of this module in the following image
Interfacing DHT11 Sensor Module with Arduino
Step 1: Circuit
Connect the module to Arduino according to the following circuit.
Step 2: Installing Library
Go to Library manager and install DHT11 temperature sensor library.
Step 3: Code
Upload the following code to Arduino board. This code reads temperature and humidity and displays that in the serial monitor.
/* DHT11 - Tempertature & Hummidity Sensor modified on 08 Sep 2020 by Mohammad Reza Akbari @ Electropeak
The code output is like this: