cancel
Showing results for 
Search instead for 
Did you mean: 

STML011 temperature sensor accuracy

Jens_
Associate II

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

 0693W000007BaQ0QAK.png0693W000007BaQ5QAK.pngMeasurement 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:

  1. Can anyone confirm/disconfirm the measurement deviation?
  2. Can anyone confirm my implemented calculation by checking the given "measured example values"?
  3. Can I generally expect correct temperature values (approx. +/- 4 °C accuracy) over the whole temperature range of the given STM32L011D4P7 device?
  4. 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

10 REPLIES 10

Aquiring a calibration value myself is not an option because this is for a series product.

Yes I agree with you. The tracking of the curves seem fine. Only the calibration TS_CAL2 seems to be off.

The generated code states there is no TS_CAL1. But in the address used in the code example there is an value which looks very much like the TS_CAL1 value.

I was playing with the calibration values. The TS_CAL1 + the average slope of the temperature sensor actually gives a temperature curve which looks realistic! (I udpated this in the plots above)