This page looks best with JavaScript enabled

Temperature and Humidity Sensor [DHT11]

 ·  🎃 kalma

Let’s see how we can make DHT11 sensors work, which are used to measure both relative humidity and temperature.

Characteristics

  • Operating voltage: 3v - 5.5v.
  • Range of values from 20% to 90% relative humidity.
  • Range of values from 0ºC to 50ºC temperature.
  • Reading resolution: 1, that is, it only provides us with integer values for both relative humidity and temperature.
  • Relative humidity accuracy: ±5%.
  • Temperature accuracy: ±2ºC.

As you can see, the features are not great, and it is not suitable for projects that require precision. But for small projects, it serves us well since its lack of accuracy is compensated by its price.

To start, we need the following material:

  • Protoboard (Breadboard as you like to call it)
  • DHT11 Sensor
  • Wiring
  • 5 K resistor
  • Arduino

That’s for the physical part, now we will need software:

The DHT11 sensor looks like this, whether alone or in small modules.

Let’s see the pinout
PINOUT

      DHT11 --> Arduino  
  Patilla 1 --> VCC  
  Patilla 2 --> Patilla entrada arduino ( Ejemplo: patilla 13 del arduino)  
  Patilla 3 --> No se usa  
  Patilla 4 --> GND

Now let’s move on to the software installation. To install a library, what you have to do is unzip “the DHT11 library folder” into the Arduino libraries folder, the folder that in this case is DHT11, which contains 2 files (DHT.cpp and DHT.h) and a folder with examples.

If you have IDE 1.0.5, you don’t need to do it in such a rudimentary way, just go to the Sketch tab » Import library » Add library.

It will be saved directly in the libraries folder.

Close the Arduino IDE, and reopen it to load the libraries into the IDE, and finally, you just have to look for an example from within the library and get it to work.

If you liked the article, you can treat me to a RedBull here