CY8CKIT-003 PSoC 3 FirstTouch Starter Kit Guide, Spec. # 001-49613 Rev. *B
23
Example Projects
Figure 4-12. Temperature Sensor Project Flowchart
4.3.1.1
Temperature Sensing Design Principle
As shown in
Figure 4-13
, the design for temperature sensing uses a voltage divider with a precision
resistor on one side and the thermistor on the other to estimate the thermistor resistance. The
temperature calculations are as accurate as the resistance measurement of the thermistor.
Figure 4-13. Temperature Sensing Design Principle
This setup significantly removes gain and offset errors from the resistance calculation.
The analog voltage output from the divider is converted to a digital signal using the ADC on the
PSoC. To gain additional accuracy, the voltage at the input side of the divider is also measured. The
resistor value is calculated using the ratio of the voltages across the two resistors in the resistor
ladder.
Rthermistor = Rref * (V
1
-V
2
/V
0
-V
1
)
In this equation,
V
2
= 0 (Ground voltage)
Offset errors, if any, are removed due to subtraction of the two measured voltages. The ratio of these
two values removes the measurement path gain error. The error due to the reference resistor is
reduced by using a precision resistance in series with the thermistor.
Boot
Start
String complete?
Yes
Change temperature
display mode
Compute temperature
Update the raster display
data array
Read and process
accelerometer Y axis
voltage
Calculate character offset
in the string and update
LED display
If switch is pressed?
No
No
Yes
PSoC
Blocks
R
Ref
R
Thermistor
V
2
V
1
V
0
A
M
U
X
ADC
VDC
electronic components distributor