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

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

0.5 second for one measurement from AHT is what I also see in my project. Using the library from enjoyneering I got about the same time. SHT3x is about 10x faster in this case. (SHT2x need a level converter that why fast comparison is done to SHT3x that operates on 5v). Returning the same t/RH numbers 3 times is not a real new measurement I think.

enjoyneering:
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.

Ok, so do you get better sensor response time using more efficient code, or it still 0.5 seconds for measurements update (I cannot check right now)? BTW, my code is inefficient for all types of sensors. But still, only AHT is that slow.

Are you able to get changing numbers from the AHT10 sensor every 75 ms?

SHT3x is about 10x faster in this case

All datasheet for SHT21, HTU21D & Si70xx Digital Humidity and Temperature Sensor NOT RECOMMEND TO READ DATA TOO FREQUENTLY due to overheating of the sensor & slow humidity responce time. As far as I remember, a polling interval of at least 10..18 seconds is recommended. It makes no sense to read it faster.

Of course, you can push the sensors to the limit, but the manufacturer does not guarantee that the obtained values will be within the tolerance limits (RH+-2% & T+-0.3C).

You really do an excellent job, but before you draw any conclusions, you need to read all sensor datasheets more carefully. For example, SHT21, HTU21D and Si70xx have similar pinouts and commands, but Si70xx simultaneously measures humidity and temperature and etc.

P.S. The recommended polling interval for AHT10 is 8 seconds. No wonder you get inaccurate readings.

enjoyneering:
All datasheet for SHT21, HTU21D & Si70xx Digital Humidity and Temperature Sensor NOT RECOMMEND TO READ DATA TOO FREQUENTLY due to overheating of the sensor & slow humidity responce time. As far as I remember, a polling interval of at least 10..18 seconds is recommended. It makes no sense to read it faster.

Of course, you can push the sensors to the limit, but the manufacturer does not guarantee that the obtained values will be within the tolerance limits (RH+-2% & T+-0.3C).

You really do an excellent job, but before you draw any conclusions, you need to read all sensor datasheets more carefully. For example, SHT21, HTU21D and Si70xx have similar pinouts and commands, but Si70xx simultaneously measures humidity and temperature and etc.

P.S. The recommended polling interval for AHT10 is 8 seconds. No wonder you get inaccurate readings.

So you will not try to prove that AHT able to measure in 75 ms? ))

Pushing it to the limit needed just for that. To see slow AHT response, not for real life. And AHT is slow. That is it. We can discuss if anyone ever needs faster sensors or not. We can discuss if it is important to show accurate RH data or not. But AHT is definitely slow. And relatively inaccurate (it is too cheap to expect other). And I see no point to advertise AHT as fast and reliable sensors. It is like advertising of DHT11 (also see no reason to do so).

BTW, In my project, I poll sensors every 20 seconds. And all sensors are actually in the same condition. a separate poll for t and RH every about 20 seconds. If for some sensors that may "feel like" extreme condition - I personally do not like those sensors and not recommend others to use it.

See video Youtube: Humidity sensors tester v8.3 for sensor response speed and t/RH difference. Sensor order in the video description.

This is turning into an interesting thread. My apologies to liutyi for assuming (s)he didn't contain the sensors and circulate air, but in my defense it wasn't apparent, but I shouldn't've assumed.

This sensor type (capacitive film) has some 'built in' problems. The temperature sensor isn't generally a sensor as such, but a proportional-to-absolute-temperature (PTAT) output current that is an intrinsic part of the controlling ASIC. Typically they have an accuracy of ±0.6°C, whereas a bespoke temp sensor easily achieves ±0.1°. The humidity sensor accuracy is generally derived from selection, the ±2% and ±5% are all made on the same line, the less accurate ones are just culled. The humidity sensor should be protected in less than benign environments, as they are interactive and will get contaminated if left open to the elements.

The sensor will read whatever humidity & temperature it detects, unfortunately pcbs generally generate some heat, as I previously noted a 1° change is about 2.5%rH, so if your board gets warm for whatever reason (conductive, radiated, or convected heat) then the sensor will read with an apparent offset. Similarly calibration occurs with a preset communication rate, as the ASIC will self heat, so moving away from that rate requires slightly different calibration, as does incorrect voltage and the like. You have to follow the recommendation to ensure correct reading, and thermally isolate from any other influence. Certainly for our parts (and I assume others) seperating the humidity and temperture request offers no benefit, in fact ours is contained in the same response.

A final note, Sensirion do dominate this market, they were the first company to productionise and support a SMD solution to the market, and now have a better cost base than the rest, so continue to dominate as they produce more than the rest of us. But, as Amphenol, we do sell a lot, and they get used in a lot of assemblies which Sensirion don't do - there is room in the market for us all!

