DHT Library Compatibility
Temperature and humidity from DHT11 / DHT22 sensors.
- Pinned version
- 1.4.7
- Last matching compile evidence
- 2026-10-25
- Toolchain
- avr-gcc-wasm@0.2.0
- Primary headers
- DHT.h, DHT_U.h
Dependencies and practical limits
Temperature and humidity from DHT11 / DHT22 sensors.
DHT11/DHT22 selection and the Unified Sensor dependency must match the pinned example.
Allow the sensor’s sampling interval and check power, DATA pull-up and pin selection. Modeled values do not certify real sensor accuracy.
Pinned direct dependencies: Adafruit Unified Sensor
For a missing header, first compare the include to the example below. For an undeclared identifier, inspect the first diagnostic and selected board rather than changing every library version.
Board compile matrix
These are recorded compile/link results for the current build and exact source hash. UNTESTED means no matching proof, not an assumed pass. Memory values belong to the listed example and exclude runtime stack/heap or dynamic buffers.
| Board/profile | Result | Flash bytes | Static SRAM bytes | Last tested |
|---|---|---|---|---|
| Arduino Uno R3 — ATmega328P | PASS | 5610 | 219 | 2026-10-25 |
| Arduino Nano V3 — ATmega328P (new bootloader) | PASS | 5610 | 219 | 2026-10-25 |
| Arduino Nano V3 — ATmega328P (old bootloader) | PASS | 5610 | 219 | 2026-10-25 |
| ATmega328PB — 16 MHz | PASS | 5822 | 219 | 2026-10-25 |
| Arduino Mega 2560 — ATmega2560 | PASS | 6362 | 219 | 2026-10-25 |
| Arduino Leonardo — ATmega32U4 · native USB | PASS | 7970 | 183 | 2026-10-25 |
| Arduino Micro — ATmega32U4 · native USB | PASS | 7972 | 183 | 2026-10-25 |
| Arduino Pro Mini — 5 V · 16 MHz | PASS | 5610 | 219 | 2026-10-25 |
| Arduino Pro Mini — 3.3 V · 8 MHz | PASS | 5594 | 219 | 2026-10-25 |
Build: e0f6d304cce4ae0a0989a9b1300cbc1a21a595e5e3e7f57ed0ab3468ecf7940b. Library source hash: e7d7f87221b675f91429265203d4d5df832803ab9e9906a3d86a9e2c0a10b30e. Compilation does not certify physical peripherals, timing or USB upload.
DHT temperature-humidity example
This is the actual pinned example available in Circuitera. Pin choices and wiring in a general example use Uno unless otherwise stated; review the selected board reference for other targets.
#include <DHT.h>
DHT sensor(2, DHT22); // Change DHT22 to DHT11 for that sensor.
void setup() { Serial.begin(9600); sensor.begin(); }
void loop() {
delay(2000);
float temperature = sensor.readTemperature();
float humidity = sensor.readHumidity();
if (isnan(temperature) || isnan(humidity)) { Serial.println(F("Check DHT wiring")); return; }
Serial.print(temperature); Serial.print(F(" C, "));
Serial.print(humidity); Serial.println(F(" % RH"));
}
Projects using DHT
Upstream source and documentation ↗
Pinned source archive (1.4.7) ↗
Read the test methodology →