Write-up in progress. In fact the data are still being collected (Feb 2016). Expect results here on a timescale of a couple of months.

Wide range of Hygrometers:
DHT22, AM2302, AM2320, AM2321, SHT71, HTU21D, Si7021, BME280

Contents

 

Introduction

Previous experiments looked at comparing a set of six Aosong DHT22/AM2302 and compared the Aosong DHT22/AM2302 with the Aosong DHT11 and Sensirion SHT71. Here I have added five new devices meaning this test now covers most commonly available low-cost digital hygrometers. This page will present only new results. For details of how the experiment works, please refer to the previous write-ups.

 

The devices now included are:

The DHT11 is clearly a different class of sensor with substantially lower specification and has been dropped from further investigation. In my tests it performed perfectly well with respect to its specification, but I am only interested in devices designed to read the full range 0–100% RH.

Image of all the devices before installation
Figure 1. Comparison of the packaging of the various devices. Clockwise from the top left, the SHT71 and AM2321 both use 1.27mm pitch pins. The AM2320 is, I think, the same as the AM2321 but in a package that is compatible with the AM2302. The devices on the lower row are all shown mounted on third party break-out boards that make it easy to interface the surface mount device to 2.54mm pitch boards. The sensor itself is the small square component in the top right of each board. Note that the break-out boards at the bottom left are marked to accept Si7021, SHT21 or HTU21. The right hand device (without the white protective cover) is an HTU21D. The membrane obscures the manufacturer's mark on the left hand device, but from reading the internal serial number I believe it to be an Si7021.

The Devices and Test Apparatus

Aosong AM2302

Also commonly known as DHT22. Two devices (E & F) from my previous experiments have been included. Device E was selected as the best of the six I originally started with. [AM2302 datasheet]

Aosong AM2320 & AM2321

The AM2320 is effectively the latest version of the AM2302 with the addition of an option to communicate over I2C interface. It is physically a little smaller, but with identical pin-out. The one-wire serial of the AM2302 is retained making this a simple drop-in replacement. [AM2320 datasheet]

The AM2321 appears to be the same but in a much smaller physical package and narrower pin pitch. It might be electrically identical. There is some suggestion from the manufacturer's web site that this might already be discontinued and replaced by AM2322. I am not sure. [AM2321 datasheet]

The sensing elements in these are likely the same as each other and I presume similar to the AM2302/DHT22. The internals of these devices are not exactly the same as the DHT22 because they do not exhibit the very distinctive sawtooth behaviour around 25°C.

Sensirion SHT71

The same device as was used in previous tests. [SHT71 datasheet]

Measurement Specialties HTU21D & Silicon Labs Si7021

I discuss these together though they are distinct devices from two different manufacturers. In normal use they are interchangeable both in terms of specification and communications protocols and even have the same I2C address so are drop-in replacements for each other. Similarly the Sensirion SHT21 (not included here) also has a near identical specification and interface. I have seen the same third party generic break-out boards being sold with any one of these devices attached. (See Figure 1.) The one difference I have found and possibly the only way to be sure which device you have is in the devices' unique serial numbers for which each manufacturer uses a slightly different format, detailed in their respective datasheets. So long as you do not attempt to read the device serial number, these three sensors function identically. That is not to say they will all perform identically. Though equivalent for most normal use, the precise specification details do differ. [HTU21D datasheet, Si7021 datasheet]

An interesting feature of the SHT21, HTU21 and Si7021 is that they are available in options with or without a protective PTFE membrane over the sensing element. For this test I am running one device each, with and without. (See Figure 1.) The intent had been to include an identical pair of sensors with and without the cover, however when my devices arrived I found the retailer had sent me HTU21s without the cover and Si7021s with the cover. Functionally the sensors are identical, but it does mean that I do not have a perfect like-for-like comparison of the same device with and without the cover.

Bosch BME280

This device is a bit different. First, unlike all the other devices tested it includes a barometer. Though an interesting addition and I will write about it elsewhere, for the present report I present only the temperature and humidity data.

Second, it possibly works on an entirely different physical principle from the other sensors here. As far as I have been able to acertain, all the other devices are polymer capacitance hygrometers. The Bosch website, datasheet and press releases contain no information that I have been able to find about what is inside the BME280 other than an implication that it is a MEMS device. Sensortec is specifically the MEMS subsiduary of Bosch. So what actually is a MEMS hygrometer? I can imagine a tiny dew-point hygrometer constructed in a MEMS, but have no idea if that is really what it is. Alternatively the sensor could still be a capacitance device. The list of technical capabilities advertised on the Sensortec website seem suitable for building such a device into an integrated unit with a MEMS barometer. If anyone can enlighten me on what is inside the BME280 I would be most interested.

