DHT11 or DHT22
The DHT22 reads −40 to 80 °C to ±0.5 °C and 0 to 100 % humidity to ±2 %, in tenths. The DHT11 stops at 0 °C and is worth ±2 °C and ±5 %. Same board, same three wires, same library: what the white cage buys is range and precision, and it only matters once something acts on the number.
Where the two ranges end
Move the marker to the coldest the sensor will ever see, then say what the number is for.
The range is the hard limit. Aosong gives the DHT11 0 to 50 °C and says nothing about what it does below that, so a DHT11 in a freezer or a winter garden is outside its specification with no way for your sketch to know. The DHT22 goes down to −40 °C, and it has a sign bit to say so: tenths and the sign bit is how the minus arrives.
The accuracy is the soft limit. It costs nothing on a display you glance at and a great deal on a graph, where ±2 °C is wider than most of the change you wanted to see.
The numbers
Every row is from the two datasheets, the DHT22's in its §3 and §7.
| DHT22 · TK39 | DHT11 · TK38 | |
|---|---|---|
| Temperature | −40 to 80 °C | 0 to 50 °C |
| Temperature accuracy | ±0.5 °C | ±2 °C |
| Steps | 0.1 °C, 0.1 % | 1 °C, 1 % |
| Humidity | 0 to 100 % RH | 20 to 80 % RH |
| Humidity accuracy | ±2 % typical, ±5 % max | ±5 % |
| Supply | 3.3 to 6 V | 3 to 5.5 V |
| One reading every | more than 2 s | 1 s |
| Cage | white | blue |
Two of those rows carry a catch.
The DHT22's ±2 % is its typical humidity accuracy. The same line of the datasheet gives ±5 % as the maximum, and adds a repeatability of ±1 % and a drift of up to ±0.5 % a year. So two DHT22s agree better with themselves over a week than with each other on day one.
The supply starts at 3.3 V, not the DHT11's 3 V. A 3V3 pin is the bottom of the DHT22's range, which is fine and leaves nothing spare; the first reading wires it there anyway, because the data line has to idle at your board's logic voltage.
The rule
Look at the number: either. A display in the hallway, a first sketch, a demonstration. The kit has three of each, and a DHT11 is the one to make mistakes on.
Plot it, or let it switch something: DHT22. A log you will compare with last week, a fan, a heater, a dehumidifier. With ±2 °C the graph shows the sensor rather than the room.
Below 0 °C, or in air near saturation: DHT22. The DHT11 is not specified below 0 °C, and its own board prints 20 to 80 % RH.
What does not change
The board, the wiring, the library and the protocol. The TK39 and the TK38
are the same circuit with a different sensor on it, so everything the DHT11
book explains about the four pins, the start
pulse and the forty bits is true here too, and this book does not repeat it.
One word in the sketch differs, DHT22 for DHT11, and getting it wrong
does not fail: the wrong type
shows what it prints instead.
When it does not work
That is inside the datasheet's ±0.5 °C for each of them, so they may legitimately be a whole degree apart. Put them side by side, away from anything warm, for half an hour before deciding either is faulty.
It is the typical figure. The same line of the datasheet's specification gives a maximum of ±5 % RH, which is what the DHT11 manages typically. Plan around ±2 % for comparing readings from one sensor over time, and around ±5 % for trusting one reading absolutely.
Its range goes down to −40 °C, so the cold is fine. The datasheet's warnings are about water and light: avoid using it where dew forms on it, and keep it out of long exposure to strong light and ultraviolet. A vented, shaded box that rain cannot reach is the usual answer.
No. Aosong's datasheet is titled DHT22 and says AM2302 is another name for it. The cages in the DHT sensor kit are printed AM2302 DHT22, and the library type is DHT22 either way.
The TK39 part by part: the sensor lying flat, the pull-up under it, and the holes you wire and the ones you do not.
What is on the board →Edit this page — content/books/dht22/dht11-or-dht22.mdx
Questions about this product
See what other owners have asked, and read their solutions.
This page covers several products. Choose yours to see the right discussions.
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.