/SimpleDHT

Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht

Primary LanguageC++MIT LicenseMIT

SimpleDHT

Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22.

  1. Simple: Simple C++ code with lots of comments.
  2. Stable: Strictly follow the standard DHT protocol.
  3. Fast: Support 0.5HZ(DHT22) or 1HZ(DHT11) sampling rate.

Usage

To use this library:

  1. Download the zip from specified version: https://github.com/winlinvip/SimpleDHT/releases
  2. Import to Arduino: Arduino => Sketch => Include Library => Add .ZIP Library...
  3. Open example: Arduino => File => Examples => SimpleDHT => DHT11Default
  4. Connect the DHT11 and Upload program to Arduino.
  5. Open the Serial Window of Arduino IDE, we got the result as following.
=================================
Sample DHT11...
Sample OK: 19 *C, 31 %
=================================
Sample DHT11...
Sample OK: 19 *C, 31 %
=================================

Remark: For DHT11, no more than 1 Hz sampling rate (once every second).

Remark: For DHT22, no more than 0.5 Hz sampling rate (once every 2 seconds).

Sensors

Examples

This library including the following examples:

  1. DHT11Default: To sample the temperature and humidity.
  2. DHT11WithRawBits: To sample the temperature and humidity, output the 40 raw bits.
  3. TwoSensorsDefault: To sample two sensors.
  4. DHT22Default: To sample the temperature and humidity.

Links

  1. adafruit/DHT-sensor-library
  2. Arduino #4469: Add SimpleDHT library.
  3. DHT11 datasheet and protocol.
  4. DHT22 datasheet and protoocl.

Winlin 2016.1