There is no doubt, that integrated temperature and humidity sensors are the way to go at the moment. I had quite a bit of look at a wide range of sensors and settled for the SI7021. Silabs has a bigger family – most likely the same chip binned on precision – so here are cheaper options to use if I ever want to go for an application that can do with less precision. Here is a detailed comparison with other sensors.
Beware of ebay ones – they have higher error than the datasheet specifies, or so I thought because of the small sample size. It turns out all SI7021 sensors I used would occasionally display weird behaviour. On occasion the values would simply be way off what is expected, and this was happening for both ebay ones and the ones I purchased from reputable manufacturers.
I looked around and it turns out there are multiple types of sensors from multiple manufacturers which are reasonable compatible. To add to SI7021 I tested SHT20 and HTU21, all from ebay modules. The reason for this is that ebay modules offer a better price and are much easier to handle. I do not suspect these chips are counterfeit, but they may be slightly out of spec. The sensors are almost physically identical, in fact the ebay modules seem to share the same PCB.
Firmware wise, the sensors are mostly compatible – the data resides in the same memory location and the formulas to calculate temperature and humidity are the same. However there are some differences. On one hand, they take different amounts of time for conversion – which translates in different energy efficiency. On the other, there are slight differences in the available commands, but a common ground exists and I reached a point where the FW can read any of them, without caring which is connected.
I tested two of each sensor, connected to different revisions of the sensor boards and used them to read the temperature and humidity. The modules were running the same firmware, fresh batteries and i tried to make the sensors be as close as possible.
The top two modules are using SHT20 sensors, the two bare boards in the middle are the older version with SI7021 (left – Mouser, right ebay) and the bottom modules are using HTU21.
I tracked the temperature and humidity for a while, at first the sensors were inside the house, then outside, when the temperature dropped. The data is recorded with node-red and unfortunately I lost the actual values. What is there to see? Generally, sensors display pretty good consistency, when looking at the two charts below, showing the temperature in C and humidity in % over the course of approximately 8 days.
Nodes 5 and 10 are using SI7021. There is a clear humidity offset compared to all others for node 10. Node 25 (SHT20) behaved weird, showing a drop in humidity for a certain period (while the temperature was reported OK. Similarly, node 26 (SHT20) had a weird reluctance to change temperature while the chip was outside for some hours and it displays some occasional noise within data (some values are clearly off by some degrees). Nodes 27 and 28 (HTU21) show the best correlation with each-other. There are only 2 data points where the humidity value was read wrong.
Looking at a temperature spread, a total of 0.8 C distance is a bit out of spec.
This brief experiment is probably insuficient to fully compare these sensors. However, it confirmed some of my suspicions with the five SI7021 sensors I initially used: they sometimes behave radically. Some weird behaviour has been observed for the SHT20 and a little less for HTU21. It is possible that some electrical readout errors are responsible for the sole points with out of range values. However, I cannot find any justification for them (all wires are soldered, modules have proper decoupling caps and pull up resistors).
This little experiment has convinced me to go for either SHT20 or prefferably HTU21. I have ordered 5 more and will redo the experiment once again when new temperature sensors would be ready. Stay tuned…