The datasheet has no accuracy specification outside the range 20%<RH<80%, but my past experience from other Bosch Sensortec devices is that the specifications are rigourous and conservative. They seem to under-promise and over-deliver, so a priori I am not expecting problems outside the specified range. [BME280 datasheet]

As previously demonstrated for other sensors (DHT22, SHT71), driving this device too fast can lead to self heating. Contrary to the other devices though, this can occur straight out of the box, in the factory default configuration. In its default configuration, rather than taking a reading on demand, 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. For the present experiment speed is of no consequence and I operated at 1 sample/sec.

Manufacturers' Specification
AM2302 AM2320/AM2321 SHT71 HTU21D Si7021 BME280
Operating Range 0–100 0–100 0–100 0–100 0–100 0–100
Absolute accuracy
(%RH, 25°C)
±3% (10-90%)
±5% (<10, >90%)
±3% (10-90%)
±5% (<10, >90%)
±3% (20-80%)
±5% (<20, >80%)
±3% (20-80%)
±5% (<20, >80%)
±3% (0-80%)
±5% (>80%)
±3% (20-80%)
Repeatability (%) ±0.3 ±0.1 ±0.1 - ±0.025 -
Long term stability
(% per year)
0.5 0.5 0.5 0.5 0.25 0.5
1/e Response (sec) 5 5 8 5 18 (with cover)
17 (without)
1
Voltage supply (V) 3.3–5.5 3.1–5.5(AM2320)
2.6–5.5(AM2321)
2.4–5.5 1.5–3.6 1.9–3.6 1.71–3.6
The table lists values taken from datasheets. The Aosong data sheets do not specify maximum tolerances for most parameters, just 'typical' values. It would therefore seem that any particular device is not guaranteed to meet these specifications. For all the other devices the numbers above are the maximum tolerances and most also offer better 'typical' specifications.

The Test Apparatus

Apparatus setup is essentially as previously described though a new board had to be built to hold nine devices inside the jars. The AM2302 and SHT71 devices have proprietary one-wire serial interfaces and were addressed independently, each using a separate GPIO pin as in the previous experiments. All the other sensors were multiplexed onto the I2C bus. I2C is able to address multiple devices on a single bus so long as each has a different address, but since I have multiple samples of the same device I am not able to identify each one uniquely. I therefore use a TI CD4051 8x1 multiplexer so that only one of the devices is connected to the I2C bus at a time. The devices are powered continuously, but the I2C IO lines are briefly connected to each device in turn. This would not have been required if I had only one each of the different device models.

The reference calibration sources are the same as before, eleven saturated solutions and distilled water. Sensors were allowed to stabilise for a few hours with each solution. The software automatically steps the temperature over a pre-defined range, allowing the readings to settle at each temperature and logging a reading to a database before stepping to the next temeperature.

Response Speed

Results pending.

Protective Cover on HTU21D / Si7021

It seems reasonable to expect the devices with a protective cover over the sensor would respond more slowly. Though I do see a marginally slower response, the difference is really very small and on balance I would suggest that including the cover should generally be the default choice. The compromise of accepting a response that is just a few seconds slower whilst gaining protection of the sensor element from contamination seems very sensible. Example data to follow.

 

Results

Throughout the following plots you will notice the data for sensor G are a little more sparse than the others. Both my AM2320 devices fail intermittently above about 60% RH. At low humidity they consistently give valid data but at higher humidities they frequently just return zeroes. I never found the cause. At least the values are obviously wrong and an extra function was added to the microcontroller code to simply reject the bad data. The others all continue uneffected but values were only logged from this sensor when they were sensible.

Part 1: As a Function of Humidity

First we look at the varying response of the sensors to different reference humidities 0–100%. Figures 3 and 4 contain the same data plotted with different axes. Figure 3 shows the actual relative humidity values measured and Figure 4 shows the deviations from a perfect calibration. The manufacturers' specifications are all defined at 25°C so I highlight those data in red. Data obtained at other temperatures are shown in blue.

It is vital to note that data are still being collected so no conclusions should be drawn yet from any of these data. The fits are currently a little unconstrained at the high end. The plots will be updated as data become available.

Plots of measured vs. reference humidity for the nine hygrometers
Figure 3. PRELIMINARY. STILL COLLECTING DATA. Plots of the humidity values from each sensor plotted against the expected humidity for each reference solution. The shaded grey region is the specified tolerance from the manufactuers' datasheets. All data collected, irrespective of temperature, are shown as blue dots. Red crosses are just those data obtained at 25±1°C, so any that lie outside the shaded region fail to meet the specification. These same data are presented in more detail in Figure 4.

 

