2011-06-24 06:06 AM
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-temperature2016-01-18 02:17 AM
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/°CV25(1) Voltage at 25 °C 1.34 1.43 1.52 Vavg slope is 4.3 mv/cand voltage at 25º is 1.43...if your vref is 3.3vAverageADValue 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 decimalsMaybe 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.