Humidity Sensor Shootout

If you want to measure humidity (and temperature, and maybe even barometric pressure) in a device that you’re building, have a look at this comprehensive test of seven different options. We’re going to summarize the results here, but you’ll really want to read up on the testing methodology — it’s great science hacking. Did you know about using saturated salt solutions to produce constant humidity levels for calibration? We didn’t.

The eBay hacker favorite, the so-called DHT22 module, doesn’t fare all that well, with one of six that [Robert] tested being basically horrible, and three of them breaking within two years of use. The one that works well, however, is pretty good. Feeling lucky?

The Bosch BME280 looks great. It costs a bit more as a bare part, and a few times more than that when it is mounted on a friendly module, but it seems to be very reliable. And you get a barometer thrown in for the extra work. Indeed, it performed so well that Hackaday contributor [Nava Whiteford] put the part under a scanning electron microscope to figure out what’s going on.

The other sensors were fine, with the HTU21D and SHT71 being standouts for their ultra-fast response. For the full details, go click on that link at the top. Having just installed a sextet of DHT22s in our house last year, we’re left with that sinking feeling that we may have gotten what we paid for, which wasn’t much. At least they’re all still running.

Thanks to [Dodutils] and [mac012345] via comments in another thread.

39 thoughts on “Humidity Sensor Shootout

      1. I also thought about that. I read them 20 times a second or so for my evaluation. But this happened with 2 s interval as well. They report 25 deg C whereas other thermometers indicate 22.
        I got them from Aliexpress (GY-BMP280 modules), so maybe they’re, um, not from Bosch? But then again, it’d be quite hard to replicate them exactly.

          1. Also bought bme280 modules from ali and see the same issue in all of them (bought 5). Next to another bme180, the bme280 from ali report about 2 Celsius higher. Since the humidity calculation from the bme280 is dependent on its measured temperature, it’s also incorrect. So as someone else mentioned, I should probably get a few from reputable sources and compare…

          2. I have seen a lot of comments both here and in private emails saying people are getting high temperatures. It is very curious. Maybe there really are lower quality clones out there.

            One thing to be careful of though is that at least for my devices the factory default configuration was for them to be running full speed, sampling at over 100Hz. At that speed a little self heating is probably not surprising. When I set the appropriate memory addresses to slow them down to <1Hz, the temperature dropped. Running full speed (default config) I was only getting a +0.5degC offset, so this does not explain the 2deg people are seeing, but it helps a bit. Also some people I spoke to confirm the temperature dropped when they slowed the sampling rate, but it was still significantly too high.

            My notes on this are here:
            http://www.kandrsmith.org/RJS/Misc/Hygrometers/dht_sht_how_fast.html

      1. the dallas chip is crap. I hoped it was going to be good but its really slow and innaccurate.

        we have a temp chamber at work that I’m writing some control code for. these are big expensive MODBUS (heh, just had a modbus article this week, unrelated though) ovens that can go from -50 to +50C and beyond with 1deg settability. I put a ds18b20 in the oven and ran it from -50 to +50C and watched. it took well over 5 minutes for the closed-oven (a few feet squared, inside area) ds18b20 I had inside to show the same temp that the oven was set to. the thermocouple that I also used to check against took 10’s of seconds to stabilize but the ds18b20 took well over 5 minutes, and even longer if the temp was very low.

        I like the DS chip but its really not very good when you really test it in an industrial setting. I’m going back to using tcouples.

    1. I am in the process of trying to get an absolute error estimate for the temperatures, as opposed to the simply relative comparison that is reported in the article cited here. The experiment is still running, but currently my best guess for three BME280s is that they all read a little bit too warm, but only by 0.20, 0.57 and 0.17 deg C respectively. That is within the manufacturer’s spec. and I only have limited confidence on my absolute calibration anyway. When the experiment is finished (a few days?) I will write something up.

      In summary though, I agree, all the BME280 I have tested seem to tend towards reading too warm, but I have yet to see one off by more than 1degC and testing to a precision finer than that is rather tricky anyway.

    2. I am in the process of trying to get an absolute error estimate for the temperatures, as opposed to the simply relative comparison that is reported in the article cited here. The experiment is still running, but currently my best guess for three BME280s is that they all read a little bit too warm, but only by 0.20, 0.57 and 0.17 deg C respectively. That is within the manufacturer’s spec. and I only have limited confidence on my absolute calibration anyway. When the experiment is finished (a few days?) I will write something up.

      In summary though, I agree, all the BME280 I have tested (only 3!) seem to tend towards reading too warm, but I have yet to see one off by more than 1degC and testing to a precision finer than that is rather tricky anyway.

    3. In previous comments I said I would have a look at trying to make an absolute measure of the BME280 thermometer instead of the relative tests reported in the original write-up. I now have that done here:
      http://www.kandrsmith.org/RJS/Misc/Hygrometers/absolutetemperature.html
      This is not something I have tried before so I would be interested in any comments or thoughts on the test procedure.

      The basic conclusions are
      * Four BME280s tested all fall well within the manufacture’s 1degC spec
      * There is a very slight bias to reading warm, but with only four devices tested that is small number statistics. I think the temperatures are basically pretty accurate
      * The relative comparison in the original humidity test write-up was by luck also a pretty good representation of absolute accuracy

  1. This is really nice work. It is a PITA to do these measurements. I hope there might be some long term testing drift, particularly the same sensors in the same environment. I encounter/use failed/drifting/inaccurate $200 to $500 sensors in building hvac applications that essentially have the same specifications all the time (you pay more to get a 2% calibration or certificate on the same part). You pay ~$100 to replace a failed RH tip/filter cap on these things.

    Drift, failure, and non-uniformity plague building humidity measurements (and subsequently the poorly implemented controls based on such measurements). Realistically these sensors are in service 7 to 20+ years. I always thought a solution to this was an array of cheap sensors to reach a consensus measurement that could also provide diagnostics/correct for drift or installation issues, etc.

    1. “This is really nice work. It is a PITA to do these measurements.”

      Thanks for the feedback and yes, these measurements are much more subtle than one would initially guess. I picked humidity as a project because I knew it was somewhat problematic to get reliable measurements and thus a challenge. Actually trying to perform the experiment has been fascinating. I have been through several iterations of the test cell and thermal control and it has been very entertaining to find and eliminate all sorts of subtle systematic error sources. For example, a strong correlation between my measured humidity inside the sealed test cell and the temperature of the walk-in closet in the bedroom on the other side of the house: http://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_dht22.html#figure5
      It is a nice illustration of the age-old comparison between precision and accuracy. Cheap digital devices like these offer easy and enormous precision, but absolute calibration accuracy is a tricky question.

    1. For a variety of not particularly good reasons.

      The fundamental reason is that this was never supposed to be a “shoot-out” or group test. When I started the project all I really wanted to test was specifically the DHT22. All the other devices happened largely by accident and were not selected to represent the full range of what is available. They represent only the handful of devices I had by chance in my toy box.

      That said, I did look at the Honeywell at one point and consider buying a couple. The reason I rejected it at the time was that it is an analogue device. That is not a bad thing and is not a reason to reject using it in any project. It is simply that it makes it slightly different from all the other devices tested here. All these devices output a digital value for the humidity. There is essentially nothing I can do in my test circuitry to get that wrong. I ask it for a humidity value and it tells me. That means I am reliably testing what the device can deliver. If I include an analogue device then there are many other variables to consider because the answer is dependent on both the device itself and my read-out electronics. How clean is my power supply? How good is my ADC? Have I correctly configured the ADC for optimum resolution and dynamic range? Is my analogue circuitry temperature sensitive?

      To really be clear. I am not suggesting there is anything wrong with analogue devices and if I stumbled across one (or three) then yes I would very much like to give them a go. It just hasn’t happened yet.

  2. Commendable job for doing stuff outside of a metrology lab.

    While the author mentions sensor life, he still needs to consider the sensor’s service-life history. Use some of these sensors in various labs and environmental chambers, where we start seeing issues at approx 14 to 18 months. Environmental chamber sensors get swapped at 12 months, and lab sensors at 15 to 20 months. Your mileage may vary.

    1. Thanks for adding some real world experience. Those sort of ages seem to match pretty well with my experience for service life but I am basing that on only a handful of individual devices. Your comment encourages me that my estimates are realistic.

  3. “Having just installed a sextet of DHT22s in our house last year, we’re left with that sinking feeling that we may have gotten what we paid for, which wasn’t much.”

    On other hand, you do actually have a working network of sensors. Speaking as the author of the original study, I have spent two years running this calibration to assess the device accuracy, but the distributed monitoring network for which they were destined is still on a breadboard on my desk. :)

  4. So, I work for a company that specialises in trace moisture and dew point measurement technology.

    We have several NPL and UKAS calibration references in-house, with measurment capabilities of 0.1°C and beyond available.

    If the demand is there, I’m sure I could be convinced into replicating the tests here, if anyone is interested?

    1. I would certainly be interested, even if it completely negates all my effort to date! For clarification, are you talking about just temperature or temperature and humidity? You only quote an expected accuracy on temperature. It is humidity I am particularly interested in.

  5. I use the Sensirion SHT11 and SHT15 all the time. I have 28 nodes in operation at work that relay temp and humidity data every 6 minutes across a 2.4ghz mesh network. Accuracy is the same as when installed, 5 years ago according to our temp/humidity meter that is calibrated every 6 months. (the SHT11 is the chip only version of the “stick” SHT71.
    Would have like to have seen the Sensirion SHT21 or SHT31 in I2C format on these tests. I am using those now (but I have now doubts in there performance) As someone else said, buy quality, get quality. Buy Chinese eBay, well, take a gamble…

    1. I’d have liked to see the SHT21 compared too, it’s very widely used in a lot of electronics and is pretty accessible/affordable. I don’t doubt the quality so much since Sensirion are a pretty reputable company. Purely depends on whether china has a counterfit product on the go!

  6. This is a f***ing amazing work. Just one note though, the error’s mesure is quite unfair for humidity. I didn’t find the definition of error (may be L1 or L2 norm). 1°C of error is more important than 1% humidity error because temperature range from 0 to 30 where humidity ranges from 0 to 100 so a weighted error is more appropriate here.

    Error definition is always complex and is basically application dependant (is temperature more important than humidity for art conservation?).

  7. Let me share also my experience with BMP180, SI7021 and BME280 (all of the bought from Aliexpress).
    I had few dozens of each of those sensors so i decided to run a comprehensive test and check what would be the offsets of all of them. I tested 5 sensors from each type. What i noticed was following:
    1. SI7021 – All readings were within a 0.1C range
    2. BME280 – All readings were within a 0.5C range, but on average this was 0.5 degrees above the Si 7021
    3. BMP180 – Again – all readings were within 0.5 range, but 0.5 degrees below the SI

    Now i have few dozens of DS18B20, and plan to comapre them against those.
    Yet, what i fear is that as all comes from Ali, there may be in fact differences between each batch.

    And actually one very important learning from my experiment was – if you want to measure the temperature/humidity not just for playing but really make it work – at some point of time you need to put it in a box.

    I was running it off an ESP8266, whose USB2Serial consumed 12ma. It turned out there need to be at least 10 cm distance between the sensor and the ESP, so that the reading is not affected. Any closer and i was getting up to 2 degrees up.
    Good thing was that the offset was consistent, so it is enough to measure it once and then fix it in the software.
    But i imagine that if you have multiple Temperature sensors around your house, at the end each of them would have +/- X (<1C) offset from the others. So if you want to compare them – you anyway need to choose one of them as master and calibrate against it
    (and hope long-term dirift will not invalidate the calibration :P)

    1. That is a really good question. Do you just mean the LDO could be generating heat or are you thinking of something subtler?

      I just had a look at a BME280 device with my 10um thermal camera. This is an “eBay module”, as pictured in the original article and at the top of this page, integrated onto a board for I2C, but it does not have any regulator. It is a 3.3V module and I have the microcontroller running at 3.3V. In my thermal images I can confirm that the BME280 device itself is by far the hottest part of the module. I think I can just barely see the I2C pull-up resistor at +0.2C above ambient, but nothing else on the module glows apart from the BME280 itself.

      Now I seem to be one of the few people who is not seeing any temperature error so this is not really answering your question at all. My modules do not have any extra voltage regulator and I am not seeing a temperature error. It would be a bit strong to say that supports your hypothesis, but it certainly does not dispute it. I have not yet seen any of my devices reading more than +0.5C

      1. I like the train of thought.

        I haven’t checked the datasheet for the BME280, but I can’t imagine the current draw is enough to push LDO into an area where it was generating *that* much, heat, not at 5V VIN anyway. (Though this is very much a thought substantiated only by my head, and not having crunched numbers, as it’s late!)

        I’d imagine cheap modules beget cheap LDO’s though, and I’d be far more intrigued to see the effects of supply ripple on the ASIC operation.

  8. Justed wanted to share some experience with the AM2302 here. I have no clue about the accuracy of this sensor but I know that now 2 sensors have died on me in the last 3 months. I am using it to measure humidity in a small greenhouse. Humidity levels are at some times above 90%. My assumption is that this sensor is not handling high humidity environments very well.
    Thank you all for sharing your info, it has been very interesting to read. I guess I will switch to Sensirion as I have good experience with their temp and temp/humidity sensors fro the past.

Leave a Reply to peperonaldCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.