Plots of measured vs. reference humidity for the nine hygrometers
Figure 4. PRELIMINARY. STILL COLLECTING DATA. Plots showing the deviation of humidity values from the known reference value. These plots show the error of each sensor as a function of humidity. The shaded grey region is the specified tolerance from the manufacturers' datasheets. All data collected, irrespective of temperature, are shown as blue dots. Red crosses are just those obtained at 25±1°C, so any that lie above or below the shaded region fail to meet the advertised specification. Where blue dots scatter outside the shaded region it indicates a drift in the calibration as a function of temperature. Red lines are quadratic fits to the 25±1°C data.

Both of the above figures have equivalents in previous test runs where you can see earlier results for SHT71 and AM2302 E, F. The other six are new and this is their first test.

Part 2: As a Function of Temperature

In Figure 4 the red data are measured at 25±1°C and the blue data at other temperatures. Device E (an AM2302/DHT22) performs very well at 25°C, easily achieving the advertised specification. The large scatter of the blue points however show that the calibration degrades rapidly with varying temperature. As previously noted, this is my cherry-picked, best AM2302 from a sample of six. In contrast, device K (an HTU21D) seems to lie just slightly outside its specified tolerance at 25°C but has the very substantial advantage of behaving consistently over temperature. In different applications, absolute accuracy at 25°C or a small temperature dependence might be preferable. Easily the best performers though are the BME280 which are both accurate and consistent over the range tested.

To show those differences in more detail I present plots for a single chemical as the temperature is systematically varied. Included are NaCl, NH4NO3 and MgCl. NaCl (RH∼75%) and MgCl (RH∼33%) conveniently span the range of commonly encountered humidity and both exhibit especially small thermal coefficients meaning the humidity should be almost independent of temperature. NH4NO3 lies between the other two (RH∼65%) and is included as a contrast because it is my one chemical with a strong intrinsic thermal coefficient. The humidity axis has been set to a range of 25% in all three plots in order to fairly represent the relative gradients of the lines. Links are also provided to the equivalent three plots in the previous DHT22/DHT11/SHT71 comparison. Devices E, F and SHT71 are the same units there and here. They have remained fairly consistent over the six months between the two experiements.

The red square box points and red line fit are my measurements. The smaller, round data points are the published reference values.

Plots showing thermal dependence of sensor output. Measured humidity vs. temperature.
Figure 5. Shown as red boxes and a linear fit are measurements for all sensors with saturated sodium chloride over the temperature range 10–35°C. Plotted for comparison are values taken from the published literature. Blue data are from Greenspan (1977), cyan data from O'Brien (1948), green from Rockland (1960) and yellow, Wexler (1954). The thin black line is an ensemble fit to them all, weighting all equally.

Plots showing thermal dependence of sensor output. Measured humidity vs. temperature.
Figure 6. Shown in red boxes and a linear fit line are measurements for all sensors with saturated ammonium nitrate over the temperature range 10–35°C. Plotted for comparison are values taken from the published literature. Cyan data from O'Brien (1948) and yellow from Wexler (1954). The thin black line is an equally weighted fit to both.

Plots showing thermal dependence of sensor output. Measured humidity vs. temperature.
Figure 7. Shown as red boxes and a linear fit are measurements for all sensors with saturated magnesium chloride over the temperature range 10–35°C. Plotted for comparison are values taken from the published literature. Blue data are from Greenspan (1977), cyan data from O'Brien (1948), green from Rockland (1960), magenta are the CRC Handbook (1977) and yellow, Wexler (1954). The thin black line is an ensemble fit to them all, weighting all equally.

The BME280 shows outstanding calibration throughout. For the other sensors, where the slope of my data matches the slope of the reference data (e.g., NH4NO3 panel K), that device shows good thermal compensation and simply has a constant offset. Where the slopes of the measurements and reference data differ (e.g., MgCl panel K), the device is showing varying errors as the temperature changes.

Part 3: As a Function Simultaneously of Temperature and Humidity

Finally, if a sensor is to be used to measure humidity under a range of varying temperatures a full bivariate calibration is required. Such a calibration over the rather moderate temperature range 10 < °C < 35 is shown in Figure 8. The curves in Figure 4 are effectively cross sections through these surfaces.

3D surface plots representing the error as a surface in temperature-humidity space.
Figure 8. INCOMPLETE AT HIGH HUMIDITIES. DATA STILL BEING COLLECTED. Surfaces showing deviation of each sensor from the true relative humidity as a function of temperature and humidity. A 'perfect' sensor would be a featureless green-yellow plane at zero. Blue shows low readings and red are high. The fits in Figure 4 are cross sections through these surfaces at T=25°C.

