Compare different i2c temperature and humidity sensors (SHT2x, SHT3x, SHT85, ..)

Wait, does that thermal effect work proportional or inversely, for t vs t?

Because right now I have a cooking thermometer and a digital one next to the dht11. The dht11 reads 33 and the cooking reads 40 and the digital 39.8. So it seems the hotter the dht11 gets, the lower it's temp reading.

Marciokoko:
Wait, does that thermal effect work proportional or inversely, for t vs t?

Because right now I have a cooking thermometer and a digital one next to the dht11. The dht11 reads 33 and the cooking reads 40 and the digital 39.8. So it seems the hotter the dht11 gets, the lower it's temp reading.

sensor self-heating (like bosch BME) or sensor near hot electronic components (like CPU, MCU, voltage regulator) show higher than real temperature, and lower than real humidity. But that is only part of a problem.

Other problem is - two sensors almost always measure somehow differently. The same type of sensor also. And relatively expensive sensors too.

Cheap sensors like DHT11 is inaccurate "by design".

And as I understand it is kind of per sensor/device calibration needed for all devices using sensors to be sure measurements are more or less correct.

Updated v6 Board includes 84 sensors listed below (incl. new AHT15 and HDC2080)

Board v6

Tests

Sensors

Code

Yet another tests results:

at ~RH=17%
at ~RH=75%
at ~RH=100%

An impression from new sensors in general, AHT15 is better than AHT10 (I expected the same results).
CJMCU modules HDC2080 is better than HDC1080 in humidity measurement, but not in temperature.
(self-heating? start wondering about "more feature in sensor more +temperature it measures").

Inside AHT15 and AHT10
Pulling out sensor module from board accidentaly got cover off AHT15. Decide to compare with AHT10.

After a lot of tests and changes, I did not find a way to make AHT10 and AHT15 work stable on the same i2c bus with any other types of sensors. Making the i2c line shorter also does not help. The only solution I found for the next version of the board is to dedicate multiplexer to AHT sensors. And that causes fewer sensors in the next test runs, but runs are not limited in time by unstable device.

While adding Sensirion SHTC1 sensor to v8 board found BME280 (and BME680) using ports 0x76/0x77 (118/119) that is also used by TCA9548A multiplexers #7 and #8. So Using Bosch sensors limit the number of multiplexers in use to 6 only. :frowning: (6 is already in use in v7 setup)

SHTC1 sensor port 112 (70h) also conflicts with TCA9548A multiplexers #1. :o . So using both Sensirion SHTC1 and Bosch BME sensors limits the count of possible first level multiplexers to only 5.

liutyi:
SHTC1 sensor port 112 (70h) also conflicts with TCA9548A multiplexers #1. :o . So using both Sensirion SHTC1 and Bosch BME sensors limits the count of possible first level multiplexers to only 5.

hi, I like your growing project :smiley:

  1. I understand that the project is focused on testing i2c humidity sensors. But what about including cheap (temperature only) i2c sensors like LM75, BMP280, MCP9808 etc.?

  2. If you have a problem with i2c limits, you can use a board with multiple i2c buses (and multiplexers on each i2c bus), such as esp32.. Change from Arduino Mega will not be complicated.

jazz123cz:
hi, I like your growing project :smiley:

  1. I understand that the project is focused on testing i2c humidity sensors. But what about including cheap (temperature only) i2c sensors like LM75, BMP280, MCP9808 etc.?

  2. If you have a problem with i2c limits, you can use a board with multiple i2c buses (and multiplexers on each i2c bus), such as esp32.. Change from Arduino Mega will not be complicated.

  1. There are almost no issues with temperature measurements. A lot of cheap sensors gives more or less correct temperature. That is absolutely not the case about humidity. That is why humidity was the main focus.

  2. Screen+SD is arduino mega shield. See the hardware. There is a case done for mega and so on. I also could use a cascade of multiplexors, but that is too much for one project. No major modifications anymore. just some new types of sensors. maybe. maybe not. ))

Some first drafts with SHTC1 and SHTC3 may be found there:
https://wiki.liutyi.info/display/ARDUINO/Test+2+v8+Office+RH28
https://wiki.liutyi.info/display/ARDUINO/Test+1+v8+balcony+8h

some DHT12 (really bad sensor) returned to the boar instead of BME680 (i2c addr. conflicts)



BME280 temperature overestimate surprised me but I discovered that datasheet talk only about pressure and humidity and not temperature and you don't find information about temperature accuracy.
Did you found sensors that are out of specifications?

