cancel
Showing results for 
Search instead for 
Did you mean: 

HTS221 Incorrect Temperatures / Calibration (T0_OUT = 0)

Simon Sq
Associate III

Hi,

I'm having an problem whereby I believe the temperature readings from an HTS221 device are incorrect. They seems to be around 5degC too high compared to reference temp. I'm using a Nest thermostat as the reference, and while this may not be calibrated I would still expect the temperatures to be roughly similar.

I have suspicion that the calibration registers aren't correct, specifically the T0_OUT value which is zero. Is a value of 0 for T0_OUT expected or is there something wrong with the calibration? Seems a bit suspect to me.

Below is a dump of all the calibration registers:

Calibration Registers

Addr: 0x30  Value: 0x3d
Addr: 0x31  Value: 0x8f
Addr: 0x32  Value: 0x99
Addr: 0x33  Value: 0x0e
Addr: 0x34  Value: 0x00
Addr: 0x35  Value: 0xc4
Addr: 0x36  Value: 0xf2
Addr: 0x37  Value: 0xff
Addr: 0x38  Value: 0x3a
Addr: 0x39  Value: 0x03
Addr: 0x3a  Value: 0xf5
Addr: 0x3b  Value: 0xd0
Addr: 0x3c  Value: 0x00
Addr: 0x3d  Value: 0x00
Addr: 0x3e  Value: 0x1e
Addr: 0x3f  Value: 0x03

So for the linear interpolation of temperature I get the following:

x0 = 0
y0 = 19.125 degC
x1 = 798
y1 = 33.75 degC

However using those values yields temperatures which are too high (by approx 5degC). The humidity also appears to be around 10% lower than the Nest thermostat.

Hardware and Software

I'm using the HTS221 driver from the ST Micro MEMS library. The HTS221 is mounted on a MikroE Click board (https://www.mikroe.com/temp-hum-click) attached to an Azure Sphere dev kit.

At the moment I don't have another HTS221 device to compare with.

Device Configuration:

Data Output Rate: 7Hz

Averaging: H: 512, T:256

Heater: Off

Block Data Update: Enabled

Samples are being read from the device at approx. 1Hz.

Any advice would be appreciated.

Thanks,

Simon

12 REPLIES 12
Eleon BORLINI
ST Employee

Hi @Simon Sq​ , are you experiencing a 5°C shift across a certain (wide) range of temperature? This to understand if it is only an offset or there is also a gain issue... The x0 = 0 value is quite strange (here for some reasonable data). Can you check please if your code is compatible with the driver on github for HTS221 (e.g. hts221_read_data_polling.c)? Did you try to enable the heater and then read again both temperature and humidity, in case it could be a problem on the sensor? Regards

Simon Sq
Associate III

Hi Eleon,

It's difficult to say, I don't think it's a straight forward DC offset issue, I suspect it is the gain that is the problem. If I simply subtract 5°C from all the readings and then touch the sensor with my finger, it only reaches about 28°C, where as I would expect it to get to around 32°C.

Another strange behaviour I noticed on a couple of occasions is when I touch the sensor with my finger the temperature reading actually decreases!

I've just done a test by turning the heater on for 2 minutes. During that time the temperature reported approximately 68°C, while the relative humidity was 0%. I would expect the %RH to be zero with the heater on, but can't comment on the temperature reading.

A few minutes after turning the heater off the temperature stabilised at around 28.9°C and 44.2% RH, which is 4.9°C above my control thermostat (24.0°C). The %RH is within 5% of my control measurement so not too concerned about that.

I experimented with changing the value for T0_OUT from it's value of 0, and a value of around 390 seems to result in more sensible temperatures being reported. With the value of T0_OUT changed to 390, the temperature reported when the heater is on is around 100°C

The code I am using to sample to sensors is basically copied from the sample you mentioned (hts221_read_data_polling) so I'm fairly sure it's compatible. The only difference is that I call the function to sample to sensors every 1000ms, rather than using a while() loop. I am still checking the RDY flags to determine if a sample is ready to be read.

Below is the code I have to read the temperature and humity (the linear interpolation function is taken directly from the github sample):

