cancel
Showing results for 
Search instead for 
Did you mean: 

Why are my HTS221s getting bad temperature values?

IC.1
Associate II

0693W000008ypLHQAY.png0693W000008ypJBQAY.png 

I want to know if anyone else has encountered this, I have multiple HTS221 on different boards, and they all give me different temperature values. They are "working," in the fact that when I put my hand on the sensor the temperature increases, etc, but are just giving me wrong temperature values.

I have begun to suspect that it is the factory calibration values. Here are the calibration values and temperature readings from 3 different boards above. You can see t0_out for one of them differ by a lot, but the T_OUT is quite similar. The temperatures are in the form XX.X C, so 245 C is actually 24.5 C. Help is appreciated.

15 REPLIES 15
niccolò
ST Employee

Hi @IC.1​ ,

are these readings performed in the same point or on the same board?

(temperature can rapidly change based on the distance from heat source on the board, so the problem could be there)

Niccolò

IC.1
Associate II

They were not performed on the same exact board, but the boards used are the same as each other (as in replicas of each other), so I doubt that that is the issue. The reason why I believe it to be the calibration values is because I have 5+ of these boards with the sensor in the same location with the same exact code, but they each produce different temperatures. What do you think of the calibration values I posted above? Thanks.

Hi @IC.1​ ,

the calibration values are not intrinsically good or bad, but they don't seem to have anything strange (even if I don't have much experience with those values), if that's what you meant.

The problem with offsets can be traced to humidity problem inside the sensor.

One thing to note, is that to ensure the accuracy specification are guaranteed the soldered sensor should be re-hydrated in a stabilized environment (25 °C / 55% rH) for 3 days or at 70% rH for 12 hours. (this advice is on page 13 of the datasheet)

If this was not performed, the Heater bit of register CTRL_REG2 (21h) can be activated for a few seconds to try to speed up the condensation process (pag 23 of the datasheet)

Let me know if this helps.

Niccolò

IC.1
Associate II

(I accidentally created a new answer instead of a reply)

The reason why I keep thinking it is the calibration value, is according to the graph on page 3 of this technical note:

https://www.st.com/resource/en/technical_note/dm00208001-interpreting-humidity-and-temperature-readings-in-the-hts221-digital-humidity-sensor-stmicroelectronics.pdf

Correct me if I'm wrong but if t0_out is much lower (in my pictures above, 6 vs -262) and the other calibration values are similar, according to the graph on page 3 of the technical note above, this gives a higher temperature value.

I did not perform the rehydration process (thank you for the tip), but I did turn on the heater bit for a few seconds and tested it. However, still no luck.

Hi @IC.1​ ,

don't worry for the answer instead of the reply.

anyway, it could be that the coefficients calculated are not the right ones anymore, due to the soldering without rehydration process.

the coefficients registers should not be modified because normally those are the right ones, but you can try to change them and see if changing, for example the t0_out from -262 the situation gets better.

remember to save the original values somewhere to be sure to be able to return to the previous state.

I'm also interested in the actual temperature you would want to read: is it around 20°C?

here I can only see 2 of your images, so I only see the difference between the 17.6°C and 24.7°C output.

can I also ask you which drivers are you using to read the values from the registers?

Niccolò

Thanks for bearing with me, I sort of solved it.

I am expecting around 24 degrees celcius. There was a problem in my using spi to read the register. The temperature is actually quite accurate now. However, I can't say the same for the humidity, it is off by around 20 - 30%.

I debugged the value of H_OUT (0x28), and it is a negative number, such as -9000. Is it normal for it to be a negative number?

I assume so, since the data sheet says the value is signed, 16 bit, but I just wanted to confirm.

In other ways of attacking the problem, I used the heater to remove any condensation, and the value dropped to the expected 45% rH, but it quickly went back up to ~68%.

Isaac

Hi Isaac @IC.1​ ,

are the values in the calibration registers the default ones or have you changed them in some ways?

Niccolò

Hi Niccolo,

The calibration registers are the default ones. I haven't touched them at all.

Isaac

Hi Isaac @IC.1​ ,

ok, thank you

do you see the same behaviour on all your sensors?

also, the 0x28 register is only a part of the whole data, and it is the lower part of the 16 bits, so you should read both registers to have the whole value.

I think you read well the data because the screenshot you posted had the right values of humidity, so what has changed?

what was the problem with SPI? I'm asking just to be sure it did not affect the humidity reading

Niccolò