DHT sensors/The three limits/08. How slowly it catches up
The three limits · 08 of 12

How slowly it catches up

The element has to physically warm up and take on moisture before it can report a change, which takes about six seconds to get most of the way and half a minute to arrive. And a sensor sitting on a warm board does not settle late — it settles wrong.

It is a sponge, not a needle

Change the temperature and watch the reading follow it.

Catching up with the room
τ = 6 s
How fast this one responds
Where it is mounted
Elapsed
0 s
Reading
20.0 °C
Still behind by
6.0 °C
It is a sponge, not a needle. The element has to physically warm up and take on moisture before it can report a change, which takes about 6 seconds to get two thirds of the way and roughly three times that to arrive. Move a sensor into a new room and the first several readings are about the old one. Nothing in software fixes this; the fix is to leave it there.

The humidity element is a film that has to absorb or release water before its capacitance means anything, and the temperature element has to physically reach the temperature it is reporting. Both take time, and it is not a small amount of time by the standards of a sketch.

Aosong gives the DHT11 a response time of six seconds typical and thirty seconds maximum, measured at 25 °C in air moving at one metre per second. That is the only measured response time either datasheet carries — the DHT22's gives none — so those are the figures the curve above uses, and still air is slower than moving air.

What follows from it

Reading every two seconds is pointless. The sensor cannot change that fast. Ten seconds for a display, a minute for a log, and the graph looks the same.

The first few readings after moving it are about the last room. Carry a sensor from a warm hallway to a cold garage and it will report the hallway for half a minute. Anything that makes a decision on the first reading after a power-up is making it on stale physics.

Breathing on it to test it works — and it does — but the recovery takes minutes, not seconds. Humidity comes back down much more slowly than it went up.

The other half: where you put it

The delay is annoying. The offset is worse, because it never goes away.

A sensor plugged straight into a breadboard beside a voltage regulator, or mounted on a board next to a USB socket, is thermally attached to something that is turning power into heat. It settles perfectly happily — to the wrong number. A degree or two high is usual, and waiting longer makes it worse rather than better.

The fix is three long jumper wires and a sensor hanging in free air, away from the board, out of direct sunlight, and not inside an enclosure with anything warm in it. Aosong says the same thing in the datasheet's cautions, in more words: mount it as far as possible from parts that generate heat.

That single change usually does more for accuracy than choosing the DHT22 over the DHT11 — a well-placed DHT11 beats a DHT22 sitting on a regulator.

When it does not work

It reads two or three degrees higher than my thermometer

Almost always self-heating. The sensor is measuring the board it is plugged into, not the room, and a breadboard next to a regulator or a USB socket runs warm. Move it away on three long jumper wires and give it a few minutes.

The humidity reads low as well

Same cause. Relative humidity is measured against what the air could hold at its current temperature, so a sensor that thinks it is two degrees warmer than it is also thinks the air is several per cent drier than it is. Fix the temperature and the humidity follows.

I breathed on it and nothing happened for ages

That is the response time, and it is real: roughly six seconds to get two thirds of the way to the new value at 25 °C in moving air, and up to thirty to finish. In still air it is slower. Nothing in software speeds this up.

Two sensors in the same room settle to different numbers

Check they are mounted the same way first — one on a board and one in free air will genuinely disagree. If both are in free air and both are DHT11s, ±2 °C each means four degrees of legitimate disagreement. Two DHT22s should land within a degree of each other.

Where this goes next

The supply pin decides what the data pin idles at, and that is the one wiring mistake with a cost.

3.3 V or 5 V

Edit this page — content/books/dht22/how-slowly-it-catches-up.mdx

Community

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.

Browse Modules and blocks on the forum