Arduino-library for DHT11/DHT22 sensors reading
C++ Arduino
Switch branches/tags
Nothing to show


This is an Arduino-library for easy reading of temperature/humidity sensors based on DHT11, DHT22 (aka Aosong AM2302).

The library is compatible with Arduino Software version 1.x as well as old 0.x.


Library is heavily based on publication at

Encapsulation in a reusable library, some code-size optimization and few fixes are done by Amperka Team (

Installation and Usage

Copy lib/dht directory to /path/to/your/arduino-ide/libraries

Usage example is in src/example.ino

If you prefer to work in console and have ino installed:

# checkout the library
git clone
cd dht

# build, upload and run serial monitor
ino build
ino upload
ino serial


The code is provided in terms of MIT license: