Skip to main content
Explorer
October 6, 2026
Solved

On board HTS221 temperature sensor read values higher than expected

  • October 6, 2026
  • 13 replies
  • 43 views

Environment

- Board: B-U585I-IOT02A (STM32U585AIIXQ)
- STM32CubeIDE, FreeRTOS (CubeMX-generated), CMSIS-RTOS v2
- Driver: ST vendored HTS221 component driver (`hts221.c` / `hts221_reg.c`),
  untouched, accessed through the public `stmdev_ctx_t` of the object layer
- I2C2 @ standard mode, internal pull-ups, 1 Hz sampling in one-shot mode

Hi, application on the **B-U585I-IOT02A** discovery kit (STM32U585, FreeRTOS, STM32CubeIDE). The onboard HTS221 humidity/temperature sensor is driven by ST's vendored driver from BSP.

Symptoms that i am experiencing: Right after reset (cold boot), the HTS221 reports **~20 °C, then over the following minutes of operation the reading rises steadily and settles at **~30 °C**, while the actual room temperature stays ~20 °C.
The drift is smooth and monotonic (thermal-looking), not noisy or jumpy.

I have already verified that BSP driver conversion formula is correct. Also HTS221 internal heater is disabled.

My sensor configuration:

HTS221_Set_One_Shot(&hts_obj);
hts221_humidity_avg_set(&hts_obj.Ctx, HTS221_H_AVG_512);
hts221_temperature_avg_set(&hts_obj.Ctx, HTS221_T_AVG_256);
/* heater bit cleared in CTRL_REG2 */
HTS221_HUM_Enable(&hts_obj);
HTS221_TEMP_Enable(&hts_obj);

My current hypotheses is that  on board component heating up and cause sensor reading to be distorted. 
Has anyone encountered it and whether it is known bug?

Best answer by Whoing23

I have measured the board temperature with a thermocouple. Yes, it really is 30 degrees. The sensor and the board really heat up. I think that the board has a copper layer, so when other components heat up, the heat is transferred to the sensor, even though it is far away from the component. 

13 replies

KDJEM.1
ST Technical Moderator
October 6, 2026

Hello ​@Whoing ;

 

I recommend you to look at STM32StepByStep:Step4 Sensors usage - stm32mcu wiki and precisely section “2.2. Example: Getting temperature values using the HTS221 sensor and displaying them on a terminal” and follow the steps.

The purpose of this section is to provide a step by step description on how to interface with the HTS221 sensor in B-U585I-IOT02A discovery board to get temperature values and to display them on a terminal.

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
Associate
October 7, 2026

Hello ​@KDJEM.1 ;
Thanks for the answer. I have used the BSP component and compared conversion formulas against the datasheet of the sensor itself. they are correct. So there is no problem on software side for sure. I would like to know the details of how board was traces. I want able to find information about whether it has a cooper layer or not. I suspect that heat from other components is transferred to the sensor, which cause wrong reading.

 

Thank you.
 

TDK
October 6, 2026

If board temperature increases, it is expected that the sensor will report this. The sensor measures the temperature at the sensor.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate
October 7, 2026

Common sense. I only wanted to determine whether it is a known problem with this  board, or this problem in my particular board

Ozone
Principal
October 6, 2026

>  Also HTS221 internal heater is disabled.

Are you sure ?

> The drift is smooth and monotonic (thermal-looking), not noisy or jumpy.

With a nearby souce heating the sensor up, the rise would be exponential (not linear), with a constant decrease of delta T until it reaches equilibrum.

Have you tried to deliberately warm/heat it, e.g. with your finger ?
Or cool it, e.g. with coolant spray ?

Andrew Neil
Super User
October 6, 2026

> The drift is smooth and monotonic (thermal-looking), not noisy or jumpy.

With a nearby souce heating the sensor up, the rise would be exponential (not linear),

But an exponential rise would still be monotonic: ie, it only goes up, not down.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate
October 7, 2026

But an exponential rise would still be monotonic: ie, it only goes up, not down.

Actually it stabilizes around 30 degrees and then hover around 30 - 32 degrees.

Andrew Neil
Super User
October 6, 2026

​@Whoing As ​@TDK said, an onboard sensor is going to detect the temperature around it - so is the board (particularly in the vicinity of this sensor) actually warming up ?

 

Do any of the other sensors also read temperature? If so, do they give consistent results?

 

Have you tried a separate sensor, placed in contact with the HTS221 ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Whoing23Best answer
Associate
October 7, 2026

I have measured the board temperature with a thermocouple. Yes, it really is 30 degrees. The sensor and the board really heat up. I think that the board has a copper layer, so when other components heat up, the heat is transferred to the sensor, even though it is far away from the component. 

Ozone
Principal
October 7, 2026

That makes sense, copper has at least an order of magnitude smaller thermal resistance.

However, this is why those ST products are called “evaluation boards” - they are not made to fit a specific use case, but to demonstrate general capabilites and allow for prototyping.
For your application, you probably want a thermally detached sensor.