zoomx:
BME280 temperature overestimate surprised me but I discovered that datasheet talk only about pressure and humidity and not temperature and you don't find information about temperature accuracy.
Did you found sensors that are out of specifications?

I do not trust in accuracy numbers from datasheets (in general). The only uses for datasheets are i2c port and commands. One of the reasons is I use (mostly cheap Chinese) modules, not sensors itself. AHT15 and SHT85 are only exceptions when modules produced by sensor manufacturers. And modules can be, let's say, not perfect (for example chip overheating during soldering). So it is kind of not correct to compare module with sensor datasheet.

Just my personal impression from what I see during this project is:

DHT11 and DHT12 is not trusted in general absolutely.
AHT10 and AHT15 - also not trusted, slow and inaccurate, but maybe better than DHTxx
AM2320 - relatively not that bad (in compare to DHT and AHT)
BME280 and BME680 is always higher temperature and lower humidity (I suspect self-heating) I think those sensors are not for uncalibrated DIY projects)
HDC1080 - wrong (high) humidity
HDC2080 - wrong (high) temperature
SHT2x - OK
SHT3x - OK
SHTC1 and SHTC3 - OK
SHT85 - Perfect )

HTU21d and Si7021 is interesting because of SHT2x compatibility (i2c ports and commands), cheap, less accurate but still acceptable when no extra accuracy needed.

On the project test pages, there are .csv files published for each test so anyone can do the analysis and decide for themself which modules are accurate enough for their needs.

For example for test:
https://wiki.liutyi.info/display/ARDUINO/Test+3+v7+balcony+RH15-92+changing+humidity

There are files:
h_v7_test3.CSV
t_v7_test3.CSV

Thank you very much!!!! Karma+

About datasheet: I start from there but I know that something can go wrong during soldering and, sometimes, some components can be counterfeit as I read some times. Never got counterfeit components.

I am starting testing some DS18B20 (about 10 but 2 of them are unreliable) and will start to test some BME280 (only 3) only for temperature just to start.

DS18B20 has a serial number that I am recording too to associate experimental data easily.

BME280 has a serial too, I use this library that can read it

I am using the Bosh recommended setting for weather monitoring(no filter, no oversampling) among them there is force mode instead of continuous mode, maybe in this way the overheating is less.
These stettings need experiments too, maybe you can get better values.

zoomx:
BME280 has a serial too, I use this library that can read it
GitHub - Bolukan/BME280: Provides an Arduino library for reading and interpreting Bosch BME280 data over I2C, SPI or Sw SPI.

I am using the Bosh recommended setting for weather monitoring(no filter, no oversampling) among them there is force mode instead of continuous mode, maybe in this way the overheating is less.
These stettings need experiments too, maybe you can get better values.

I stop using sensors libraries on some of the first project iterations. Not all libraries work fine with multiple sensors of the same kind (with multiplexers). So a bit simplified sensor reading code (without CRC and limits check) used for all types of sensors. see the code.

I use maximum filtering and maximum oversampling settings to get the best possible measurement accuracy. It takes 20 seconds to read all 80 sensors one-by-one. So I believe reading 3 times a minute should not much overheat the sensors.

I do not like BMExxx. ) Also for huge formulas it needs for sensor's raw data to be converted to t/RH. So any single measurement needs a lot of additional math done by MCU. Most of other sensors use simple formulas. Also, BME sensors got a number of calibration coefficients one should read from sensors and store in memory (I read it every time in my code and not store, partly for sensor plug'n'play reasons). So I just think that BME is not DIY project kind of t/RH sensor.

And, BTW, looks like device manufacturers are also not much in love with BME according to what I can see in number of Air Quality monitors I disassemble. See Humidity sensors in air quality monitors - Air Quality - WIKI

In weather stations it seems that Sensirion rules and your page confirmed that! Professional weather stations uses Pt100 for temperature (calibrated) and there are some humidity sensors that uses wet bulb and distilled water!

Good gas sensor unfortunately are still expensive.

There are CO2 NDIR sensors that are cheap but they lacks the reference so when they stay at, for example, 1000ppm for long time they drift. Good NDIR board are still over 1000 €. But cheap sensors are good for air quality because usually you don't live at 1000ppm!!

Have you read this?

but he not used as many sensors as you.

AHT10 and AHT15 - also not trusted, slow and inaccurate, but maybe better than DHTxx