if(hts221_detected)
{
  // Read output only if new value is available
  hts221_reg_t reg;
  hts221_status_get(&hts221_ctx, &reg.status_reg);
 
  if(reg.status_reg.h_da)
  {
    // Read humidity data
    memset(data_raw_humidity.u8bit, 0x00, sizeof(int16_t));
    hts221_humidity_raw_get(&hts221_ctx, data_raw_humidity.u8bit);
 
    // interpolate the raw value
    sensor_data.hts221_humidity_rh = linear_interpolation(&lin_hum, data_raw_humidity.i16bit);
 
    if (sensor_data.hts221_humidity_rh < 0) sensor_data.hts221_humidity_rh = 0;
    if (sensor_data.hts221_humidity_rh > 100) sensor_data.hts221_humidity_rh = 100;
  }
 
  if(reg.status_reg.t_da)
  {
    // Read temperature data
    memset(data_raw_temperature_hts221.u8bit, 0x00, sizeof(int16_t));
    hts221_temperature_raw_get(&hts221_ctx, data_raw_temperature_hts221.u8bit);
 
    // interpolate the raw value
    sensor_data.hts221_temperature_degc = linear_interpolation(&lin_temp, data_raw_temperature_hts221.i16bit);
  }
}

I'm starting to suspect a faulty device? Or at least incorrect calibration?

Any update on this issue?

I am having the same problem across 5 devices.

Hi @FMunt.1​ ,

are all the 5 parts behaving in the same way or they are drifting randomly?

If also after the heater procedure described above you are facing the same issue, especially in the former case you could characterize offset and gain and compensate linearly the sensor output data in post processing.

-Eleon

Each of the boards have a different reading. The datasheet say that these chips have been calibrated in the lab and no extra calibration is needed. Why would I add another part by part calibration procedure ? This is why I am going with a sensor vs a thermistor. I do not have the lab calibration tools to be able to even do that. Like the person before me I am using multiple thermostats which agree with each other but the boards are showing higher temperature and humidity. The temperature offset does not seem to be linear either.

From the datasheet my understanding is that the heater is to be used to recover from high humidity situations.

If you send me a small board with the sensor mounted that you already tested in the lab and can confirm that is within specs I can interface it with my boards and confirm if there is a difference between readings. The boards I am using are: https://www.seeedstudio.com/AZ3166-IOT-Developer-Kit.html

Hi @FMunt.1​ ,

sorry for the delay in my answer.

>> The datasheet say that these chips have been calibrated in the lab and no extra calibration is needed.

That's right, but the production calibration cannot take into account the future offset introduced by the soldering process... in case you are using a custom board, can you please check if it is compliant with the JEDEC J-STD-020 standard?

>> From the datasheet my understanding is that the heater is to be used to recover from high humidity situations.

This is correct.

I would suggest you to contact regional Sales offices and Representatives from this link, they will help you for your last request.

-Eleon

Hi @Eleon BORLINI​ ,

I use this boards (https://en.mxchip.com/az3166) because they are professionally made. So this is not a test using a custom / prototype board.

My guess is that they have followed up the temperature requirements for soldering.

This is why I was asking if it is possible to send a small board with the device soldered already and tested for accurate temperature and humidity readings that I can use to interface with the board and confirm/infirm the offset reason here.

Not sure what who you want me to contact for this as that link points to the contacts page only.

Florin

Hi Florin @FMunt.1​ ,

ya, you have to refer to your regional Sales and Representatives (from the menu you can find in that webpage) for a free sample request.

By the way, you can directly buy the STEVAL-MKI141V2 adapter from the dedicated page of the ST eStore (some samples are in stock so far), or from a distributor.

-Eleon

Buying another board does not ensure that the new board does not has the same problem.

What I think is needed is a board that is validated and characterized by the engineering (ST Employee) with the measurements taken in a fully controlled environment across the sensor temperature and humidity range.

The validation spreadsheet to be provided with the board.

In the mean time all I can do is to look for another sensor that is less sensitive to soldering. (as from what I can gather from your previous messages is that this could be the culprit of this device misbehaving on multiple professionally made boards).