Figure 8b. INCOMPLETE AT HIGH HUMIDITIES. DATA STILL BEING COLLECTED. Surfaces showing deviation of each sensor from the true relative humidity as a function of temperature and humidity. A 'perfect' sensor would be a featureless green plane at zero. Blue shows low readings and red are high. The fits in Figure 4 are cross sections through these surfaces at T=25°C.

AM2321 J TBD.
HTU21D TBD.
Si7021 TBD.
BME280 M TBD.
Figure 8c. INCOMPLETE AT HIGH HUMIDITIES. DATA STILL BEING COLLECTED. Surfaces showing deviation of each sensor from the true relative humidity as a function of temperature and humidity. A 'perfect' sensor would be a featureless green plane at zero. Blue shows low readings and red are high. The fits in Figure 4 are cross sections through these surfaces at T=25°C.

 

Temperature Accuracy

I am primarily interested in humidity, but present a brief comparison of the temperature values. I made no attempt to establish an absolute temperature calibration and simply compare each sensor to the ensemble average of all nine sensors.

Figure 9. PRELIMINARY. STILL COLLECTING DATA. Plots show temperature returned by each device compared to the average of all nine. The black line is just 'sensor = ensemble mean' as a visual guide, not a fit.

Figure 10. PRELIMINARY. STILL COLLECTING DATA. Plots show deviation of each device's temperature from the average of all nine.

 

Commentary on Each Sensor

Bosch Sensortec BME280

Within the data obtained here, the BME280 is the undisputed winner. It is the most accurate at the specified 25°C and it shows the least dependence on temperature. It is also the only model for which every device I own performs within specification. The difference is so stark that it leads me to believe the sensing element is in some way fundamentally different from the other devices, but I do not know what the sensing element actually is.

My two BME280s do consistenly read a higher temperature than all the other devices, though I have no absolute reference to say what is correct. What is certain is that the BME280s show more scatter in their temperatures than any of the others. Again I wonder if this suggests the hygrometer is some form of dew point sensor that involves a heating element. In any case, they fulfill the manufacturer's specified 0.5°C tolerance.

AM2302 (DHT22)

In line with previous tests, I would judge the accuracy of my devices to be around 5%. Device E, cherry picked from my set of six, has a calibration at 25°C that is almost the equal of any device ever tested, but it shows a strong temperature dependence when away from thise ideal conditons. Over two years, three of the original six devices have failed.

AM2320 / AM2321

The devices I have tested appear very similar to the DHT22 in overall performance, simply adding the convenience of I2C. Both my AM2320s exhibit the same intermittent fault above around 65% RH. I never got to the bottom of whether this was something wrong in my set up or an intrinsic sensor fault. Currently I am attributing it to bad luck in my getting a couple of faulty devices rather than a systematic fault with this model, particularly given my suspicion that the internals of the AM2320 and AM2321 are almost identical and my AM2321 is working OK.

Sensirion SHT71

Nothing to add beyond my previous experiments with this device. Accuracy seems very comparable to the other sensors apart from the BME280. Temperature stability, which I think it often more important, is equal or better than most. It seems well made and has not yet shown any problems in two years of continuous operation.

Measurement Specialties HTU21D

I have nothing much specific to say about this, but I mean that in a good way. In my tests it did exactly what it was supposed to. The absolute errors were a little larger than advertised, but repeatability was good and the temperature dependence not too severe. It is a nice compact and apparently robust unit, especially with the optional cover screen. Like the Si7021 and SHT71, it seems a solid choice and within the constraints of this test, only having one specimen of each model, I am unable to distinguish any advantage beween them.

Silicon Labs Si7021

I have nothing much specific to say about this, but I mean that in a good way. In my tests it did exactly what it was supposed to. The absolute errors were a little larger than advertised, but repeatability was good and the temperature dependence not too severe. It is a nice compact and apparently robust unit, especially with the optional cover screen. Like the HTU21D and SHT71, it seems a solid choice and within the constraints of this test, only having one specimen of each model, I am unable to distinguish any advantage beween them.

Conclusion

The BME280 delivered easily the best results. The test is potentially unfair though given that they were brand new and are being compared against two-year old DHT22s and SHT71. I have not had much luck with reliability of the DHT22s, but the Sensirion SHT71 has proven itself dependable over two years so far.

If you have comments or suggestions feel free to contact me. robert -AT- kandrsmith.org


References: See here.

Acknowledgments

Though I designed and integrated the entire experiment, I must acknowledge the many open source projects, both software and hardware, that I used.

Almost vaguely related and possibly of interest is monitoring radon in the house.