Achieving Noise-Free Temp Sensor Readings

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Achieving Noise-Free Temp Sensor Readings

1,234 Views
ee-quipment_com
Contributor II

Achieving stable, accurate, noise-free data using the on-chip ADC is a challenge in all but the least-demanding applications.

Freescale does a great job with app notes explaining how to use the ADC and achieve good results, and many more esoteric corner-case issues get addressed here in the forums.

However, despite many app notes and forum posts on the subject, I was unable to find a clear explanation of the behavior that I was observing when attempting to read the on-chip temp sensor. I was having difficulty getting stable readings from the sensor.

In my application I am using a Kinetis KL26, although I believe the results obtained can be generalized to most if not all Freescale temp sensor implementations.

Here is a plot of a software loop sampling the temp sensor:

pastedImage_0.png

Not bad at all. But the perfectionist in me thinks that I should be able to get readings stable to +/- 1 LSB.

Here is a plot of the same software loop sampling the temp sensor, but this time averaging the readings over 32 samples:

pastedImage_1.png

That's what I'm talk'n about! That's the kind of results I want for my application.

So now I want to optimize the sample-and-average loop. The Kinetis ADC can autonomously average up to 32 samples with no software intervention. Perfect! So I enable this the ADC averaging functionality and here is the result.

pastedImage_2.png

What Happened??? All I did was change from software averaging to hardware averaging. What could be causing this horrible, unusable data?

After much head scratching and research, I discovered AN1980 "Using the 56F83xx Temperature Sensor". I don't know if this temp sensor shares any commonality with the Kinetis family temp sensor, but I found section 4.2 "Temperature Sensor Output Impedance" very illuminating. It says that the temp sensor output is very high impedance, and if it is sampled at a high rate it is unable to properly drive the ADC input.

From the App Note:

"However, if the ADC is used to sample the node continuously and at a high-enough frequency, the temperature sensor output will see a low load impedance and this source of measurement error will re-manifest itself."

Whether this is the is the cause of the behavior in the Kinetis temp sensor I can't be certain, but my experimental results indicate that using ADC hardware averaging when sampling the temp sensor will provide worse, not better results than software averaging, and even worse results than no averaging at all!

0 Kudos
1 Reply

452 Views
apanecatl
Senior Contributor II

Although the ADC modules and internal temperature sensors from Kinetis KL and MC56F devices differ, they share a common architecture. The inconsistencies you are observing are due to a mismatched impedance caused by a high frequency sampling, specifically the charge and discharge of the sampling and hold capacitor in the ADC channel, while the capacitor is charging the impedance increases and when it discharges the impedance drops significantly, a very rapid sampling will cause the capacitor to not charge at its maximum potential, hence presenting a lower impedance while having a significantly higher impedance at the temperature sensor output; my suggestion is you add a 0.01μF bypass capacitor, since the temperature sensor in Kinetis KL devices is only an internal channel you do not have the option to add a bypass capacitor in the sensor/ADC line; my suggestion is to decrease your sampling frequency.

0 Kudos