DHT11 temp and hum

In this post I will write how to use libraries repository. As example we may use temperature and humidity measurement. Sensor that is common in this area calls DHT11 module. It is cheaper version of DHT22 which allows to get temperature below zero degree and humidity in 0-100% range.

The most important parameters of DHT11 module is temperature measurment above zero degree and humidity in 20-80% range. It is cheaper than DHT22 and perfect for indoor use.

DHT11

Detailed specification from Adafruit website:

DHT11

  • Ultra low cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 20-80% humidity readings with 5% accuracy
  • Good for 0-50°C temperature readings ±2°C accuracy
  • No more than 1 Hz sampling rate (once every second)
  • Body size 15.5mm x 12mm x 5.5mm
  • 4 pins with 0.1″ spacing

DHT22

  • Low cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 0-100% humidity readings with 2-5% accuracy
  • Good for -40 to 125°C temperature readings ±0.5°C accuracy
  • No more than 0.5 Hz sampling rate (once every 2 seconds)
  • Body size 15.1mm x 25mm x 7.7mm
  • 4 pins with 0.1″ spacing

DHT11 wiring

We may get DHT11 module board ready to use, with soldered resistors already. If you have only sensor then you have to add resistors yourself as below:

arduino+DHT11

Additional plugins

After connecting, we have to find libraries which to get support for this sensor and install the most recent version. After that we should get new element in Arduino IDE menu.

Wybieramy  Sketch>>Add library>>manage libraries

Install SimpleDH:

biblioteka dht11

After installing the most recent version, click menu File>>Examples>> SimpleDHT>>DHT11Default

przyklady DHT11

Review code and change pinout where sensor DHT11 is connected to. Youa re ready to upload sketch to Arduino.

After start a program select: Tools >> Serial monitor. You should get latest results like here:

You may also like...

Leave a Reply

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