Why are the measured values so different? Are my humidity sensors faulty?

  • Hi! I created four humidity sensor nodes, two using the SI7021 sensor and two using the HYT221 sensor. The tolerances of these two sensors are as follows:

    • SI7021: ± 3% RH (max)
    • HYT221: ±1.8% RH (max)

    I run all sensors using an 3.3V Arduino Pro Mini 328P replacement board, each powered by 2AA batteries. At the moment all 4 nodes run at the same position, so under same conditions and so I'd expect them to measure almost the same humidity values.

    But they're not: While all sensors report almost the same temperature, the results for humidity are very different:
    The two SI7021 are between 41-42% at the moment, whereas one of the HYT221 is around 35% and the other is at about 30%. I have a fifth sensor in the same room part of a Tado thermostat, reporting 40% RH at the moment.


    I already double-checked my code and all the formulas in the specs but it looks fine to me. So I guess, the HYT221 sensors are faulty. Since they are rather expensive compared to other sensors I expected them to be more accurate than the SI7021, but the HYT221 already contradict themselves, because with a tolerance of 2*1.8% I cannot explain this difference of 5% between both of them.

    What do you think? Are the HYT221 faulty? Is there another problem I didn't see yet?

    Specs for the sensors:

    The code I'm using:

  • I haven't done anything with a HYT221 so far, but from my own experience with various humidity sensors, it is quite difficult to get accurate and consistent readings from them. Buy ten and you might get ten different readings. Even expensive professional hygrometers can deviate by a few percent and need to be calibrated regularly. But especially with rather cheap-ish sensors, it's mostly a game of pure luck.

    IMHO there is no simple "attach X to Arduino and expect accurate readings"-solution for humidity sensors.

    You could try to test your sensors in a known constant environment, e.g. by placing them in a small sealed container with a saturated sodium chloride (NaCl / table salt) solution. At room temperature, a calibrated humidity sensor should read 75.5%RH. Keep them in there for a day or so and compare.

    There are many other saturated salt solutions you could make. Magnesium chloride for example would result in an environment with 33%RH at room temperature. Have a look at this chart:


    Try to compensate for any deviation in software. If you notice that some sensors are off by a few percent, but the deviation is consistent over the relevant humidity range for your application, you might just want to use a simple linear offset.

  • @benhub I don't have direct experience with the sensors you mention but my general view is in line with @BearWithBeard - results are not always consistent even if you stick to a single sensor brand/type.

    This overview gives a good picture of the variation you can expect and some of the difficulties with calibrating humidity sensors on a hobby level.

  • Many thanks for your answers! I tried that thing with the sodium chloride solution and the values of my HYT221 sensor was far off (66%) whereas the measured values from the SI7021 showed 76%.

    So I now configured an offset in MyController for the HYT221 sensors.

    Thanks for your hints!

  • I agree with the others, low cost sensors vary from one unit to another. For many, where they refer to "Accuracy", they often mean repeatable accuracy, which basically means if its calibration is out by say +5 degrees and they quote an 'accuracy' of plus/minus 1%, it will always read an extra 5 degrees plus or minus 1%.

    As a result, I started paying extra for 'factory calibrated' devices, but as you have found, this appears to mean very little.

    After purchasing and testing a LOT of devices and constantly being frustrated, I ended up building a test node with two each of three different sensors (6 in total) which I calibrated myself and used offsets to get them reading the same. That test node also computes and transmits average values also. Over a long period of time I found that an individual sensor will go out a bit, then return to match the others. A year later, I repeated the calibration tests and the avg value was spot on.

    Now, whenever I build a new device, I build offsets into the software which I can send to the node (using MYSController) and they are stored in EEPROM. This allows me to occasionally check its value compared to my 'test rig', and correct any offsets without taking the unit apart or reburning the code.

    My conclusion, after four years of using just about every reasonably priced ($2 to $12) device on the market, is that there is little difference between most of the units once you have set the correct offset. As a general rule, they all seem to drift occasionally and by similar amounts, but return again. Most importantly, by having a 'trusted' set of values to compare a new sensor to, I can recognise a faulty sensor very quickly, typical symptoms being they often need a larger than normal offset and the next day it's reading is significantly different again. At first, I tried adjusting the offset again and again, but now I toss them straight in the bin. If a new sensor (regardless of price) can stay in sync with my test rig for 48 hours, it will continue to be moderately accurate.



  • You can calibrate a humidity sensor for temperatures around "room temperature" (25°C / 77°F) using the standard salt test, please see https://www.allaboutcircuits.com/projects/how-to-check-and-calibrate-a-humidity-sensor

    Numbers in spec sheets are often provided for some standard EPA conditions ("National Primary and Secondary Ambient Air Quality Standards", 40 CFR—Protection of the Environment, Chapter I, Part 50, Section 50.3, 1998), 25°C / 760 mmHg. From my experience, at high humidity values (70+%) and low temperatures (10..12°C) grey market Si7021 sensors can overestimate humidity as much as up to 10%. I have no experience with HYT221, but suspect that the phrase "The module is precisely calibrated by the manufacturer and is therefore fully interchangeable without adjustment" in https://www.ist-ag.com/sites/default/files/AHHYTM_E.pdf is valid only for the "official" sensors, not to any grey market ones.