CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *J
51
Example Projects
Note
: The calibration constant is subtracted from the measured IC temperature inside 'Measure-
ColdJnSensorTemp' function, for offset calibration. On system reset, the calibration constant is ini-
tialized to ‘0’ and is set to the appropriate value after calibration. The calibration constant stored in
EEPROM can be used for power-on-reset calibration. This can be implemented by users and is not
demonstrated in this project.
5.2.3.3.8
Noise Reduction and Offset Cancellation
The accuracy of temperature reading displayed by a sensor depends on the ADC offset. Reducing
ADC offset increases the temperature accuracy. Similarly, electronic noise affects the resolution
measurement. A lower noise improves resolution. The techniques used in this example project to
reduce offset and noise for all sensors are described in the following sections.
Sensor Output Filter
A software IIR filter is applied on the output voltage of the thermocouple, RTD, and diode sensors to
eliminate noise. See application note,
AN2099 - PSoC 1, PSoC 3, and PSoC 5LP - Single-Pole Infi-
nite Impulse Response (IIR) Filters
, for details. The filter (attenuation factor) applied depends on the
noise on the output voltage of the sensor. The filter for a sensor is selected in such a way that the
temperature resolution of the sensor is 0.1 °C. The function FilterSignal() in the code performs filter-
ing.
Applying a filter increases the temperature settling time. A filter with a low cut-off frequency takes a
much larger time for the temperature to settle down. To avoid large settling times when the tempera-
ture changes drastically, an algorithm is used where the filter is applied only when required (when
the temperature is closer to the final temperature).
The filter attenuation factor can be changed in the
filter.h
file. For instance, to change the filter atten-
uation factor of the thermocouple from 4 to 5, go to
filter.h
and modify the following line of code.
/* Filter coefficient for sensors */
#define
TC_FILTER_COEFF_SHIFT 4
Note
: A higher attenuation factor reduces LCD flicker, but increases the temperature settling time.
Correlated Double Sampling (CDS)
Correlated double sampling is a technique where the offset and low frequency noise is eliminated by
subtracting a zero voltage reading from every voltage sample. See application note
for
more details on correlated double sampling. The ADC multiplexer, Channel 7, is used to make zero-
voltage measurements for the thermistor and the thermocouple. To make zero-voltage measure-
ments for the RTD and the diodes, pass a zero current through the RTD, diode, or calibration resistor
and measure the ADC output across the RTD/diode/calibration resistor.