Temperature Sensing with DHT11 on Arduino

Ahhh temperature sensing, something so simple yet can be integrated into so many different projects. How about a temperature controlled RGB LED? Or perhaps an Arduino controlled thermostat? Heck, even a full blown weather station! Your imagination is the limit.

There are a few different choices when it comes to temperature sensing such as a completely water proof analog temperature probe to digital sensors. I will be focusing on the DHT11 which is a very affordable (~$1) digital temperature and humidity sensor. Its good for sensing 20% to 80% humidity within 5% accuracy, and 0c to 50c within 2% accuracy, which is more than enough for any indoor projects. If you want something a little more capable and accurate, the DHT22 is another option for digital sensors.

dht11-temperature-sensing

 

The DHT11 has 4 pins in total as seen above (with 0.1″ spacing – perfect for breadboards). VCC, a Data pin, and Ground. Pin 3 is not used.

temperature-sensing-arduino

Wiring it up is fairly straight forward. Start by connecting VCC on the DHT11 to VCC on your Arduino, and Ground to GND. Next connect the DHT11 data pin to pin 10 on the Arduino. Lastly, we need a 10k (Brown Black Orange) resistor in parallel to the DHT11 connected between the VCC and Data pins. This is our pull up resistor.

Now its just a matter of uploading our sketch and checking the output in the serial monitor

Now, with a little heavy breathing on the sensor, we should be able to see it change every few seconds (specifically the humidity… its a little harder to breath temperature changes), but they both will work!

temperature-sensing-serial-console

Leave a Reply