cancel
Showing results for 
Search instead for 
Did you mean: 

Weird ADC temperature sensor results

gizemtabak7
Associate II
Posted on July 31, 2013 at 09:26

Hi,

I am trying to use internal temperature sensor of STM32VLDiscovery board but I have a little problem. I get ADC conversion result and apply the formula in RM0008, 

temp = (V25-Vsense)/Avg_slope+25,

 to calculate temperature. I use typical values

V25 =(1.41/3.3)*4096=1750

and

Avg_slope = (0.0043/3.3)*4096 = 5

. However, I obtain a negative temperature value around -4oC.  

I am not sure if the following is logical or not but after getting negative values, I looked Vref_adc and saw it is 1643, so I changed V25 to 1.41*1643 = 2317 and Avg_slope to 0.0043*1643 = 7.06. This time, I obtain positive values but around 80oC. Is this normal?

Thanks in advance.
3 REPLIES 3
raptorhal2
Lead
Posted on August 01, 2013 at 03:29

There is a large uncalibrated offset that changes with each chip. Your chip's V25 value is 1.41*1643/1750, but this is at the ambient temperature at the time the measurement was taken. This ambient temperature should be used in place of the 25 number. Use the RM0008 slope value, or measure it by putting the chip in a known different ambient temperature.

If the ultimate goal is to use this in a production run, consider using an external temperature sensor that will not require calibration for each board.

Cheers, Hal

gizemtabak7
Associate II
Posted on August 01, 2013 at 08:42

Thank you for your explanation, Hal. My aim is just to make sure I got the working principle of the temperature sensor right, not developing a project based on that sensor. I am aware of the offset that differs from device to device but I couldn't figure out which variable is related to which one and how they are related. But the part I am missing seems that V25 means Vref in here, right? ( Because if I set V25 = 1.41*1643/1750, V25(ADC) = (1.41*1643/1750)*(4096/3.3) = 1643 = Vref(ADC) )

raptorhal2
Lead
Posted on August 01, 2013 at 15:20

My apologies, I misread your first post.

V25 is the voltage signal into the ADC at 25C. To allow for the offset for your chip, read the ADC value at your test ambient temperature. Then subtract the Vsense ADC value read at other temperatures, multiply the difference by the scaling factor and add the test ambient temperature instead of 25.

Cheers, Hal