2021-01-29 06:31:58 -05:00
|
|
|
|
|
|
|
[![Arduino CI](https://github.com/RobTillaart/DHTlib/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
|
2021-11-13 13:57:17 -05:00
|
|
|
[![Arduino-lint](https://github.com/RobTillaart/DHTlib/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/DHTlib/actions/workflows/arduino-lint.yml)
|
|
|
|
[![JSON check](https://github.com/RobTillaart/DHTlib/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/DHTlib/actions/workflows/jsoncheck.yml)
|
2021-01-29 06:31:58 -05:00
|
|
|
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/DHTlib/blob/master/LICENSE)
|
|
|
|
[![GitHub release](https://img.shields.io/github/release/RobTillaart/DHTlib.svg?maxAge=3600)](https://github.com/RobTillaart/DHTlib/releases)
|
|
|
|
|
2021-11-13 13:57:17 -05:00
|
|
|
|
2020-11-27 05:10:47 -05:00
|
|
|
# DHTlib
|
|
|
|
|
|
|
|
Arduino library for DHT temperature and humidity sensor. AVR optimized
|
2017-07-27 09:43:45 -04:00
|
|
|
|
2021-11-13 13:57:17 -05:00
|
|
|
|
2017-07-27 09:43:45 -04:00
|
|
|
## Description
|
|
|
|
|
2015-03-01 05:53:47 -05:00
|
|
|
The DHT11, 21, 22, 33 and 44 are relative inexpensive sensors for measuring temperature and humidity.
|
2014-02-10 12:56:10 -05:00
|
|
|
|
2015-03-01 05:53:47 -05:00
|
|
|
This library can be used for reading both values from these DHT sensors.
|
2014-06-26 14:48:20 -04:00
|
|
|
The DHT11 only returns integers (e.g. 20) and does not support negative values.
|
|
|
|
The others are quite similar and provide one decimal digit (e.g. 20.2)
|
2014-02-10 12:56:10 -05:00
|
|
|
The hardware pins of the sensors and handshake are identical so ideal to combine in one lib.
|
|
|
|
|
2014-11-16 08:25:44 -05:00
|
|
|
The library (0.1.13 version) is confirmed to work on:
|
2014-02-10 12:56:10 -05:00
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
- UNO (tested myself)
|
|
|
|
- 2009 (tested myself)
|
|
|
|
- MEGA2560
|
|
|
|
- DUE
|
|
|
|
- attiny85 @8MHz
|
|
|
|
- Digistump Digix @ 84 MHz
|
2017-07-27 09:43:45 -04:00
|
|
|
|
2020-11-27 05:10:47 -05:00
|
|
|
Later 0.1.xx versions are optimized for AVR only.
|
2014-02-10 12:56:10 -05:00
|
|
|
|
2020-04-05 13:52:38 -04:00
|
|
|
More information - http://playground.arduino.cc/Main/DHTLib -
|
2014-10-15 02:00:59 -04:00
|
|
|
|
2020-11-27 05:10:47 -05:00
|
|
|
For latest version for the DHT, check https://github.com/RobTillaart/DHTNEW
|
|
|
|
|
2021-11-13 13:57:17 -05:00
|
|
|
|
2020-11-27 05:10:47 -05:00
|
|
|
## DHT PIN layout from left to right
|
|
|
|
|
2021-11-13 13:57:17 -05:00
|
|
|
| Front | | Description |
|
|
|
|
|:------|:----:|:--------------|
|
|
|
|
| pin 1 | | VCC |
|
|
|
|
| pin 2 | | DATA |
|
|
|
|
| pin 3 | | Not Connected |
|
|
|
|
| pin 4 | | GND |
|
|
|
|
|
|
|
|
|
2020-11-27 05:10:47 -05:00
|
|
|
|
2017-07-27 09:43:45 -04:00
|
|
|
## Operational
|
|
|
|
|
2020-11-27 05:10:47 -05:00
|
|
|
See examples
|
2017-07-27 09:43:45 -04:00
|
|
|
|
|
|
|
|
|
|
|
## Versions:
|
|
|
|
|
|
|
|
==> See DHTStable library for latest stable version for all platforms.
|
|
|
|
|
2021-01-29 06:31:58 -05:00
|
|
|
- version 0.1.13 is the last stable version for both AVR and ARM
|
2021-12-16 10:44:08 -05:00
|
|
|
- version 0.1.14 and up are not compatible any more with pre 1.0 Arduino.
|
|
|
|
These have breaking changes wrt ARM based Arduino's e.g DUE.
|
2021-01-29 06:31:58 -05:00
|
|
|
- version 0.1.15 is stable version for AVR only
|
|
|
|
- version 0.1.16 and 0.1.17 have breaking changes for DHT11
|
2021-12-16 10:44:08 -05:00
|
|
|
- version 0.1.18 works again for DHT11 (AVR only)
|
|
|
|
- version 0.1.19 fixed masking bug DHT11 (AVR only)
|
2021-01-29 06:31:58 -05:00
|
|
|
- version 0.1.20 Reduce footprint (34 bytes) by using int8_t as error codes. (thanks to chaveiro)
|
|
|
|
- version 0.1.21 replace delay with delayMicroseconds() + small fix (thanks to codingforfun)
|
|
|
|
- version 0.1.22 undo delayMicroseconds() for wakeups larger than 8
|
|
|
|
- version 0.1.23 fix https://github.com/RobTillaart/Arduino/issues/31
|
|
|
|
- version 0.1.24 fix https://github.com/RobTillaart/Arduino/issues/33
|
|
|
|
- version 0.1.25 fix https://github.com/RobTillaart/Arduino/issues/80
|
|
|
|
- version 0.1.26 Explicit support for AM23XX series and DHT12
|
2021-12-16 10:44:08 -05:00
|
|
|
- version 0.1.27 added \_disableIRQ flag
|
2021-01-29 06:31:58 -05:00
|
|
|
- version 0.1.28 refactor
|
|
|
|
- version 0.1.29 fix negative temperature DHT12 - issue #111
|
|
|
|
- version 0.1.30 own repo version
|
2021-12-16 10:44:08 -05:00
|
|
|
- version 0.1.31 fix negative temperature DHT22 (code from DHTNew)
|
|
|
|
- version 0.1.32 fix negative temperature DHT22 again (code from DHTNew)
|
|
|
|
- version 0.1.33 fix #6 T-GO signal in handshake. (needed for long wires)
|
|
|
|
- version 0.1.34 fix negative temperature DHT22 again (code from DHTNew)
|
|
|
|
- version 0.1.35 update license, library.json, #pragma once, minor edits
|
|
|
|
|
|
|
|
|
|
|
|
## Future
|
|
|
|
|
|
|
|
- updates only on request basis (bugs)
|
|
|
|
- improve documentation
|
|
|
|
- improve unit tests
|
|
|
|
- constants
|
|
|
|
- move non public part of #defines to .cpp
|
|
|
|
- separate history versions releasenotes file ?
|
|
|
|
-
|
2020-11-27 05:10:47 -05:00
|
|
|
|