Blog  /  DHT11 VS DHT22 – Which is the Better Humidity and Temperature Sensor Option?

DHT11 VS DHT22 – Which is the Better Humidity and Temperature Sensor Option?

DHT sensors are slow humidity and temperature sensors that benefit tech enthusiasts interested in basic data logging. Compared to other temperature sensors, DHTs are slow. However, they have excellent long-term stability and consume less power.  There are a wide variety of DHT modules like DHT11 VS DHT22. The examples conduct similar operations but have differences.  

What is DHT11?

 

DHT11 is an ultra-low-cost temperature and humidity sensor that detects relative temperature and humidity. Relative humidity means the water vapor’s saturation points in the air compared to the quantity of air’s water vapor.

Moreover, DHT11 is also a temperature and humidity module for Arduino and Raspberry hence highly favored by hardware enthusiasts.  

raspberry pi-2 model

(raspberry pi-2 model)

 

Characteristics

 

  • It has a voltage supply of 3V to 5V and I/O.
  • Then, the maximum current it uses while requesting data during conversion is 2.5mA.
  • Its dimension is 15.5mm × 12mm × 5.5mm, and its four pins have 0.1' spacing.
  • Further, it has a range of temperature between -20-60°C (±2%) and a humidity range of 5-95%RH (±5%).
  • Lastly, its inbuilt ADC generates a single-bus digital signal output that saves the control board’s I/O resources.

Note; The new DHT11 module has added features compared to the old ones. The table below gives a summary.  

 

What is DHT22/RHT03/AM2302?

 

RHT03 is also a sensor module with high precision temperature and capacitive humidity sensors.

It uses humidity sensing technology and a dedicated digital module acquisition technology. Both technologies ensure long-term stability and high reliability. Additionally, it has a temperature and capacitive sensing element connected to an 8-BIT microcontroller of high performance.  

microcontroller module

(microcontroller module)

 

Characteristics

 

  • First, it is of excellent quality, high-cost performance, strong anti-interference ability, and ultra-fast response.
  • Then, it's ultra-small body size.
  • Its temperature sensor ranges from -40° to 80°C with ±0.5°C accuracy, whereas its humidity sensor ranges from 0-99%RH with ±2%.
  • Finally, it consumes low power. Also, it can transmit signals to a distance not less than 20M, thereby capable of bearing demanding applications.

 

Working principle

 

DHT11 and DHT22 have a similar working principle and use the components consisting of:

Humidity sensing component – It has two electrodes with a substrate that holds moisture between them, and it measures humidity. Therefore, changes in humidity change the resistance between electrodes or substrate conductivity.

IC – It measures and processes resistance change making it ready for microcontroller reading.

Thermistor/ Negative Temperature Coefficient (NTC) It measures the temperature. Often, a decrease in resistance increases the temperature.  

DHT11 VS DHT22 Pinout

 

DHT11 and DHT22 have four pins, but only three are functional.

  1. Vcc pin – It is the sensor’s power supply pin. Often, 5V is suitable even though the supply voltage can range from 3.3V to 5.5V.

A 5V can withstand a 20m distance. Contrarily, a 3.3V supply voltage will only need 1m to avoid errors in measurement during line voltage drop.

  1. Data pin – It enables the communication between the microcontroller and sensor.
  2. NC pin means not connected.
  3. GND pin – connects to the ground line of Arduino.
  4. How are they different?

Despite both DHT11 and DHT22 being temperature and humidity sensors, they differ in the following ways;  

 

Connecting DHT11 and DHT22 to Arduino UNO

 

Below is a simple tutorial on using the DHT22 and DHT11 modules with an Arduino.  

Components needed

 

  • DHT11 – Grove temperature and humidity sensor,
  • DHT22 – Grove temperature and humidity sensor pro,
  • An optional Grove base shield to ease connection, and
  • Seeeduino V4.2/ Arduino UNO.

 

DHT11 VS DHT22:Arduino UNO

(Arduino UNO)

 

DHT11 VS DHT22:Instructions

 

Start by connecting the hardware

 

  • First, connect the DHT11 to the D2 port of the Grove-based shield.
  • Then, join the grove-base shield to the Arduino UNO.
  • Thirdly, use a USB cable to connect the Seeeduino to a PC.

If you lack a grove-base shield, you can opt for the following direct connection of your DHT11 to the Seeeduino.

Example of connecting an Arduino UNO with DHT11

DHT11 VS DHT22:Proceed to the software setup

 

  • Check on the GitHub website then, download the Seeed DHT library.
  • Secondly, you can confirm how to install the library for Arduino if you're unfamiliar with the process.
  • Use this path: File > Examples > Grove_Humidity_Tempearture_Sensor-master > DHTtester after restarting the Arduino IDE and open the DHTtester. From here, read the environment's relative humidity and temperature information.

 

Note;

 

  • DHT22 and DHT11 modules both share the Arduino library above. However, since the library’s default setting is DHT22, you’ll have to change it to DHT11 manually.
  • Regardless of the product in use, always ensure you’ve made into effect the definition line of the board’s sensor. Furthermore, comment on the definition lines of other specifications.

For instance, the definition part of a DHT11 sensor spec can be coded below;  

DHT11 VS DHT22:

 

Upload your demo 

 

Once you finish your demo, it’s time to upload it.  

DHT11 VS DHT22:Results review 

 

Simultaneously tap the Ctrl+Shift+M key or click Tool > Serial Monitor to open the Serial Monitor of Arduino IDE. With everything in check, you should be able to find an accurate temperature reading.

Yet again, you can convert the temperature from degrees centigrade to degrees Fahrenheit using the code below;

  • //print the temperature in Fahrenheit
  • Serial.print((t * 9.0) / 5.0 + 32.0);

 

Conclusion

 

Ideally, DHT11 and DHT22 are the best options when looking into a low-cost humidity and temperature sensor. But, as you’ve seen, DHT22 overpowers DHT11 in some aspects.

Regardless of your choice, we hope that the article has enlightened you on DHTs. For more information, kindly contact us.