Home / 1_libraries / arduino-DHT-master
Name Modified Size InfoDownloads / Week
Parent folder
examples 2016-03-12
DHT.cpp 2013-08-25 4.6 kB
DHT.h 2013-08-25 2.4 kB
keywords.txt 2013-08-25 904 Bytes
license.txt 2013-08-25 1.6 kB
README.md 2013-08-25 1.2 kB
readme.pdf 2013-08-25 41.3 kB
Totals: 7 Items   51.9 kB 2

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.

Source: README.md, updated 2013-08-25