Skip to content
Efficient DHT library for Arduino
C++
Branch: master
Clone or download
Mark Ruys
Latest commit cd24ce3 Oct 10, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples/DHT_Test Attempt to implement strings in PROGMEM Jun 14, 2013
DHT.cpp Merged master fixed conflict. Oct 10, 2016
DHT.h Add a resetTimer method Aug 11, 2013
README.md Updated readme (2) Jun 12, 2013
keywords.txt Added Fahrenheit conversion functions Jun 12, 2013
license.txt Initial release Jun 10, 2013
readme.pdf Updated readme (2) Jun 12, 2013

README.md

DHT

An Arduino library for reading the DHT family of temperature and humidity sensors.

Written by Mark Ruys, mark@paracas.nl.

Features

  • Support for DHT11 and DHT22, AM2302, RHT03
  • Auto detect sensor model
  • Low memory footprint
  • Very small code

Usage

#include "DHT.h"

DHT dht;

void setup()
{
  Serial.begin(9600);

  dht.setup(2); // data pin 2
}

void loop()
{
  delay(dht.getMinimumSamplingPeriod());

  Serial.print(dht.getHumidity());
  Serial.print("\t");
  Serial.print(dht.getTemperature());
}

Also check out the example how to read out your sensor. For all the options, see dht.h.

Installation

Place the DHT library folder in your <arduinosketchfolder>/libraries/ folder. You may need to create the libraries subfolder if its your first library. Restart the Arduino IDE.

You can’t perform that action at this time.