AnsweredAssumed Answered

right formula for calculating temperature sensor using STMF401RE Nucleo?

Question asked by le.bien on Feb 1, 2017
Latest reply on Feb 22, 2017 by T J

I'm using STM32F401RE Nucleo board to measure the ambient temperature. After the sampling process, I receive a digital value from ADC_CHANNEL_TEMPERATURE and I want to convert this digital value into degree celcius. I searched on the internet for this and I found two different methods:

Method 1: Page 226 in RM0368 Reference manual (STM32F401 series)

Temp(degree) = (V_sense - V_25)/Avg_slope + 25

Method 2: Page 251 in RM0091 Reference manual (STM32F0 series)

Temp(degree) = ( ( (110 - 80)*(TS_DATA - TS_CAL1) ) / (TS_CAL_2 - TS_CAL_1) ) + 30 Where:     - TS_CAL2: temperature sensor calirbation value at 110 degree     - TS_CAL1: temperature sensor calirbation value at 30 degree     - TS_DATA: temperature sensor output from ADC

It confuses me which one is the correct formula for calculating the temperature in degree celsius. Although Method 1 is from reference manual of STM32F401, the temperature result doesn't look correctly. While Method 2 from reference manual of STM32F0 series, it looks more reasonable.

Still I don't know which formula should I apply when using STM32F401RE Nucleo board ?

Thanks

Outcomes