cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F205 temperature sensor problems

tfk
Associate II
Posted on June 24, 2011 at 15:06

Hi everybody,

I'm having some trouble with the STM32F205 temperature sensor. 

I'm using the algorithm from section 10.10 in the reference manual. {(V25 � VSENSE) / Avg_Slope} + 25

I'm using the following algorithm to convert the ADC value to a voltage value from the temperature sensor ADC channel (ch 16):

ADCConvertedValue*3.3/4096;

When I'm heating up the chip the ADCConvertedValue increases resulting in a greater voltage value, that results in lower temperature as a higher VSENSE value will subtract more from V25. 

Does anyone have the same problem ? 

Best Regards

Tord

#not-that-complicated #vsense-temperature-sensor #adc-dma #stm32f205-temperature
20 REPLIES 20
pedro23
Senior
Posted on January 18, 2016 at 11:17

The conversion formula is wrong... if you check this: 

http://www.st.com/web/en/resource/technical/document/datasheet/CD00161566.pdf

(Seccion 5.3.19)

//{(V25 - VSENSE) / Avg_Slope} + 25

//V25 = 1.43  , avg_slope = 4.3mv/Cº

Avg_Slope(1) Average slope 4.0 4.3 4.6 mV/°C

V25(1) Voltage at 25 °C 1.34 1.43 1.52 V

avg slope is 4.3 mv/c

and voltage at 25º is 1.43...

if your vref is 3.3v

AverageADValue is the value of your internal temperature sensor AD

 unsigned int adcVolt = 0;

 signed int diffVolt = 0;

 signed int temp1 = 0;

 adcVolt  = AverageADValue*33000/4096; 

 diffVolt = adcVolt - 14300; // (1.43v at 25º & vref=3.3)

 temp1  = diffVolt / 43; //0.0043 v / cº

 temp1+=250; //Since it is in degree decimals

Maybe the above code conversion is old. I Used it previously but since temperatures are always around 25 degrees here it didnt fail too much. 

But I change to these values because they are the right based on datasheets.

Best regards.