cancel
Showing results for 
Search instead for 
Did you mean: 

Internal temperature return wrong value

Brice_38FR
Associate III

Hi

So I''m trying to use the internal temperature sensor to get a rough idea of the temperature.

So first I test it on the NUCLEO-F446 and get good result but when I try to use the same code on my board, I get wrong data.

Good data is adc value aroud 930 (so 24°C) and wrong value is value around 860 (so 0°C)

The nucleo use a STM32F446RET6 and my board a STM32F446RCT6, so basically just the flash size is different.

To be sure to have a similar settings I use a 84Mhz clock generate with HSI and PLL.

I tried lot of different settings (dma, polling, continuous,...) but it gave all the same result

Any idea why the internal temperature is wrong on my board ?

1 ACCEPTED SOLUTION

Accepted Solutions
berendi
Principal

Is the supply voltage the same? Are the analog supply pins (Vdda, Vssa, Vref+, Vcap1/2) connected the same way?

View solution in original post

7 REPLIES 7
berendi
Principal

Is the supply voltage the same? Are the analog supply pins (Vdda, Vssa, Vref+, Vcap1/2) connected the same way?

berendi
Principal

According to the reference manual, the internal temperature sensor is not even suited to get a rough idea of the temperature.

The temperature sensor output voltage changes linearly with temperature. The offset of this

linear function depends on each chip due to process variation (up to 45 °C from one chip to

another).

The internal temperature sensor is more suited for applications that detect temperature

variations instead of absolute temperatures. If accurate temperature reading is required, an

external temperature sensor should be used.

Some STM32 series have a factory calibrated temperature correction value stored in ROM, the STM32F4 lacks this feature. See the answer from @Community member​ below

> Some STM32 series have a factory calibrated temperature correction value stored in ROM, the STM32F4 lacks this feature.

0690X00000ByYEkQAN.png

JW

Brice_38FR
Associate III

Thanks for the infos, btw I'm looking for an accuracy of ±5°C so not very accurate 🙂

I'm using the macro __LL_ADC_CALC_TEMPERATURE to convert ADC to °C and this macro use the factory calibrated temperature correction value .

And with this I get a correct guess of the ambient temperature on the nucleo but not on my board

I will check the analog supply pins to be sure, everything is correct

Brice_38FR
Associate III

So I found (or more exactly @berendi) found the culprit : there was a assembly issue on my board and Vdd was not 3V3 but more 3V6.

If I correct Vdd to 3V3, I get the good value 🙂 🙂

For infos a 50mV variation in Vdd impact the temperature reading by 4-5°C

So I will try to get an idea of Vdd with vref int to improve my temperature reading.

OK so issue is solved? Please select berendi's post as Best, so that the thread is marked as resolved.

JW

Yes it's solved ! and I also successfully add the vrefint to my adc scan to automatically apply the good value for vdd.

Thanks again 🙂