Skip to main content
Visitor II
April 10, 2023
Solved

STM32L452RE temperature sensor measure is different from the room temperature for several degrees. How can I solve it?

  • April 10, 2023
  • 2 replies
  • 1923 views

I have been testing the internal temperature sensor on the STM32 Nucleo-L452RE recently. I'm trying to measure the ambient temperature using this sensor, thinking that it shouldn't vary more than about 2ºC compared to the internal temperature of the microprocessor, but the readings are always several degrees higher than the temperature measured by external thermometers and sensors, despite following all the steps available in the documentation and many other forum codes for configuration or calibration.

For example, I am currently reading the temperature with the code below, which shows approximately 32ºC. However, I am in a room with good ventilation, the air conditioning is on at 24ºC, a thermometer measures 24.5ºC in the room, and an external temperature sensor measures 26ºC above the microprocessor.

In addition, when I turn on a LED with a button or do anything else with the board, the temperature increases up to almost 34ºC.

I am unsure of what else to read or test to obtain an accurate measurement. What do you recommend? Now I'm considering to use an external temperature sensor to measure this parameter.

    This topic has been closed for replies.
    Best answer by waclawek.jan

    The internal sensor measures temperature of the chip, not the ambient temperature. A couple degrees difference is perfectly normal, expecially if there is some other heat source in the vicinity, e.g. a LDO.

    JW

    2 replies

    Super User
    April 10, 2023

    The internal sensor measures temperature of the chip, not the ambient temperature. A couple degrees difference is perfectly normal, expecially if there is some other heat source in the vicinity, e.g. a LDO.

    JW

    Visitor II
    April 10, 2023

    We have a few boards that have STM32 MCU and I2C temperature sensor(s). The MCU's temperature is always 2 to 3ºC higher than PCB's. -wq