STML011 temperature sensor accuracy
Hi,
I am having problems measuring accurate temperatures with the internal temperature sensor of the STM32L011D4P7 over the full device temperature range of -40 °C to 130 °C.
What I did: Measuring the temperature as described in the Reference Manual (RM0377), Chapter 13.9 "Reading the temperature" which mentions the code example A.8.17.
There are two temperature calibration values TS_CAL1 and TS_CAL2 mentioned and used.
The two images show temperature measurements I did in a climatic chamber. The STM32 internal measurement (purple) is done as described above. Two external temperature sensors (green) controlled by additional testing hardware (not the STM32) are used to measure the ambient temperature and the case temperature on top of the STM32.
Calculation values:
Read out Calibration values from STM32 at the addresses mentioned in the example code:
TS_CAL1: 662
TS_CAL2: 940
Measured example values:
external temperature sensor in the climatic chamber:
-40 °C | 30 °C | 130 °C
meaured STM32 ADC raw value (VDDA = 3.3 V):
469 | 613 | 817
STM32 internal temperature calculated as described in A.8.17 from ADC raw values:
-21 °C | 35 °C | 117 °C
Measurements in the climatic chamber:
- x-axis: timestamp in seconds
- y-axis: temperature in °C
- The STM32 measurements are using the named values for calculation

Measurement evaluation:
- The measurements show an error of 19 °C at -40 °C ambient temperature, 5 °C error at 35 °C and 13 °C error at 130 °C.
- black curve: when using the TS_CAL1 value (which is not mentioned in the datasheet and can/should not be used!) with the average slope from the datasheet the curve seems realistic
- green curve: when using only the specified data from the datasheet, which is TS_CAL2 and average slope, the temperature does not make sense
Finally my questions:
- Can anyone confirm/disconfirm the measurement deviation?
- Can anyone confirm my implemented calculation by checking the given "measured example values"?
- Can I generally expect correct temperature values (approx. +/- 4 °C accuracy) over the whole temperature range of the given STM32L011D4P7 device?
- Is it allowed to use the TS_CAL1 value as done in the code example A.8.17, although TS_CAL1 is NOT mentioned in the Datasheet?
EDIT:
- update temperature plots
Many greetings
Jens
