cancel
Showing results for 
Search instead for 
Did you mean: 

HTS221 accuracy and TN1218 question

Legacy member
Not applicable
Posted on May 06, 2017 at 22:23

Hello,

I'd like to ask you about opinion on accuracy of HTS221 sensors, both factory mounted on X-NUCLEO-IKS01A1 boards (powered by Nucleo board @ 3.3 V).

I get quite surprising results from these sensors, compared to reference designs with SHT21 and SHT31 sensors (which are obviously calibrated similar way, because in stable environment their output is no different than 0,2 centigrades and 1 % rH from each other).

HTS221 Sensor 1

Calibration values:

H0 = 30 %, ADC output 0xFFF8

H1 = 72 %, ADC output 0xD001

Real-life application values (ambient conditions):

0xCFF0 output = 72 % rH , while SHT21 and SHT31 showed 59 % (which is about 22 % error)

0x9C80 output = 117 % rH, while SHT21 and SHT31 showed 91 % (which is about 28 % error)

HTS221 Sensor 2

Calibration values:

H0 = 32 %, ADC output 0x0005

H1 = 73 %, ADC output 0xD4E7

Real-life application values (ambient conditions):

0xDC00 output = 66 % rH while SHT21 and SHT31 showed 60 % (which is about 10 % error)

(haven't tried in 90 % rH envoronment yet)

What do you think about the readings from sensors? I would expect better accuracy.

By the way, I would also like to mention

http://www.st.com/content/ccc/resource/technical/document/technical_note/group0/82/97/c8/ab/c6/da/41/ed/DM00208001/files/DM00208001.pdf/jcr:content/translations/en.DM00208001.pdf

Interpreting humidity and temperature readings in the HTS221.

There is a code example, how to perform the approximation to get the relative humidity value. However, I think there is some casting needed in order to get it working with negative calibration values (for example the values above).

/*5. Compute the RH [%] value by linear interpolation */

tmp = ((uint32_t)(H_T_out - H0_T0_out)) * ((uint32_t)(H1_rh - H0_rh)*10);

*value = tmp/(H1_T0_out - H0_T0_out) + H0_rh*10;

If H0_T0_OUT and/or H1_T0_out are negative (just as in my case) and treated as uint32, it produces number close to 4 000 000 000, which then divides the tmp value to zero.

Here is my own version:

int16 a = (H_T_OUT - H0_T0_OUT);

uint8 b = (H1_rH - H0_rH);

int16 c = (H1_T0_OUT - H0_T0_OUT);

uint32 humidity = ((a * b * 100) / c) + (H0_rH * 100);

(Please note I use a multiplication factor of 100 to get xx.xx % result, the TN1218 uses only factor 10, but the principle of casting is the important part). Also, I use a different compiler so the types could have different names than in the TN1218 (but the sign and size remains).

Thank you,

David

PS: I haven't got to a temperature measurement yet, but expect the same casting troubles could happen in the provided example, too.

#hts221
5 REPLIES 5
Legacy member
Not applicable
Posted on May 12, 2017 at 19:35

I tested the temperarature outputs of two HTS221 sensors (the same as mentioned above) against SHT21 and SHT31 sensors. Both HTS221 sensor 1 and 2 give typically +/- 0.3 degrees Celsius difference, sometimes they get up to +/- 0.05 degrees Celsius. This is quite satisfying in an ambient environment.

The problem with humidity sensor accuracy is still the same and any help advice be appreciated.

David

Remco Kleine
Associate II
Posted on April 04, 2018 at 14:21

Hello David,

I Also have inaccurate humidity readings. I have 3 sensors and they are all 3 approx 15% lower than my reference (rH)

Did you solve this problem alreaddy?

What was wrong?

Regards Remco

Legacy member
Not applicable
Posted on April 04, 2018 at 21:01

Hello Remco,

Unfortunately, I got no response from ST. I didn't use these sensors in a production application. However, as I wrote above, I haven't seen a better responsive and calibrated sensor than SHT21 / SHT31. Two different sensors (manufactured one year after each other) provide the same readings (+/- 0,02 C and +/- 0,02 % rH) with two decimals places (of course this is a bit misleading, because all engineers know that if the accuracy is +/- 0,3 C and +/- 2 % rH, it is silly to show more decimal places than the accuracy is).

David

Posted on April 05, 2018 at 09:49

OK! Thanks for your reply!

So, it looks like the specs of the datasheet (+- 3.5 %) are optimistic?

I also did not get a response from ST.

Perhaps, for our application it is enough, but I still find it very strange that my readings are so much off.

Thanks anyway!

Legacy member
Not applicable
Posted on April 05, 2018 at 15:09

To be honest, I didn't have enough time to test the sensors thoroughly, but as I wrote in my question, at least one of the sensors is not only off-set, but also non-linear. Which is much worse to be managed by the end user.

The first sensor had > 20 % and the second >= 10 % deviation.

All sensors are based on some physical phenomenon that some metal/semiconductor compounds change properties (resistivity, capacity, etc.) when influenced by a change of temperature, humidity... Which means that calibration in the factory (in a controlled environment) is the most important step in reading and interpreting the temperature/humidity... values. I can't calibrate them at my work / home. I am sorry to say this, but without calibration, the sensor has the same value as a chinese noname sensor from eBay.

David