Showing results for 
Search instead for 
Did you mean: 

STM32F103 how to calculate temperature sensor

chen zero
Associate II
Posted on December 27, 2017 at 17:46

I am confused on how to calculate temperature from the internal sensor.

From RM008 (


Page 235,  Temperature (in °C) = {(V25 - Vsense) / Avg_Slope} + 25. ( formula 1)

and from datasheet, page 79,


V25= 1.43 V , average_slope= 4.3 mV/°C

so, in formula 1, need to calculate Vsense.

Suppose that from ADC1, the converted value is X, so,

Vsense = X /4096 * Vrefint, right ? but how to get Vrefint ?

from doc, the Vrefint can get from ADC1 channel 17,

however, I can not find any formula to to calculate the Vrefint,

I found some doc said that for STM32F0 series chip, Vrefint can be caluclated by reading data in system

address: Vrefint_cal (0x1FFF F7BA - 0x1FFF F7BB), however, seems that this address is not defined for SMT32F103 series.

Can you give some help on how to calculate temperature or Vrefint ?

Thank you very much !

Associate III


Vsense = X /4096 * VDDA

Because On 64-pin packages and packages with less pins VREF is internally connected to the ADC
voltage supply (VDDA).