How fast are AM23xx(DHT22), SHT71 and BME280?

Introduction

There are two parts to this question and they are not at all the same thing.

Reading AM23xx / DHT22 too fast

The datasheets for all the Aosong AM23xx and DHT devices are explicit that the quickest they should be polled is once every 2 seconds. What is not made clear is that you can get numbers out of the device much quicker than that, but they are likely wrong. I have seen several cases around the internet of people making this easy mistake. The fastest I have been able to poll my AM2302 devices is about 350 msec, but as demonstrated in Figure 1, when you push the device this hard it starts to heat up and skews the result. The sensor itself is probably still working perfectly however as the device heats up it warms the air around the sensor and that genuinely suppresses the relative humidty. It may be correctly measuring the relative humidity local to the sensor, but that is not representative of the surrounding environment.

Plot showing correlation of errors in humidity and temperature with how fast the device is read.
Figure 1. Two AM2302 devices (E, F) sealed in the NaCl test jar and being polled on a timescale of 10s or the fastest I could, 350ms. When running fast the measured temperature rises about 0.4°C and causes an error in the humidity measurement. Sensors were running at 3.3V.

When polling as fast as I can (∼350ms) the measured temperature increases about 0.4°C and the measure humidity drops to about 0.97 of what it was reading when running slowly at equilibrium with the environment. That is not a huge error, and for NaCl, the test conducted here, causes the measurement to drop from the correct 75% to about 73%.

For this test I was running the DHT22/AM2302 at 3.3V, the minimum recommended voltage. If you run at 5V you may find the device self-heats considerably more and causes a much greater error. The data here are for teh AM2302, but based on statements in the data sheets, I assume all the AM23xx devices will be similar.

It is not fair to call this a 'fault' of the sensor. First, it is inevitable that running a current through any device is going to heat it up. Second, trying to read the sensor that fast is actually pointless anyway and has no advantage. Though the output is a digital value, the hygrometer element itself is an inherently analogue device and takes a certain amount of time to respond to changing environment. The humid air needs time to permeate the sensing element. The data sheets specify a 1/e response (time to reach 63% of any imposed step change in conditions) of 5 seconds and that is with forced air flow. If the sensor itself cannot 'see' a change happen faster than that, there is nothing to be gained by polling it faster than that.

Do not read the device faster than the data sheet specified 2 seconds.

SHT71

The same effect may be seen with the SHT71. Figure 2 shows readings from the SHT71 when alternating between the fastest I can read it (∼315ms) and 10 seconds. The plot is close to a pure square wave whereas in Figure 1 it can take almost half an hour sometimes to settle at the new level, again illustrating that the SHT71 seems quicker to respond and lower noise. The temperature on the SHT71 is alternating by 0.3°C in comparison to 0.4°C for the DHT22 and the reading being reduced to 0.98 of what it should be so it would seem to be just marginally less effected by self heating than the DHT22.

Plot showing correlation of errors in humidity and temperature with how fast the device is read.
Figure 2. The SHT71 sealed in the NaCl test jar and being polled on a time cycle of 10s or the fastest I could, 315ms. When running fast the measured temperature rises about 0.3°C and causes an error in the humidity measurement. Sensor was running at 3.3V.

Running at maximum speed, the device self-heated by 0.3°C and suppressed humidity to 0.98 of the surrounding ambient humidity. Running at 1 second cadence heated by 0.1°C with a humidity reading of 0.996 and running at 2seconds caused 0.04°C heating and a humidity reading of 0.998 of ambient. Though there is no suggested rate in the SHT71 datasheet, I would suggest that like the DHT22, it not be read more frequently than about two seconds. This is not a significant limitation. The specified sensor response for the reading to reach 63% of a step change in the envirnonment conditions is eight seconds so there is generally no reason to read values faster than that.

BME280

The same effect is seen on the BME280. This is a little different though in that it can occur straight out of the box in the factory default configuration, rather than through the user trying to push it too fast. In its default configuration, the device continuously reads values as fast as it can, returning the latest available value on request. The sampling rate is controlled by setting the 0xF5 memory register and the various speed options are defined in the datasheet. When running at the default full speed my device returned temperatures 0.5°C warmer than when running at one sample per second. At one sample per second values agreed with the polled operating mode where the device was put to sleep between readings.

At 0.5°C, the BME280 has the strongest self-heating of all my tests, but I do not see that as a major flaw. First, the BME280 is also by far the fastest, offering a maximum sampling rate well over 100Hz. It also claims the fastest 1/e reponse time of all the sensors making faster reads useful. The real value of the fast sampling is the device's built-in oversampling and filtering which uses the high sampling rate and smoothing algorithms to produce cleaner output values. Since I am only logging data once per minute, I set the internal sampling rate to 1Hz and see no heating effects.

Back to the index of all my hygrometer testing.