cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L011 temperature sensor accuracy

STM32L09
Associate II

I used the example code in RM, and room temperature is arround 31℃,the ADC value is 10644, calculated temperaure is 4127,  does it means 41.27℃?what will happen if minus temperature?

/* Temperature sensor calibration value address */
#define TEMP130_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007E))
#define TEMP30_CAL_ADDR ((uint16_t*) ((uint32_t) 0x1FF8007A))
#define VDD_CALIB ((uint16_t) (300))
#define VDD_APPLI ((uint16_t) (330))


int32_t ComputeTemperature(int32_t measure)
{
int32_t temperature;
temperature = ((measure * VDD_APPLI / VDD_CALIB) - (int32_t) *TEMP30_CAL_ADDR ) ;
temperature = temperature * (int32_t)(130 - 30);
temperature = temperature / (int32_t)(*TEMP130_CAL_ADDR - *TEMP30_CAL_ADDR);
temperature = temperature + 30;
return(temperature);
}

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

> does it means 41.27℃?

Yes. A +10 C difference from ambient is reasonable. It is measuring the temperature inside the chip, not ambient. Expect an overall accuracy of +/- 5 C or so. The calibration temperatures are not exact, and the sensor is not perfectly linear. It will be more accurate at measuring relative temperature changes.

> what will happen if minus temperature?

Then the result will be negative. For example, -1000 for -10.00 C

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Super User

> does it means 41.27℃?

Yes. A +10 C difference from ambient is reasonable. It is measuring the temperature inside the chip, not ambient. Expect an overall accuracy of +/- 5 C or so. The calibration temperatures are not exact, and the sensor is not perfectly linear. It will be more accurate at measuring relative temperature changes.

> what will happen if minus temperature?

Then the result will be negative. For example, -1000 for -10.00 C

If you feel a post has answered your question, please click "Accept as Solution".
STM32L09
Associate II

Thanks.