I do not understand how AHT10 can be slow. It measures temperature and humidity simultaneously in 75 milliseconds. Your favorite SHT21 at maximum resolution measures humidity in 22-29 milliseconds and temperature in 66-85 ms. The total measurement time for SHT21 is 29 + 85 = 114 milliseconds.

Arduino library for SHT21, HTU21D & Si70xx - GitHub - enjoyneering/HTU21D: This is an Arduino library for HTU21D, Si7021 and SHT21 Digital Humidity & Temperature Sensor
Arduino library for AHT10, AHT15 - GitHub - enjoyneering/AHT10: This is an Arduino library for Aosong ASAIR AHT10, AHT15 Digital Humidity & Temperature Sensor

zoomx:
Have you read this?
Testing and Comparing Low Cost Hygrometers
but he not used as many sensors as you.

yes, that is the most known sensors related article. This project actually inspired by the article. I think it has a major flaw - comparing single sensors of each type. Since any single sensor might be not good.. that is just wrong.

enjoyneering:
I do not understand how AHT10 can be slow. It measures temperature and humidity simultaneously in 75 milliseconds. Your favorite SHT21 at maximum resolution measures humidity in 22-29 milliseconds and temperature in 66-85 ms. The total measurement time for SHT21 is 29 + 85 = 114 milliseconds.

Arduino library for SHT21, HTU21D & Si70xx - GitHub - enjoyneering/HTU21D: This is an Arduino library for HTU21D, Si7021 and SHT21 Digital Humidity & Temperature Sensor
Arduino library for AHT10, AHT15 - GitHub - enjoyneering/AHT10: This is an Arduino library for Aosong ASAIR AHT10, AHT15 Digital Humidity & Temperature Sensor

Just wondering why you trust datasheets and not just test measurement speed instead? Just a quick test Adafruit_SHT31.h and your AHT10 library below using Arduino Uno. (Sensor heated by fingers during test to get changing numbers). Do you get other numbers?

void loop()
{
  time = millis();
  Serial.print(time); 
  Serial.print(",");
  Serial.print(myAHT10.readTemperature());
  Serial.print(",");
  Serial.print(myAHT10.readHumidity());
  Serial.println(",");
 
}

29,27.69,30.74,
183,27.69,30.74,

336,30.09,51.39,
490,30.09,51.39,
644,30.09,51.39,

796,30.46,53.14,
950,30.46,53.14,
1103,30.46,53.14,

1257,30.75,54.93,
1411,30.75,54.93,
1564,30.75,54.93,

1717,31.01,56.57,
1870,31.01,56.57,
2024,31.01,56.57,

void loop()
{
   time = millis();
   Serial.print(time); 
   Serial.print(",");
   Serial.print(sht31.readTemperature());
   Serial.print(",");
   Serial.print(sht31.readHumidity());
   Serial.println(",");
  
}

10,29.87,67.56,
54,29.91,67.80,
97,29.91,68.02,
140,29.97,68.22,
184,29.97,68.46,
227,29.98,68.65,
270,30.01,68.91,
314,30.04,69.09,
357,30.04,69.27,
400,30.06,69.51,
443,30.06,69.72,
487,30.11,69.86,
530,30.15,70.07,
573,30.14,70.25,
617,30.18,70.46,
660,30.15,70.59,

So my conclusions still there AHT is slow and inacurate.

enjoyneering:
I do not understand how AHT10 can be slow.

liutyi affirmation does't mean that AHT10 is slow in measuring temperature but that experiment shows that it is slow to follow changing temperature.

Each time you call myAHT10.readTemperature() or myAHT10.readHumidity (), it will read 6 bytes on the I2C bus, a total of 12 bytes. That is pretty much. You code below is inefficient.

void loop()
{
time = millis();
Serial.print(time);
Serial.print(",");
Serial.print(myAHT10.readTemperature());
Serial.print(",");
Serial.print(myAHT10.readHumidity());
Serial.println(",");

}

AHT10 measures temperature and humidity at the same time. This means that all information about temperature and humidity is already present in the first 6 bytes. It makes no sense to read it a second time! This is efficient way:

 time = millis();
  Serial.print(time);
  Serial.print(",");
  Serial.print(myAHT10.readTemperature(AHT10_FORCE_READ_DATA)); //read 6 bytes via I2C
  Serial.print(",");
  Serial.print(myAHT10.readHumidity(AHT10_USE_READ_DATA)); //use same 6 bytes

see example - AHT10_Any_MCU_Serial.ino