AmphenolSensors:
A final note, Sensirion do dominate this market, they were the first company to productionise and support a SMD solution to the market, and now have a better cost base than the rest, so continue to dominate as they produce more than the rest of us. But, as Amphenol, we do sell a lot, and they get used in a lot of assemblies which Sensirion don't do - there is room in the market for us all!

I am not sure ChipCap 2 is a kind of "DIY projects type of sensors". It is not cheap. See not many i2c modules available to buy (except something like this). Also not much code examples on github. But OK, got some CC2D33 will see how it works. :slight_smile:

Updated board v8b

with ChipCap 2 sensors added.

First impression: CC2 is not bad, but expensive, not much alternative i2c modules available with this sensor, SIP module have thin 1.27 pins (similar, but not same with SHT85 or AHT15) that is more suitable for soldering not for 1.27 pin connectors. Datasheet available and it is in English (not like some DHTxx/AHTxx modules), but it is kind of not perfect. Missing clear statement on i2c default address and commands code and sequences. Also, not many libraries found at Github for Arduino.

First test(s)
https://wiki.liutyi.info/display/ARDUINO/Test+1+v8b+Balcony+high+to+mid+RH
https://wiki.liutyi.info/display/ARDUINO/Test+2+v8b+Balcony+low+RH

New sensors links and prices:
SHTC1 [5] 3.5$
SHTC3 [2] 17.5$
CC2D33 [3] 18$

updated both hardware and software

with AHT20 (6.25$ Digikey US) and HIH7120 (7.22$ Digikey US) sensors added

New sensors:

First draft tests:
High humidity test
Low humidity test

Summary: AHT20 looks better than AHT10 (but also more expensive), HIH7120 is ok in general

HIH7120 uses ChipCap 2 code in the sketch. It looks compatible by both requests and formulas.

HIH7120 needs a capacitor to be added to a circuit, and pull-up resistors also if not already. My test running without pull-up resistors since other modules on the bus already have. One sensor with a capacitor soldered on pins. Second sensor without. Both looks good

AHT10 removed, I do not like them in general, and because AHT1x occupies i2c bus of multiplexors.

Secure Connection Failed

An error occurred during a connection to wiki.liutyi.info. PR_END_OF_FILE_ERROR

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.
Please contact the website owners to inform them of this problem.

Please add the images to your post instead of hosting them offsite.

The CC2D33 module is a bit cheaper at Mouser https://www.mouser.co.uk/ProductDetail/Amphenol-Advanced-Sensors/CC2D35-SIP. It's a similar price to the Adafruit SHT31-D board but the Adafruit board has a sensor with the integrated protective PTFE cover.

This project could be more interesting, I think, if you were to calibrate the readings using some saturated salt solutions. This article gives a good explanation of the process. If you calibrated the readings then we could see how much the sensors drift from their calibration over time which is just as important to me as their out-of-the-box accuracy.

