This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EZ430 Internal Temp Sensor Variations Up To 0.8C

All,

I am currently trying to use internal temp senso of EZ430 and looks like for a particular temp reading, I am getting reading variations of 0.8C (i.e. it toggles between 23.0 to 23.8 etc). The offset based calibration would not help here either. Does anyone know why is that the case? This would be far beyond reasonable accuracy levels.  

  • That's what we observe also during our tests. We implemented summing and avering process on ten read values and we get stable values. You should try.

  • I've made this too, in fact an oversampling to 12bits from 10bits with 16 values.

  • All other operations in the MSP, including CPU activity, affect the reading. For best results, you should enter LPM0 and exit it after the conversion is complete. Not only the voltage fluctuations cause by the  alternating current during CPU operation (and any other module) but also the self-heating during different CPU operations might affect the internal temperature reading (while on average it might not show any change on the MCU case outside)

    Also, the formula to extract the resulting temperature from the raw reading may greatly affect the resolution and the noise of the result. And the CPU power needed.

    p.s.: oversampling only works if a small periodic (non-noise) signal is put over the original signal or the original signal is changing itself. It allows expanding the dynamic range above the bitwidth of the ADC.
    If sampling is done to a static signal (with or without noise), 'oversampling' will not increase the bitwidth (synamic range), it would only work as a low-pass on the existing bits and not add any increased resolution. This is rather called 'averaging'.
    In case of the temperature sensor (which has a rather static signal), sampling 16 values will NOT increase the dynamic range by 2 bit, it will only increase the SNR (signal to noise ratio) by applying a low-pass to the sampled signal, effectively reducing the noise (if any at all) in the lower bits.

  • What I understand is reducing the SNR will reduce the LSB error of the ADC, reducing the error will improve the accuracy or in other terms, leads to a higher resolution, perhaps oversampling is not the true word, or I'm completely wrong;)

    I'm not advanced enough in thechnics to understand all what you said, but I'll trust you^^

  • Oversampling means that you can get 14 bit resolution from a 12 bit ADC. Each sample has only 12 bit, but by looking at when in a series of samples the LSB flips, you can make an educated guess about where between the two voltage levels the real signal is, effectively adding some bits to the resolution. It only works if the signal noise is below the resolution and if the signal is not static.
    Imagine a slowly increasing voltage. It increasey by 0.25 LSB per sample. So after 4 samples you'll see the LSB increase. This enables you to make a guess that at the next sample the value will be 0.25LSB higher, even if the LSB does not change at all for the next 4 samples. To avoid aliasing effects you cann get one more bit (LSB-1) resolution for every factor 4 of oversampling.
    Since this mechanism fails when you have a static non-changing signal, you can add a small (in the range of 1 or 2 LSB) triangular or sinusodial signal, so it will shift the original signal above the LSB threshold every nth sample, allowing you to guess the 'real' value better than the resolution of the ADC.

    If the signal noise itself is above the resolution already, oversampling is worthless as it will by no means increase the resoltuin above the SNR level. If the SNR is 60dB, you'll get only 10 bits usable resolution, no matter what you do. Éverythign above is not trustworthy. You can, however, if you know that your signal is static, add a low-pass filter to the signal. THis is either done by hardware (actually, the sample&hold of the ADC12 is an implicit low-pass as it consists of a multiplexer with some resistance and a capacitor for keeping the voltage during the conversion, which forms a low pass that increases with length of the sample phase) or you can average several samples. Doing so will reduce the high-frequent signal noise and may (depending on the noise) increase the number of usable bits. But not beyond the ADCs resolution. And it does not help you at all if the signal noise is below the resoluton already.

    Anyway, besides the noise on the signal itself, there is also the noise inside the ADC system itself. Caused by power supply (supply voltage rejection ratio), the current flows in resistors and semiconductors etc. This is the SNR value in the datasheet. This is usually white (every frequence) noise, so a low-pass is only of limited use except if it is a really large low-pass and the signal is static (non-changing). Then in theory you can sample eternally and the average of all these samples will be noise-free :)

    A good combination is a moving average, which allows filtering the high-frequent noise by still providing a 'new' value with each sample.

    What of all these is the best approach, depends on the cirumstances and the goal.
    In case of the temperature sensor, simple averaging of several samples should do the trick, except if you need a high-speed protocol of self-heating effects. But I think the sensor is too slow and too much dependent on the reference voltage to be a good instrument for this. Not to count that the sensor will add a significant part to the self-heating process itself, since it is more or less a resistor with a high temperature coefficient and to get a voltage from it that can be measured you'll need to put a current through it. Which causes self-heating and also stresses the reference voltage :)

**Attention** This is a public forum