This flyer gives some different salts and their RH at specific temperatures (you'd need to control the temperature when taking the readings): https://www.novatron.co.uk/wp-content/uploads/2016/02/UKAS-calibration-salts-flyer.pdf

The above article doesn't go into much detail about how to derive the constants needed for calibration but I recently finished a spreadsheet in LibreOffice Calc which uses the linear regression function to calculate the values of a, b, c and d in y = ax3 + bx2 + cx + d. All you need to put into the spreadsheet are the readings for each sensor for each of, say, four appropriately spaced RH salts. Once you have those constants, the formula takes the RH readings (x) and gives a corrected RH (y). In a normal project using far fewer sensors, you could do this calculation in the microcontroller but in a project with this many sensors, I suppose it would make more sense to convert the values on your PC, in a spreadsheet.

Some of the salts are more dangerous than others but LiCl, MgCl2.6H2O, K2CO3, NaBr, NaCl, KCl and K2SO4 are reasonably safe except that some of those are apparently corrosive enough to cause serious damage to your eyes (but not enough to pose the same hazard to skin). I was actually thinking of repackaging these salts into small containers at home, maybe with demineralised water already added and trying to sell them in sets on eBay for this purpose but I'm still looking into that.

seanspotatobusiness:
This project could be more interesting, I think, if you were to calibrate the readings using some saturated salt solutions.

There were tests with NaCl on the previous board version. After that, I decide to use SHT85 as a reference, since it got better results on this saturated salt solution test. And it is kind of "most expensive" also. See:

https://wiki.liutyi.info/display/ARDUINO/Test+4+v6+Saturated+NaCl+solution

But using SHT85 as a reference may be wrong.
My latest "steam test" with v9 board that expects RH to exceed 100% (water condensation on surfaces, etc) shows SHT3x and SHT85 are most probably unable to measure RH higher than about 95% correctly. see

https://wiki.liutyi.info/display/ARDUINO/Test+2+v9+steam+in+bathroom

Also, 85 sensors on small board generate heat that it is noticeable. And heat distribution is unequal. So it makes results more or less relevant only with high airflow. But fans are also source of additional heat, so for the moment, I do not expect this board to be kind of lab quality device that is so accurate that it is suitable for saturated salt solution calibration tests.



liutyi:
My latest "steam test" with v9 board that expects RH to exceed 100% (water condensation on surfaces, etc) shows SHT3x and SHT85 are most probably unable to measure RH higher than about 95% correctly. see

Also, 85 sensors on small board generate heat that it is noticeable. And heat distribution is unequal. So it makes results more or less relevant only with high airflow. But fans are also source of additional heat, so for the moment, I do not expect this board to be kind of lab quality device that is so accurate that it is suitable for saturated salt solution calibration tests.

In a small, enclosed space though, I don't think the heat generation is much a problem because the air in the enclosed space can approach the temperature of the sensors (compared to an open space where there might be a continuous source of cooler air). I would think it's also possible to just take far fewer readings so the sensors don't generate so much heat. I'd probably just leave the equipment turned off and then turn it on after leaving it long enough to equilibrate. When I do this with my own sensors (like six or seven; nothing like your project!), I will probably use a reed switch to turn on the Arduino with a magnet from outside the box.

I read somewhere that water condensing on one of these sensors potentially leave residue after evaporating which can permanently affect the sensor but I don't know under what circumstances this applies. Hopefully not in the case of domestic boiler/shower steam!

I saw someone made their own gold-standard chilled mirror hygrometer and it wasn't terribly complicated although I'm not sure I could be bothered to go through it myself: Arduino Chilled Mirror Hygrometer | Arduino Project Hub - this first attempt used a glass mirror but I think they are trying again with a polished metal surface which is much more appropriate for faster thermal conduction.

the last test with a focus on new sensors only Test 2 v9 new sensors overview - Arduino - WIKI

Onboard fans of v9 board might be a not good solution.

Attachment contain datafile got from the tests. And some images. I still not at the point to recommend specific best sensor. Feel free to analyze the data collected and make your own conclusions (can treat the info as CC BY licensed if it is important).

I think there is enough info collected to get an overview of most sensors available on the market for DIY projects.

So that is it for now. )

humidity_board_v9_tests0-2.zip (1.97 MB)

Hello community,

I bought also a few AHT10 sensors connected to an ESP01 and I am always faced with a wrong temperature, about 2°c above current temperature ! which is huge ! Even if I read each 30s in order to avoid self heating !
I tested 2 different libraries : adafruit and from Thinary...same issue.
You can imagine that this sensors are not usable!
Either this cheap modules on aliexpress is are fake or I have something wrong, but I checked my code several times!

Was someone faced with this same issue ?

Thanks in advance ,

I believe that the ESP01 is warming the sensor.

Hello,
Have you fixed the issue with AHT10
Will AHT10 perform better compared to DHTxx
Thank you

AHTx definitely looks better then DHTx.
It is actually new sensors from same manufacturer and DHT is very old models.

BTW, At the moment doing AHT10/AHT20/AHT21/AHT25 sensors test board

So will probably share some result for AHT21/AHT25 also

Some first draft results for board 10.0 to see
https://wiki.liutyi.info/display/ARDUINO/Test+1+v10a+humidity+absorber
https://wiki.liutyi.info/display/ARDUINO/Test+2+v10a+night
https://wiki.liutyi.info/display/ARDUINO/Test+3+v10a+high+to+low+humidity

Code on GitHub

The main difference to the previous test setup

  • Only AHTxx (AHT10, AHT20, AHT21, AHT25) sensors
  • All sensors are new
  • Only one sensor per multiplexer i2c line
  • the new board (minimum connectors, shorter i2c lines)
  • only 5v in use, without 5v/3.3v voltage conversion
  • both t and RH data got in one request

For the board v10.1 will add two old sensors from previous setup (SHT85, HIH7120) just for reference (to compare it someway to previous boards results)

There are some results for the new AHT 10.1 board available.

It now includes two old sensors (HIH7120 and SHT85) from the previous (v9) board.

https://wiki.liutyi.info/display/ARDUINO/Test+1+v10b+humidity+absorber

https://wiki.liutyi.info/display/ARDUINO/Test+2+v10b+night+at+balcony

https://wiki.liutyi.info/display/ARDUINO/Test+3+v10b+over+the+water

https://wiki.liutyi.info/display/ARDUINO/Test+5+v10b+NaCl+solution+draft

Thank you so much liutyi! Your project has helped me more than you can imagine. I even created my forum account just to convey that. :innocent:

But I do have one question. Why did you create a separate board just for AHT? They aren't very accurate and I don't think I would use them. Is it because they're so popular, or them being able to be run on 5 volt?

1 Like