Please note that Cypress is an Infineon Technologies Company.
The document following this cover page is marked as “Cypress” document as this is the
company that originally developed the product. Please note that Infineon will continue
to offer the product to new and existing customers as part of the Infineon product
portfolio.
Continuity of document content
The fact that Infineon offers the following product as part of the Infineon product
portfolio does not lead to any changes to this document. Future revisions will occur
when appropriate, and any changes will be set out on the document history page.
Continuity of ordering part numbers
Infineon continues to support existing part numbers. Please continue to use the
ordering part numbers listed in the datasheet for ordering.
www.infineon.com
CY8CKIT-025
PSoC® Precision Analog Temperature
Sensor Expansion Board Kit Guide
Doc. # 001-65791 Rev. *K
Cypress Semiconductor
198 Champion Court
San Jose, CA 95134-1709
Phone (USA): 800.858.1810
Phone (Intnl): 408.943.2600
www.cypress.com
Copyrights
Copyrights
© Cypress Semiconductor Corporation, 2011–2017. This document is the property of Cypress Semiconductor Corporation
and its subsidiaries, including Spansion LLC ("Cypress"). This document, including any software or firmware included or referenced in this document ("Software"), is owned by Cypress under the intellectual property laws and treaties of the United
States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property
rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with
Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable
license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code
form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress's patents that
are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely
for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software
is prohibited.
TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in
this document. Any information provided in this document, including any sample design information or programming code, is
provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test
the functionality and safety of any application made of this information and any resulting product. Cypress products are not
designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems (including
resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses where
the failure of the device or system could cause personal injury, death, or property damage ("Unintended Uses"). A critical
component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure
of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and
hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress
products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other liabilities,
including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products.
Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, PSoC, CapSense, EZ-USB, F-RAM, and
Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list
of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
2
Contents
Safety Information
1. Introduction
1.1
1.2
1.3
1.4
1.5
5
7
Kit Contents .................................................................................................................9
PSoC Creator™.........................................................................................................11
Getting Started...........................................................................................................11
Additional Learning Resources..................................................................................11
1.4.1 Beginner Resources.......................................................................................11
1.4.2 Engineers Looking for More ...........................................................................11
1.4.3 Learn from Peers ...........................................................................................11
1.4.4 More Code Examples.....................................................................................12
1.4.5 Technical Support...........................................................................................13
Document Conventions .............................................................................................14
2. Software Installation
15
3. Kit Operation
18
3.1
3.2
3.3
3.4
Kit Overview...............................................................................................................18
Kit Connections..........................................................................................................18
Temperature Sensors ................................................................................................21
3.3.1 Thermocouple ................................................................................................21
3.3.2 Thermistor ......................................................................................................21
3.3.3 RTD................................................................................................................22
3.3.4 Diode..............................................................................................................22
Prototype Boards .......................................................................................................23
4. Hardware
4.1
4.2
4.3
4.4
4.5
24
System Block Diagram and Theory of System Operation .........................................24
Thermocouple............................................................................................................24
Thermistor..................................................................................................................25
RTD ...........................................................................................................................26
Diode .........................................................................................................................28
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
3
Contents
5. Example Projects
5.1
5.2
5.3
5.4
A. Appendix
A.1
A.2
A.3
A.4
30
Overview....................................................................................................................30
5.1.1 Migrating Projects to use with CY8CKIT-050 and CY8CKIT-010 ...................31
Tempsense ................................................................................................................32
5.2.1 Project Description .........................................................................................32
5.2.2 Project Operation ...........................................................................................33
5.2.3 Project Details ................................................................................................40
Sequenced ADC ........................................................................................................52
5.3.1 Project Description .........................................................................................52
5.3.2 Project Operation ...........................................................................................52
5.3.3 Project Details ................................................................................................58
Thermal Management................................................................................................68
5.4.1 Project Description .........................................................................................68
5.4.2 Project Operation ...........................................................................................70
5.4.3 Project Details ................................................................................................75
83
Schematic ..................................................................................................................83
Board Layout .............................................................................................................84
A.2.1 PDC-09802 Top .............................................................................................84
A.2.2 PDC-09802 Bottom ........................................................................................84
Bill of Materials (BOM) ...............................................................................................85
Regulatory Compliance Information ..........................................................................85
Revision History
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
86
4
Safety Information
Regulatory Compliance
The CY8CKIT-025 is intended for use as a development platform for hardware or software in a
laboratory environment. The board is an open system design, which does not include a shielded
enclosure. This may cause interference to other electrical or electronic devices in close proximity.
In a domestic environment, this product may cause radio interference. In this case, you may be
required to take adequate prevention measures. Also, the board should not be used near any
medical equipment or RF devices.
Attaching additional wiring to this product or modifying the product operation from the factory default
may affect its performance and cause interference with other apparatus in the immediate vicinity. If
such interference is detected, suitable mitigating measures should be taken.
The CY8CKIT-025 as shipped from the factory has been verified to meet with requirements of CE as
a Class A product.
The CY8CKIT-025 contains electrostatic discharge (ESD) sensitive
devices. Electrostatic charges readily accumulate on the human body
and any equipment, and can discharge without detection. Permanent
damage may occur on devices subjected to high-energy discharges.
Proper ESD precautions are recommended to avoid performance
degradation or loss of functionality. Store unused CY8CKIT-025 boards
in the protective shipping package.
End-of-Life/Product Recycling
This kit has an end-of-life cycle five years from the date of manufacturing
mentioned on the back of the box. Contact your nearest recycler for
discarding the kit.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
5
Safety Information
General Safety Instructions
Electrostatic Discharge Protection
ESD can damage boards and associated components. Cypress recommends that you perform
procedures only at an ESD workstation. If one is not available, use appropriate ESD protection by
wearing an antistatic wrist strap attached to chassis ground (any unpainted metal surface) on your
board when handling parts.
Handling Boards
CY8CKIT-025 boards are sensitive to ESD. Hold the board only by its edges. After removing the
board from its box, place it on a grounded, static free surface. Use a conductive foam pad if
available. Do not slide board over any surface.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
6
1.
Introduction
Thank you for your interest in PSoC solutions for temperature sensing. The CY8CKIT-025 PSoC®
Precision Analog Temperature Sensor Expansion Board Kit (EBK) together with the example
projects provide complete solutions demonstrating PSoC-based temperature sensing. The
CY8CKIT-025 board connects with the CY8CKIT-030 PSoC 3 Development Kit (DVK), CY8CKIT050 PSoC 5LP Development Kit, or the CY8CKIT-001 PSoC Development Kit. The kit supports
temperature measurement using four temperature sensors:
■
■
■
■
Thermocouple
Thermistor
Resistive Temperature Detector (RTD)
Diode
Note: The TempSense example project outputs one more temperature value read from the DS600
IC. This is used for cold junction compensation for the thermocouple and not intended as an option
for the onboard temperature sensor.
The four sensors have their own advantages and limitations. The choice of a sensor for an
application depends on the cost, accuracy required, and temperature measurement range.
Thermocouples measure temperatures in a wide range, from –250 °C to 2300 °C. However, the
voltage change is not linear and takes more CPU cycles for temperature computation.
Thermocouples require another temperature sensor, such as the thermistor, diode, or RTD, to
measure the cold junction temperature. The DS600 IC or the thermistor can be used for cold junction
compensation of the thermocouple. A thermistor, diode, or RTD cannot measure temperatures
greater than 850 °C. Thermocouples have a very good response time.
Thermistors have a highly nonlinear curve and take more CPU cycles for temperature computation.
They measure temperature in the range –100 °C to 200 °C. Thermistors have a good response time
and they are less expensive when compared to RTDs and thermocouples.
RTDs have a linear and repeatable resistance variation with temperature, making it easier to
compute temperature accurately. They measure temperature from –200 °C to 850 °C. RTDs are
expensive due to their linearity and accuracy. RTDs have a lower response time compared to a
thermistor or thermocouple.
Diodes are the cheapest sensors for temperature measurement. They measure temperature in the
range –50 °C to 150 °C. Accurate temperature measurement is difficult with a diode. Table 1-1
shows a comparison among the four sensors.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
7
Introduction
Table 1-1. Temperature Sensor Comparison
Parameter
RTD
Thermocouple
Thermistor
Diode
Temperature range
–200 to +850
(°C)
–250 to +2350
–100 to +300
–50 to +150
Sensitivity at 25 °C 0.387 Ω/°C
40 μV/°C (K-type)
416 Ω/°C
250 μV /°C
Accuracy
High
Medium to High
Medium
Low
Linearity
Good
Typical cost (US $) $3–$80
Fair
Poor
Good
$3–$15
$0.2–$10
Device Selector). If the CY8CKIT-001 project is being updated to
be used with the PSoC 5LP processor module, you must also change the CMOD pin mapping from
P2_7 to pin 15_5.
To print floating point variables on the LCD, set the ‘Use newlib-nano Float Formatting’ parameter to
True under Project > Build Settings > Linker as shown in Figure 5-1 and change the Heap Size to
0x200 in the System tab in the .cydwr file as shown in Figure 5-2.
Figure 5-1. Build Settings
Figure 5-2. System Tab
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
31
Example Projects
The following sections provide a detailed description of these example projects.
5.2
Tempsense
This example project demonstrates high-precision, high-accuracy, multi-channel temperature sensing using PSoC.
5.2.1
Project Description
This project displays the temperature measured using a thermocouple, IC sensor, thermistor, RTD,
and two diodes. It also provides steps to calibrate the RTD, diode, and IC. The user interface of this
example is controlled by two CapSense® buttons, a CapSense slider, two mechanical push buttons,
and a character LCD.
When the example project for CY8CKIT-030 is programmed, the LCD displays a welcome message
for one second. It then displays the temperature from the thermocouple, which is the first item in the
user selectable menu. CapSense buttons P5_5 and P5_6 act as the scroll down and scroll up menu
buttons, respectively. A mechanical switch connected to P6_1 is used to proceed through various
calibration steps. A CapSense slider is used to set the calibration temperature.
The menu has the following items:
■
Thermocouple temperature display
■
IC temperature display
■
Thermistor temperature display
■
RTD temperature display
■
Diode1 temperature display
■
Diode2 temperature display
■
Simultaneous temperature display labels (see Figure 5-3)
■
Simultaneous temperature display from all 6 sensors (see Figure 5-4)
■
Calibrate RTD temperature
■
Calibrate Diode1 temperature
■
Calibrate Diode2 temperature
■
Calibrate IC sensor temperature
In the simultaneous display, the first row displays the temperature of the thermocouple, IC, and
thermistor. The second row displays the temperature of the RTD, diode 1, and diode2, as shown in
Figure 5-4.
Figure 5-3. Simultaneous Temperature Display Labels
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
32
Example Projects
Figure 5-4. Simultaneous Temperature Display for All Six Sensors
Thermocouple
IC
RTD
Diode1
5.2.2
Project Operation
5.2.2.1
Hardware Connections
Thermistor
Diode2
The kit includes example projects for the CY8CKIT-001 DVK, CY8CKIT-030 DVK, and CY8CKIT-050
DVK hardware platforms. The pin mapping for CY8CKIT-030 and CY8CKIT-050 are identical; follow
the instructions provided for CY8CKIT-030 PSoC 3 DVK for CY8CKIT-050 PSoC 5LP DVK as well.
The main difference between the examples for the CY8CKIT-001 and CY8CKIT-030 platforms is the
PSoC pin mapping. The project provided for the CY8CKIT-001 PSoC DVK can be used with both
PSoC 3 and PSoC 5LP. See Migrating Projects to use with CY8CKIT-050 and CY8CKIT-010 on
page 31 for more details.
5.2.2.1.1
CY8CKIT-030 PSoC DVK
1. Plug the PSoC Precision Analog Temperature Sensor EBK to port E of the CY8CKIT-030 DVK.
2. No jumper wires are required for the PSoC 3 DVK examples because the mechanical buttons are
hard-wired to GPIOs. Ensure that the LCD included with the PSoC 3 DVK is attached.
3. Set VDDD and VDDA to 3.3 V using J10 and J11.
4. In the CY8CKIT-025 EBK, choose appropriate jumper settings for internal sensors; see the Kit
Operation chapter on page 18.
Note: When using the CY8CKIT-025 EBK with CY8CKIT-050 PSoC 5LP DVK, remove the jumpers
from J43 and J44 on PSoC 5LP DVK.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
33
Example Projects
5.2.2.1.2
CY8CKIT-001 PSoC DVK
1. Plug the PSoC Precision Analog Temperature Sensor EBK to port A of the CY8CKIT-001 DVK.
2. In the pin header/breadboard area of the CY8CKIT-001 base board, use jumper wires to make
the following connections:
a. SW1 to P1_7
b. SW2 to P0_7
3. Set the system to run at 3.3 V using SW3; set J6 VDD DIG and J7 VDD ANLG to VDD = 3.3 V.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
34
Example Projects
4. Ensure that the LCD included with the PSoC DVK is attached and the LCD power jumper (J12) is
in the ON position.
5. In the CY8CKIT-025 EBK, choose appropriate jumper settings for internal sensors; see the Kit
Operation chapter on page 18.
5.2.2.2
Run Tempsense Example Firmware
5.2.2.2.1
CY8CKIT-030 PSoC 3 DVK
The steps to run the example firmware on CY8CKIT-030 are:
1. Attach a USB cable from the PC to the PSoC 3 DVK program/debug USB port (use J1, the USB
connector closest to the corner of the board).
2. Open the Tempsense_030_050 project using PSoC Creator and select Debug > Program to program the PSoC.
3. Detach the USB cable and connect hardware according to Hardware Connections on page 33.
4. Attach the USB cable again from the PC to the PSoC 3 DVK program/debug USB port (use J1).
5. Press the Reset (SW1) button on the PSoC 3 DVK to run the newly programmed firmware
image.
6. On reset, the LCD displays a welcome message and the temperature reading from the thermocouple, which is the first item in the user selectable menu. SW2 can be used to toggle the cold
junction compensation sensor between the IC (DS600) and thermistor.
7. Press CapSense button P5_5 to scroll down the menu and P5_6 to scroll up the menu.
8. Use SW2 to proceed through the calibration steps; see RTD Calibration on page 47.
9. Use SW3 to return to the previous step during calibration.
5.2.2.2.2
CY8CKIT-001 PSoC DVK
The steps to run the example firmware on CY8CKIT-001 are:
1. Apply 12 VDC power to the PSoC DVK.
2. Attach the MiniProg3 device, first to a USB port on the PC and then to the PROG port on the
CY8CKIT-009 PSoC 3/CY8CKIT-010 PSoC 5LP processor module.
3. Open the Tempsense_001 project using PSoC Creator and select Debug > Program to program
the PSoC.
4. Disconnect power to the PSoC DVK and connect hardware according to Hardware Connections
on page 33.
5. Power the PSoC DVK.
6. On reset, the LCD displays a welcome message and the temperature reading from the thermocouple, which is the first item in the user selectable menu. SW1 can be used to toggle the cold
junction compensation sensor between the IC (DS600) and thermistor
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
35
Example Projects
7. Press CapSense button P0_5 to scroll down the menu and P0_6 to scroll up the menu.
8. Use SW1 to proceed through calibration steps; see RTD Calibration on page 47.
9. Use SW2 to return to the previous step during calibration.
5.2.2.3
Testing the Project
For best results when testing temperature measurements, ensure that you have good thermal contact between the sensor and your reference thermometer. Also, make sure there is minimal air flow,
which can result in temperature gradient. Sample test results are given in the following sections.
5.2.2.4
Expected Performance and Test Results
This section explains the expected resolution and accuracy of the temperature displayed by all the
sensors.
5.2.2.4.1
Accuracy
The accuracy of the temperature displayed depends on the sensor and the signal chain.
Sensor
Each sensor has a tolerance, which is available in the datasheet provided by the sensor manufacturer. The tolerance indicates the error due to replacement of one sensor with another of the same
part number. The tolerance of each onboard sensor is listed in Table 5-1. These numbers are from
the respective sensor datasheets.
Table 5-1. Temperature Sensor Tolerances
Sensor
Thermocouple
5SRTC-GG-K-20-36
Thermistor
NCP18XH103F03RB
RTD
PTS080501B100RP100
Diode
IC
Tolerance Standard
ASTM special limits of error
1.1 °C or 0.4%, whichever is
higher
1% at 25 °C
1% B-value tolerance
IEC Class B RTD
(0.30 + 0.005T) °C
–
–
Maximum Tolerance
Error at 25 °C
Maximum Tolerance
Error at 100°C
± 1.1 °C
± 1.1 °C
± 0.4 °C
± 2 °C
± 0.43 °C
± 0.8 °C
–
± 0.5 °C
–
± 0.5 °C
For diode, the ideality factor is the source of its tolerance. This number is generally not mentioned in
the diode datasheet and must be determined experimentally. Diode ideality factor generally lies
between 1 and 1.01. An ideality factor difference of 0.004 (using 1.008 instead of 1.004) causes an
error of around 2 °C. See AN60590 - PSoC 3 and PSoC 5LP - Temperature Measurement with a
Diode for more details on these calculations.
Signal Chain
Signal chain error includes the errors due to the ADC, IDAC, the calibration (reference) resistors and
the measurement method. The resources used differ from sensor to sensor.
The main sources of ADC error are its offset, gain error, and INL. Of these, the offset error is cancelled in all cases by correlated double sampling. ADC gain error is eliminated by using a precision
reference resistor in thermistor and RTD.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
36
Example Projects
The main sources of IDAC error are its offset, gain error, and INL. The IDAC errors are completely
removed by passing the IDAC current through a precise reference resistor and measuring the voltage across it.
The reference resistor tolerance determines the error caused by it. A 0.1% reference resistance is
used in both RTD and thermistor temperature measurements.
The error component caused by the signal chain for each sensor is listed in Table 5-2.
Table 5-2. Signal Chain Errors for PSoC 3
Sensor
Thermocouple
Thermistor
RTD
Diode
Signal Chain Error Components
ADC gain error, INL, cold junction IC
sensor error (± 0.5 °C)
ADC INL, reference resistor tolerance
ADC INL, reference resistor tolerance
ADC gain error, INL
Typ/Max Error at 25 °C
Max Error at 100 °C
0.1 / 2.1
2.2
0 / 0.05
0.1 / 0.5
0.3 / 2.6
0.6
0.9
3.8
Cypress application notes on each of the four sensors explain the signal chain errors in detail.
5.2.2.4.2
Resolution (peak to peak)
The temperature measurement resolution is the minimum temperature increment possible. A 0.1 °C
resolution is achieved on all sensors. A software IIR filter (see Sensor Output Filter on page 51) is
applied on some sensors to achieve 0.1 °C resolution. The application notes associated with each
sensor gives more details on how 0.1 °C resolution is achieved on each sensor. Generally, a small
flicker is seen on the LCD temperature display. A small flicker of 0.2 °C on thermocouple readings,
0 °C on IC and thermistor, 0.1 °C on RTD, and 0.3 °C on diode at a very small rate has been
observed in the example projects. It can be reduced by additional filtering at the cost of temperature
settling time. The IIR filter can be changed in firmware, as shown in Sensor Output Filter on page 51.
5.2.2.4.3
Test Results
This section shows the test results on the sample board. Wherever possible, measurement techniques are used to identify the signal chain performance of PSoC.
Thermocouple
Thermocouple input can be simulated by a millivolt source. This eliminates any error due to thermocouple tolerance and allows you to test the signal chain in the whole temperature range without a
heat source. A millivolt source is fed to the thermocouple inputs and the cold junction temperature is
forced to 0 °C in the example project. The temperature shown by PSoC is noted and the voltage
input is measured using an accurate voltmeter; the temperature corresponding to that voltage is calculated using NIST tables. The expected results and actual results are listed in Table 5-3.
Table 5-3. Thermocouple Test Results
Simulated thermo-emf
(mV)
Voltage read by
multimeter (mV)
Expected
temperature (°C)
Obtained
Temperature (°C)
Error (°C)
–5
–4.695
–141
–141.1
0.1
–4
–3.666
–103.7
–103.7
0
–3
–2.575
–69.6
–69.5
–0.1
–2
–1.741
–45.9
–45.7
–0.2
–1
–0.654
–16.77
–16.7
–0.1
0
0
0
0
0
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
37
Example Projects
Table 5-3. Thermocouple Test Results
Simulated thermo-emf
(mV)
Voltage read by
multimeter (mV)
Expected
temperature (°C)
Obtained
Temperature (°C)
1
2
0.666
16.7
16.7
0
1.754
43.46
43.4
0.1
3
2.58
63.5
63.5
0
4
3.663
89.5
89.4
0.1
5
4.712
114.9
114.9
0
10
9.582
235.9
235.8
0.1
20
19.58
475
475
0
30
28.76
691.2
691.1
0.1
40
39.54
955.75
955.8
–0.1
50
49.816
1227
1226.9
0.1
Error (°C)
Thermistor
A thermistor can be simulated by a potentiometer. By varying the potentiometer resistance, you can
simulate temperatures in the whole temperature range of the thermistor. A potentiometer resistance
is used to provide resistance in the whole thermistor temperature range; the thermistor temperature
measured by PSoC is noted. The resistance is also measured by an accurate multimeter and the
expected temperature is calculated using the Steinhart-Hart equation. Table 5-4 shows the results.
Table 5-4. Thermistor Test Results
Resistance in ohms
Expected Temperature
(Multimeter Measurement)
Measured Temperature
(°C)
Signal Chain Error
(°C)
99318.0
–27.6
–27.60
0.00
32593.0
–4.0
–4.1
–0.10
12135.0
19.9
19.9
0.00
10000.0
25.0
25
0.00
6951.0
35.0
35
0.00
4230.0
49.5
49.6
0.10
3021.0
60.0
60
0.00
2065.0
72.6
72.7
0.10
1260.0
90.2
90.2
0.00
977.6
99.9
99.9
0.00
800.8
107.8
107.8
0.00
549.5
123.5
123.6
0.10
419.3
135.6
135.5
–0.10
308.3
150.1
150
–0.10
270.0
156.6
156.5
–0.10
189.3
175.1
175
–0.10
122.7
199.7
199.5
–0.20
RTD
An RTD can be simulated by a potentiometer. By varying the potentiometer resistance, you can simulate the temperature in the whole temperature range of the RTD. A potentiometer is used to provide
resistances in the whole RTD temperature range; the RTD temperature measured by PSoC is noted.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
38
Example Projects
The resistance is also measured by an accurate multimeter and the expected temperature is calculated using Callender Van Dusen equation. Table 5-5 shows the results .
Table 5-5. RTD Test Results
Resistance in Ohms
(Multimeter Measurement)
Expected Temperature
(°C)
Measured Temperature
(°C)
Temp Measure Error
(Signal Chain) (°C)
79.85
–51.1
–51.3
–0.20
100.06
0.2
0.2
0.00
110.76
27.6
27.7
0.10
120.25
52.2
52.1
–0.10
133
85.5
85.3
–0.20
138.5
100.0
100
0.00
150
130.4
130.3
–0.10
194.4
250.8
251
0.20
280.85
499.8
500
0.20
315.7
606.2
606.2
0.00
371.8
787.0
787.3
0.30
Diode
Diode temperature accuracy is tested in a temperature forcing system by forcing a specific temperature and comparing the diode results with those of a standard thermometer. The standard microthermal thermocouple thermometer, with an accuracy of 1.3 °C (including thermocouple probe error), is
used. Table 5-6 shows the results.
Table 5-6. Diode Test Results
Temperature Measured using
Standard Thermometer
Diode Measured Temperature
(with PSoC) (°C)
0.8
1.2
0.4
6.2
5.6
–0.6
17
16.1
–0.9
22
21
–1
30
29.3
–0.7
75.3
74.7
–0.6
99.5
99.4
–0.1
Diode Temperature Error (°C)
DS600 IC Sensor
The IC sensor signal chain accuracy is tested by measuring the voltage output by the IC at various
temperatures and calculating the expected temperature and comparing it to the temperature displayed by PSoC. Sample test results at a few temperature points are shown in Table 5-7.
Table 5-7. IC Sensor Test Results
IC Output Voltage (mV)
640.32
Expected Temperature (°C) Observed Temperature (°C)
Error (°C)
20.4
20.4
0.0
660.34
23.5
23.5
0.0
702.22
30.0
30
0.0
733.73
34.8
34.8
0.0
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
39
Example Projects
5.2.2.4.4
Simultaneous Temperature Display of all Six Sensors
The sensor-to-sensor variation in temperature is 0.5 °C to 1.1 °C without calibration. The signal
chain can add additional error. Remember the following thermal considerations to understand the
temperature difference between the sensors in the simultaneous display of six temperatures.
■
The thermocouple measures the air temperature; the RTD and thermistor measure the board
temperature; the IC measures the temperature of the exposed pad below it; and diodes are
screwed on to the board although they hang in the air.
■
Because the thermocouple measures the air temperature, it is about a degree Celsius lower than
the board at room temperature. Place the tip of the thermocouple on the board and you will see
the thermocouple temperature rise by a degree.
■
Place the board in the sun; you will note that the temperature display shown by the onboard sensors slowly rise. In tropical regions, you can see the board temperature rise to greater than 50 °C,
while the thermocouple temperature will be around 35 °C to 37 °C.
■
The IC sensor has a thermal pad underneath it. Ideally, it is expected to be isothermal with the
cold junction. Ensuring an isothermal connection requires providing good thermal contact
between the thermocouple cold junction and the exposed IC pad. If the thermal contact is not provided, having the cold junction IC very close to the cold junction terminals is sufficient. The temperature difference between the cold junction terminals and the IC pad will not be more than
0.5 °C. Most thermocouple applications do not demand high accuracy and it is sufficient to have
the cold junction IC very close to the cold junction. The IC temperature is about 0.3 °C to 0.5 °C
lower than the RTD and thermistor temperature because the exposed pad underneath the IC is
connected to ground. This is an offset error. This offset error can be eliminated by performing an
offset correction, as shown in IC Calibration on page 50.
Apart from the above thermal considerations, the sensor and bias resistor tolerances should determine the sensor temperature. Typically, RTD and thermistor temperatures are within about 0.3 °C of
each other; IC temperature and diode temperature is within about 0.5°C lower than the thermistor
temperature; and thermocouple temperature is about 1 °C to 2 °C lower than the thermistor temperature.
5.2.2.4.5
CY8CKIT-001 PSoC DVK Thermistor Temperature
The CY8CKIT-025 connects to the Port A connector on the CY8CKIT-001. Through this connection,
the resistor/thermistor network connects to pin 5_0. On PSoC port pins 0_0, 0_1, 3_6, and 3_7 connect directly to the opamp output. Thus, there is no direct connection from an opamp to the thermistor/resistor network, which is connected to pin 5_0. Therefore, an unbuffered VDAC is used to
supply the required voltage for the thermistor/resistor network. Due to internal routing this connection has some parasitic resistance, which causes a voltage drop. The ADC measures this voltage
drop and compensates. However, thermistor measurement on CY8CKIT-001 may result in higher
error up to 0.5 °C. For details on internal analog routing, see AN58827 - PSoC 3 and PSoC 5LP
Internal Analog Routing Considerations.
5.2.3
Project Details
5.2.3.1
Project Schematic
Figure 5-5 shows the PSoC Creator schematic of the project. An eight-channel ADC is used to
sense the six sensors. The IDAC has four channels to provide excitation to the RTD and the diodes.
Whenever IDAC channel 2 is connected, the IDAC output flows through the diode connected transistor Q1, Pin 3_7 and to ground. The ground connection is provided on the pin in firmware. PSoC's pin
structure allows easy connection to the ground.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
40
Example Projects
Figure 5-5. PSoC Creator Top Design
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
41
Example Projects
5.2.3.2
Component Configuration
5.2.3.2.1
ADC Configuration Settings
The ADC is configured in 20-bit mode for all sensors except the thermistor, where it is configured in
16-bit mode. Figure 5-6 shows the configuration used.
Figure 5-6. ADC Configuration
The ADC Buffer Mode is set to Level Shift because many of the voltages being read are near VSS;
this setting yields better ADC results for signals near VSS.
5.2.3.2.2
IDAC Configuration
The IDAC is configured in the 0 to 255 µA-range. The IDAC is used for RTD and diode temperature
measurements. The IDAC data register value is modified in firmware, as required for each of these
temperature measurements.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
42
Example Projects
Figure 5-7. IDAC Configuration
5.2.3.3
Firmware Description and Flowchart
The temperature calculation flowchart for each sensor and the flowchart for calibrating RTD and
diode are explained in this section. A single point calibration is provided for RTD and diode.
5.2.3.3.1
Thermocouple
Figure 5-8 illustrates the steps involved in thermocouple temperature measurement.
This flowchart involves conversion of voltage to temperature and vice versa. The conversion is done
using thermocouple calculator component, which in turn uses the polynomial provided by NIST. The
mathematical conversion results in an error less than 0.07 °C.
The example project uses a K-type thermocouple. The component supports all thermocouple types
and provides application programming interfaces (APIs) for voltage to temperature conversion and
vice versa. IC (DS600) or thermistor can be used for cold junction compensation.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
43
Example Projects
Figure 5-8. Thermocouple Flowchart
Start
Read Vssa Ref voltage for
correlated double sampling
(CDS)
Read cold junction (CJ)
voltage
Convert CJ voltage to CJ
temperature
Convert CJ temperature to
CJ compensation voltage.
Read hot junction voltage,
perform CDS and filter
Add hot junction voltage to
CJ compensation voltage
Convert voltage to
temperature
END
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
44
Example Projects
5.2.3.3.2
Thermistor
Figure 5-9 shows the thermistor temperature calculation flowchart.
Figure 5-9. Thermistor Flowchart
Start
Read Vssa Ref voltage for CDS
Read voltage across thermistor
reference resistor (Vref) and
perform offset cancellation(CDS)
Read voltage across thermistor
(Vt) and perform offset
cancellation(CDS)
Calculate thermistor resistance
from Vref and Vt
Calculate temperature from the
thermistor resistance
END
The flowchart involves conversion of thermistor resistance to temperature. This is done using the
thermistor calculator component. The component supports both LUT and the Steinhart-Hart equation, and provides an API for converting resistance to temperature.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
45
Example Projects
5.2.3.3.3
RTD
Figure 5-10 shows the RTD temperature calculation flowchart.
Figure 5-10. RTD Flowchart
Start
Set IDAC to source 128 uA
current
Read voltage across RTD
sensor at zero current for CDS
Connect IDAC current mux to
calibration reference resistor and
measure voltage V1
CDS and filter V2
Read voltage across
calibration resistor zero
current for CDS
Measure RTD resistance from V2
and V1
CDS and filter V1
Calculate temperature from the
RTD resistance
Connect IDAC current mux
channel to RTD and
measure voltage V2
End
The flowchart involves converting RTD resistance to temperature. The RTD calculator component is
used for this conversion. The RTD component chooses the correct polynomial order based on your
accuracy requirements.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
46
Example Projects
5.2.3.3.4
Diode
Figure 5-11. Diode Flowchart
Start
Connect IDAC current mux to
calibration reference resistor
Connect IDAC current mux
channel to diode
Get zero current
offset voltage
First
measurement?
No
First
measurement?
No
Yes
Set IDAC current to
10 uA
Set IDAC current to
100 uA
Yes
Set IDAC current to
10 uA CDS voltage
and filter as Vref1
First
measurement?
Set IDAC current to
100 uA CDS voltage
and filter as Vref1
No
Calculate the
current ratio
Yes
Get Vbe at 10 uA
Get Vbe at 100 uA
Calculate temperature from
reference voltages and
current ratio
End
Get voltage difference
and filter the difference
5.2.3.3.5
RTD Calibration
The RTD provided onboard confirms to IEC-70651 class B standards. A class-B RTD conforms to
the following tolerance specifications.
Tolerance = 0.30 + 0.005|t|
This means replacing one RTD with another of the same part number causes a maximum error of
0.3 °C at 0 °C and 0.8 °C at 100 °C. Calibrating the RTD can help avoid this error. AN70698
describes the calibration details.
The calibration steps for the RTD are as follows:
1. Scroll down to the Calibrate RTD (eighth) item in the menu using CapSense buttons.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
47
Example Projects
2. Proceed through calibration steps using mechanical switch SW2 connected to P6[1] of CY8CKIT030 or SW1 connected to P1[7] of CY8CKIT-001.
3. The LCD displays "Set Temp:".
Force the RTD temperature to a known measured value between 0 °C and 100 °C and enter that
temperature using the CapSense slider and buttons. Use the CapSense slider for coarse temperature setting and the CapSense button for fine settings (P5_5/P0_5 to increment the temperature
in 0.1 °C steps and P5_6/P0_6 to decrement the temperature in 0.1 °C). After the temperature is
entered accurately, press the mechanical button SW2 (CY8CKIT-030) or SW1 (CY8CKIT-001) to
calibrate.
4. The RTD calibration constant is calculated from the measured RTD resistance at the set temperature and the expected temperature value entered by the user. After calibration, the LCD displays
the message "Calibrated". Press SW2 (CY8CKIT-030) or SW1(CY8CKIT-001) to go to the main
menu temperature display.
Figure 5-12. RTD Calibration
Enter RTD Cal
Enter calibration temperature
using CapSense button and
slider
Set calibration temperature
Calculate expected resistance
(rCalc) at the given
temperature
Measure RTD resistance
(rMeasured) at calibration
temp1
RTD Cal constant = z
rCalc/rMeasured
Save the RTD calibration
constants in EEPROM
Go back to the main menu on
next switch press
Note: The calibration constant is used inside 'RTDRestoTemp' for calibration. On system reset, the
calibration constant is initialized as ‘1’. After calibration, the constant is stored in EEPROM. This
value can be used for power-on-reset calibration. This can be implemented by users and is not demonstrated in this project.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
48
Example Projects
5.2.3.3.6
Diode Calibration
Diode temperature measurement follows the equation:
V 1 – V 2
q
T = ------ -------------------
k I 1
ln --I 2
Equation 9
Here is the ideality factor of the diode, varied from diode to diode. The temperature variation resulting from the ideality factor variation can be calibrated out. As equation 9 shows, variation in results
in a scale error. Performing a scale correction eliminates this error. The procedure to perform scale
calibration is as follows:
1. Scroll down to the Calibrate Diode1 (ninth) or Calibrate Diode2 (tenth) item in the menu using
CapSense buttons. Proceed through the calibration steps using mechanical switch SW2 connected to P6[1] of CY8CKIT-030 or SW1 connected to P1[7] of CY8CKIT-001.
2. The LCD displays “Set Temp:".
Force the diode1 temperature to a known measured value between 0 °C and 100 °C, and enter
that temperature using the CapSense slider and buttons. Use the CapSense slider for coarse
temperature setting and the CapSense button for fine settings (P5_5/P0_5 to increment the temperature in 0.1 °C steps and P5_6/P0_6 to decrement the temperature in 0.1 °C). After the temperature is entered accurately, press the switch SW2 in CY8CKIT-030 or SW1 in CY8CKIT-001 to
calibrate.
3. The diode calibration constant is calculated from the measured temperature and the expected
temperature value entered by the user. After calibration, the LCD displays the message "Calibrated". Press SW2 (CY8CKIT-030) or SW1 (CY8CKIT-001) to go to the main menu temperature
display.
Figure 5-13. Diode Calibration
Start
Enter the calibration
temperature using
CapSense button and
slider
Set calibration
temperature (tIdeal)
Measure diode
temperature tMeasured)
Diode Cal constant =
tIdeal/tMeasured
Save the diode
calibration constants in
EEPROM
Go back to the main
menu on next switch
press
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
49
Example Projects
Note: The calibration constant is used inside diode temperature measurement function for calibration. On system reset, the calibration constant is initialized as ‘1’. After calibration, the constants are
stored in EEPROM. These values 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.7
IC Calibration
DS600 IC is used for cold junction compensation. Ideally an isothermal connection should be provided between the cold junction sensor and cold junction terminals. If that is not possible, having the
cold junction sensor very close to the cold junction terminals is sufficient as it is done on CY8CKIT025. This may result in a small temperature offset of around 0.5 °C. For high accuracy, a calibration
routine, which performs a single point calibration, is provided to calibrate the temperature offset
between the cold junction and the IC thermal pads.
The calibration steps for the IC temperature measurement are as follows:
1. Scroll down to the Calibrate IC (eleventh) item in the menu using CapSense buttons.
2. Proceed through the calibration steps using mechanical switch SW2 connected to P6[1] of
CY8CKIT-030 or SW1 connected to P1[7] of CY8CKIT-001.
3. The LCD displays "Set Temp:".
Force the IC temperature to a known measured value between 0 °C and 100 °C and enter that
temperature using the CapSense slider and buttons. Use the CapSense slider for coarse temperature setting and the CapSense button for fine settings (P5_5/P0_5 to increment the temperature
in 0.1 °C steps and P5_6/P0_6 to decrement the temperature in 0.1 °C). After the temperature is
entered accurately, press the mechanical button SW2 (CY8CKIT-030) or SW1 (CY8CKIT-001) to
calibrate.
4. The IC calibration constant (Offset) is calculated as the difference in measured temperature and
the expected temperature value entered by the user. After calibration, the LCD displays the message "Calibrated". Press SW2 (CY8CKIT-030) or SW1(CY8CKIT-001) to go back to main menu.
Figure 5-14. IC Calibration
Enter IC Cal
Enter calibration
temperature using
CapSense button and
slider
Set calibration
temperature (tCal)
Measure IC
temperature (tMeas)
IC offset = tMeas - tCal
Save the calibration
constant in EEPROM
Go back to the main
menu on next switch
press
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
50
Example Projects
Note: The calibration constant is subtracted from the measured IC temperature inside 'MeasureColdJnSensorTemp' function, for offset calibration. On system reset, the calibration constant is initialized 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 Infinite 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 filtering.
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 temperature 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 attenuation 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 AN66444 for
more details on correlated double sampling. The ADC multiplexer, Channel 7, is used to make zerovoltage measurements for the thermistor and the thermocouple. To make zero-voltage measurements 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.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
51
Example Projects
5.3
Sequenced ADC
This project demonstrates PSoC's ability to sense multiple inputs such as temperature sensor
inputs, power rails, and generic analog inputs at a specific sample rate where the 50- or 60-Hz noise
is eliminated.
5.3.1
Project Description
This project uses the RTD, IC temperature sensor, and diode temperature sensor from the
CY8CKIT-025 DVK. This example also measures a 20 mV full scale input, 100 mV full scale input,
3.3 V rail, and 5 V rail. The 20 mV and 100 mV measurements require external stimulus. You can
uses a low noise voltage source or analog output sensors such as a pressure sensor or a load cell to
provide 0–20 mV and 0–100 mV inputs. The 5 V and 3.3 V signals can be derived from CY8CKIT030 or CY8CKIT-001.
The project user interface is controlled by the CapSense buttons and character LCD. When the
example project is programmed on CY8CKIT-030, the LCD displays the measurement from the
RTD. Pressing CapSense button P5_5 successively displays measurements from the subsequent
temperature sensors and voltage inputs. These measurements are in the following order: diode temperature, IC temperature, 3.3 V rail, 5 V rail, 20 mV full scale input, and 100 mV full scale input.
P5_6 can be used to cycle through the measurements in reverse order.
In the previous example, readings are only taken when the LCD displays that particular measurement. However, in this project, ADC readings are taken continuously at repeated intervals. This
allows filtering of ADC readings to remove specific frequencies of interest, such as 50- or 60-Hz
hum. Furthermore, this project configures the delta-sigma ADC for 16-bit resolution instead of the
maximum 20-bit resolution. This allows faster ADC conversion times and measurement update
rates.
5.3.2
Project Operation
5.3.2.1
Hardware Connections
The kit includes example projects for the CY8CKIT-001 DVK, CY8CKIT-030 DVK, and CY8CKIT-050
DVK hardware platforms. The pin mapping for CY8CKIT-030 and CY8CKIT-050 are identical; follow
the instructions provided for CY8CKIT-030 PSoC 3 DVK for CY8CKIT-050 PSoC 5LP DVK as well.
The main difference between the examples for the CY8CKIT-001 and CY8CKIT-030 platforms is the
PSoC pin mapping. The project provided for the CY8CKIT-001 PSoC DVK can be used with both
PSoC 3 and PSoC 5LP. See Migrating Projects to use with CY8CKIT-050 and CY8CKIT-010 on
page 31 for more details.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
52
Example Projects
5.3.2.1.1
CY8CKIT-030 PSoC DVK
1. Plug the PSoC Precision Analog Temperature Sensor EBK to port E of the CY8CKIT-030 DVK.
2. Connect 3.3 V on port D to P5_0 on port D
3. The variable resistor (VR) is used for the 5 V input. Turning VR changes the voltage input to
PSoC from 0 to VDDA. On the CY8CKIT-030, the VR is directly tied to P6_5. Ensure that the VR
is turned to output 5 V. The VR is used to make sure that 5 V is not accidentally driven on the pin
if the system is set for 3.3 V.
4. Connect a 20 mV full scale differential signal from a voltage to source P5_2 (+) and P5_3 (–). You
can also use an analog output pressure sensor or load cell to give 0-20 mV input.
5. Connect a 100 mV full scale differential signal from a voltage to source P1_6 (+) and P1_7 (–).
You can also use an analog output pressure sensor or load cell to give 0-100 mV input.
6. Ensure that the LCD included with the CY8CKIT-030 DVK is attached to the LCD header.
Note: For testing purpose an external voltage source can be created by using 1.5 V AA battery
and resistor divider. Upper arm of the resistor divider can be 15 K resistor while bottom arm can
be 1 K potentiometer.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
53
Example Projects
7. Set VDDD and VDDA to 5 V using J10 and J11.
8. In the CY8KIT-025 EBK, choose appropriate jumper settings for internal sensors; see the Kit
Operation chapter on page 18.
5.3.2.1.2
CY8CKIT-001 PSoC DVK
1. Plug the PSoC Precision Analog Temperature Sensor EBK to port A of the CY8CKIT-001 DVK.
2. In the pin header/breadboard area of the CY8CKIT-001 base board, use jumper wires to make
the following connections:
a. VR to P0_7. The VR is used as the 5 V input. Ensure that the VR is turned to output 5 V. The
VR makes sure that 5 V is not accidentally driven on the pin if the system is set for 3.3 V.
b. 3.3 V to P1_2
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
54
Example Projects
3. Connect a 20 mV full scale differential signal to P0_0 (+) and P0_1 (–).
4. Connect a 100 mV full scale differential signal to P1_6 (+) and P1_7 (–).
5. Set the system to run at 5 V using SW 3; set J7 VDD DIG and J6 VDD ANLG to VDD = 5 V.
6. Ensure that the LCD included with the CY8CKIT-001 PSoC DVK is attached and the LCD power
jumper (J12) is in the ON position.
7. In the CY8CKIT-025 EBK, choose appropriate jumper settings for internal sensors; see the Kit
Operation chapter on page 18.
5.3.2.2
Run Sequenced ADC Example Firmware
5.3.2.2.1
CY8CKIT-030 PSoC 3 DVK
The steps to run the example firmware on CY8CKIT-030 are:
1. Attach a USB cable from the PC to the PSoC 3 DVK program/debug USB port (use J1, the USB
connector closest to the corner of the board).
2. Open the SequencedADC_030_050 project using PSoC Creator and select Debug > Program
to program the PSoC.
3. Detach the USB cable and connect hardware according to Hardware Connections on page 52.
4. Plug at 12 V wall-wart into the J4 barrel jack connector.
5. Press the Reset (SW1) button on the PSoC 3 DVK to run the newly programmed firmware
image.
6. On reset, the LCD displays the RTD temperature, which is the first item in the user selectable
menu.
7. Press CapSense button P5_5 to scroll up the menu and P5_6 to scroll down the menu.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
55
Example Projects
Note: In the firmware, voltage displayed on the LCD for the 5-V rail is truncated to two digits after
the decimal point. Therefore, when the potentiometer is turned to the 0V position, if the ADC
result is negative due to negative offset error, you will see ‘–0.00’ on the LCD. Increase the number of digits after the decimal point to be displayed on the LCD by increasing the floating point
qualifier in the line number 105 of the display.c file.
5.3.2.2.2
CY8CKIT-001 PSoC DVK
The steps to run the example firmware on CY8CKIT-001 are:
1. Apply 12 VDC power to the PSoC DVK.
2. Attach the MiniProg3 device, first to a USB port on the PC and then to the PROG port on the
CY8CKIT-009 PSoC 3/CY8CKIT-010 PSoC 5LP processor module.
3. Open the SequenceADC_001 project using PSoC Creator and select Debug > Program to program the PSoC.
4. Disconnect power to the PSoC DVK and connect hardware according to Hardware Connections
on page 33.
5. Power the PSoC DVK.
6. On reset, the LCD displays a welcome message and then the RTD temperature, which is the first
item in the user selectable menu.
7. Press CapSense button P0_5 to scroll up the menu and P0_6 to scroll down the menu.
Note: The diode temperature in CY8CKIT-001 is slightly lower than the actual temperature. This is
because CY8CKIT-001 is a general-purpose board and is not optimized for analog routing.
5.3.2.3
Testing the Project
For best results when testing the temperature measurements, ensure that you have good thermal
contact between the sensor (RTD, diode, or IC sensor) and your reference thermometer.
5.3.2.4
Expected Performance and Test Results
This section provides details about the expected performance of the temperature, voltage, and
power rail measurements. The output expected from the temperature sensors are similar to those
described in the previous example project, except for minor differences, such as use of 16-bit ADC
for all measurements. It is recommended to see Expected Performance and Test Results on page 36
before reading this section. The focus of this example is to show multiplexing multiple input sources,
that is, voltages, temperatures, and power rails. The section Expected Performance and Test
Results on page 36 details the tolerance specification of each temperature sensor and the expected
temperature performance from the sensors.
Following are typical expected results for each measurement observed on a sample board.
5.3.2.4.1
Voltage (20 mV) Input
A voltage source is used to provide inputs from –20 mV to +20 mV and the output displayed by
PSoC is compared to a multimeter output.
The 20 mV reading should typically be within ± 40 µV of the actual value. The ADC gain error is the
main factor driving this error and the PSoC 3 ADC with a maximum gain error of 0.2% keeps the
measurement inaccuracy to < 40 µV.
5.3.2.4.2
100 mV Input
A voltage source is used to provide inputs from –100 mV to +100 mV and the output displayed by
PSoC is compared to a multimeter output.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
56
Example Projects
The 10 mV reading should typically be within ± 200 µV of the actual value. The ADC gain error is the
main factor driving this error and PSoC 3 ADC with a maximum gain error of 0.2 percent keeps the
measurement inaccuracy to = # of Slots?
Y
Current Slot = 0
ADC
Reconfiguration
Process
N
Save Invalid Flag
from last reading
Next ADC
Config
Different?
Does Current
Slot = HW
Counter
N
Reset HW Counter
Set Invalid Flag
Y
N
Set Next Invalid
Flag
Y
Stop ADC
Reconfigure It
Restart ADC
Clear next Invalid
Increment Next
Slot
Next Slot >= #
of Slots?
Clear Next Invalid
Flag
Y
ADC Config
Valid?
Get ADC Reading
Result
N
Does Current
Slot = HW
Counter
Y
N
Set Next Invalid
Flag
Next Slot = 0
Y
N
Configure IDAC
Range, Value and
Mux for Next Slot
Configure
ADCMux for Next
Slot
Filter Readings
See AN2099 for
Detail
Store ADC reading
and status in Ping
Pong Buffer
ADC
Reconfiguration
Process
The SlotCounter is used to count ADC EOCs. This hardware counter is compared with the current
slot value in the ADC ISR. If they do not match, then the measurement is flagged as invalid. This is
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
65
Example Projects
done after the ADC reconfiguration to ensure that reconfiguration completed before the next ADC
SOC is triggered.
5.3.3.3.2
Fixed Point Math
This project does not use floating point math when calculating the measurement results. This is done
to reduce processor overhead when converting ADC readings into measurement values. Therefore,
scaling is used to calculate the final measurement value. For ease of use, the values are converted
to float when displayed on the LCD. The following sections describe each measurement and how its
readings are converted into measurement values.
20 mV and 100 mV Input
For 20 mV and 100 mV reading, ADC_COUNTS_PER_VOLT is used to convert the ADC counts to
volts. Because integer math is used, dividing the ADC counts by this constant results in a precision
of only 1 V, which is not adequate to measure a 20 mV or 100 mV full scale input. To fix this, the
ADC counts for these readings are scaled up by 10000 and divided by ADC_COUNTS_PER_VOLT.
The result is in ten-thousandths of a volt.
3.3 V Rail and 5 V Rail
For the 3.3 V and 5 V reading, ADC_COUNTS_PER_VOLT is used to convert the ADC counts to
volts. Because integer math is used, dividing the ADC counts by this constant results in a precision
of only 1 V, which is not adequate to measure a 3.3 V or 5 V rail. To fix this, the ADC counts for these
readings are scaled up by 1000 and then divided by ADC_COUNTS_PER_VOLT. The result is in
thousandths of a volt.
RTD and DS600
To avoid floating point math, the conversion from ADC readings to temperature uses integer math.
To preserve precision, the readings are scaled up. Thus the final result of the temperature measurements is in hundredths of a degree C. For more information on the conversion, see the inline code
comments in the associated project.
Diode
The diode temperature measurement uses floating point math. This is because the natural log of the
current ratio is taken. Not using floating point math with this measurement results in poor accuracy
and stability of the diode measurement.
5.3.3.3.3
Filter
A software IIR filter is applied on all ADC readings to eliminate noise. See application note AN2099
for details on the software IIR filter. The filter (attenuation factor) applied depends on the noise on
the voltage output of the sensor. Applying a filter increases the measurement settling time. A very
low cut-off filter requires a much larger time for the measurement to settle down. To avoid large settling times when the input changes drastically, an algorithm is used where the filter is applied only
when required (when the measurement is closer to the final measurement).
The filter attenuation factor can be changed in the Init_Buffers routine in Readings.c. For example, to
change the filter attenuation factor of 3.3 V from 8 to 16, go to Readings.c and modify the following
line of code.
Filter_CoeffBuf[READ_RAIL3V3]=8;
to
Filter_CoeffBuf[READ_RAIL3V3]=16;
Note that a higher attenuation factor reduces LCD flicker, but increases temperature settling time.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
66
Example Projects
5.3.3.3.4
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 notes AN2226 and
AN66444 for more details on correlated double sampling. The ADCMux, Channel 8, is used to make
zero-voltage measurement for the DS600. To make zero-voltage measurement for the RTD and
diode, pass a zero current through the RTD, diode, or calibration resistor and measure the ADC output across the RTD/diode/calibration resistor.
5.3.3.3.5
Calibration
For this project, user calibration is not available for the temperature sensors. The 3.3 V and 5 V measurements are adjusted by a calibration factor. This is because the ADC configuration (±6.144 V
ADC input range) used to read the 3.3 V and 5 V rail is not factory calibrated. To achieve this calibration factor, a voltage is read with one of the factory calibrated ADC ranges (ADC configuration 1 –
±1.024 V range); that same value is read with the non-factory calibrated range. The ratio of these
two readings is then used to adjust the 3.3 V and 5 V measurements. This calibration is done before
the main code loop.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
67
Example Projects
5.4
Thermal Management
This project demonstrates fan speed control using analog temperature sensors.
5.4.1
Project Description
The thermal management project controls the fan speed based on the temperatures measured by
the temperature sensors. This project uses the CY8CKIT-036 Thermal Management (TME) EBK in
addition to the CY8CKIT-025 EBK. The example project controls two fans based on their zone temperatures. The concept of a thermal zone and the sensors used in a specific zone are explained in
Project Details on page 75. On reset, the LCD displays Zone 1 Summary. Press switch SW2 to cycle
through the three menu items:
■
Zone 1 Summary: Temperature algorithm used to compute zone temperature, desired fan speed,
and actual fan speed
■
Zone 2 Summary: Temperature algorithm used to compute zone temperature, desired fan speed,
and actual fan speed
■
Temperature Sensor Summary: The temperatures of the individual temperature sensors in each
zone and the zone temperatures
Figure 5-21. Thermal Management EBK
5.4.1.1
Thermal Management EBK Description
The Thermal Management (TME) EBK contains two four-wire, 12 V brushless DC fans with connectors to support an additional two fans for designers who need to prototype with their own specific fan
models. Six temperature sensors (four different kinds) are also installed on the kit:
■
TMP175 I2C digital temperature sensor
■
Two TMP05 PWM output digital temperature sensors
■
DS18S20 "One Wire" digital temperature sensor
■
Two MMBT3094 temperature diodes.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
68
Example Projects
This combination of hardware elements enables designers to rapidly prototype thermal management
solutions in a variety of configurations.
The TME EBK also provides an I2C/SMBus/PMBus compatible header to support systems that
require communication with a host controller. This functionality is implemented in a single PSoC 3.
The TME EBK routes the input/output signals for thermal management to a PSoC 3 mounted on a
development kit platform such as the CY8CKIT-001 or CY8CKIT-030. PSoC 3 is not mounted on the
TME EBK.
The CY8CKIT-036 TME EBK has three example projects that demonstrate firmware-based fan control, hardware-based closed-loop fan control, and a thermal management system. A detailed explanation of the TME EBK and the firmware examples that are provided with the kit are available at
www.cypress.com/go/CY8CKIT-036.
5.4.1.2
Using TME EBK with CY8CKIT-025
You can control the fans in the TME EBK using the temperature sensors in the CY8CKIT-025 EBK.
The TME EBK has only one analog temperature sensor, which is the diode-based temperature sensor. To illustrate the analog temperature sensing capabilities of PSoC 3 better, the CY8CKIT-025
EBK is combined with the TME EBK to demonstrate thermal management using different analog
temperature sensors such as diode and RTD.
Figure 5-22 shows the CY8CKIT-036 TME EBK and CY8CKIT-025 EBK connected to the CY8CKIT030 PSoC 3 DVK. The CY8CKIT-025 EBK is connected to port E and the CY8CKIT-036 TME EBK is
connected to port D. The same setup and connections can be used when using CY8CKIT-050.
Figure 5-23 shows the CY8CKIT-036 TME EBK and CY8CKIT-025 EBK connected to the CY8CKIT001 PSoC DVK. The CY8CKIT-025 EBK is connected to port A and the CY8CKIT-036 TME EBK is
connected to port B. The same setup and connections can be used when using CY8CKIT-010.
Figure 5-22. TME EBK and CY8CKIT-025 EBK Connected to CY8CKIT-030 PSoC 3 DVK
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
69
Example Projects
Figure 5-23. TME EBK and CY8CKIT-025 EBK Connected to CY8CKIT-001 PSoC 1 DVK
5.4.2
Project Operation
5.4.2.1
Hardware Connections
The CY8CKIT-025 kit includes example projects for the CY8CKIT-001 DVK, CY8CKIT-030 DVK, and
CY8CKIT-050 DVK hardware platforms. The pin mapping for CY8CKIT-030 and CY8CKIT-050 are
identical; follow the instructions provided for CY8CKIT-030 PSoC 3 DVK for CY8CKIT-050
PSoC 5LP DVK as well except that PSoC 5LP device CY8C5868AXI-LP035 should be selected
(Project > Device selector). The main difference between the examples for the CY8CKIT-001 and
CY8CKIT-030 platforms is the PSoC pin mapping.
5.4.2.1.1
CY8CKIT-030 PSoC 3 DVK
1. No jumper wires are required for the PSoC 3 DVK examples because the buttons and potentiometer are hardwired to GPIOs. Ensure that the LCD included with the PSoC 3 DVK is attached.
2. Set VDDD and VDDA to 3.3 V using J10 and J11.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
70
Example Projects
Figure 5-24. CY8CKIT-030 PSoC 3 DVK Power Jumpers
3. Ensure that POT_PWR is enabled by installing a jumper on J30.
Figure 5-25. CY8CKIT-030 PSoC 3 DVK Potentiometer Power
CAUTION: The TME EBK plugged into port D of the CY8CKIT-030 DVK uses the SWD/JTAG programming pins for fan control as well. Due to this pin sharing, the TME EBK should not be attached
to the CY8CKIT-030 DVK while programming the PSoC 3 device using MiniProg3 or DVKProg3 programmer. After the programming is complete, remove the programmer from the programming
header on the PSoC 3 DVK and then attach the TME EBK to port D. Due to pin sharing, debugging
the project is also not possible because it uses the same programming pins.
5.4.2.1.2
CY8CKIT-001 PSoC DVK
1. In the pin header/breadboard area of the PSoC DVK base board, use jumper wires to make the
following connections:
❐
VR to P1_2
❐
SW1 to P2_7
Figure 5-26. CY8CKIT-001 PSoC DVK Breadboard
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
71
Example Projects
2. Set the system to run at 3.3 V using SW3 and set J6 VDD DIG and J7 VDD ANLG to
VDD = 3.3 V.
Figure 5-27. CY8CKIT-001 PSoC DVK Power Jumpers
3. Ensure that the LCD included with the PSoC DVK is attached and that the LCD power jumper
(J12) is in the ON position.
Figure 5-28. CY8CKIT-001 PSoC DVK LCD Power Jumper
4. Ensure that the VR_PWR jumper (J11) is installed.
Figure 5-29. CY8CKIT-001 PSoC DVK VR_POWER Jumper
CAUTION: The TME EBK plugged into port B of the CY8CKIT-001 DVK uses the SWD/JTAG programming pins for fan control as well. Due to this pin sharing, the TME EBK should not be attached
to the PSoC DVK while programming the PSoC 3 device on the DVK using MiniProg3 programmer.
After the programming is complete, remove MiniProg3 from the programming header on the PSoC
DVK and then attach the TME EBK to port B. Due to pin sharing, debugging the project is also not
possible because it uses the same programming pins.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
72
Example Projects
5.4.2.1.3
CY8CKIT-025 PSoC Precision Analog Temperature Sensor EBK
1. Make sure the RTD jumper J6 is on; on jumpers J8 and J9, short 1-2 with wires so that the
onboard RTD is used for temperature measurements.
Figure 5-30. CY8CKIT-025 RTD Jumper
2. Connect the diodes, as shown in Figure 5-31.
Figure 5-31. CY8CKIT-025 Diodes
5.4.2.1.4
CY8CKIT-036 Thermal Management EBK
1. Connect the fans to headers fan 3 and fan 4, as shown in Figure 5-32. Note that the fans are connected to headers 1 and 2 by default.
Figure 5-32. Thermal Management EBK Fans
2. Configure jumper J9 to power the thermal management EBK using an external power supply, as
shown in Figure 5-33.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
73
Example Projects
Figure 5-33. External Power Supply Connected
5.4.2.2
Run Thermal Management System Firmware
5.4.2.2.1
CY8CKIT-030 PSoC 3 DVK
The steps to run the example firmware on CY8CKIT-030 are:
1. Make the hardware connections on the CY8CKIT-030 DVK, as explained in 5.4.2.1.1 CY8CKIT030 PSoC 3 DVK.
2. Attach a USB cable from the PC to the PSoC 3 DVK program/debug USB port (use J1, the USB
connector closest to the corner of the board). Ensure that the TME EBK is not attached to the
PSoC 3 DVK before attaching the USB cable for programming.
3. Open the ThermalManagementSystem_030_050 project using PSoC Creator and select Debug
> Program to program the PSoC.
4. Detach the USB cable; if the DVK is powered by external power supply, disconnect power supply
to the DVK as well.
5. Connect the CY8CKIT-025 EBK and TME EBK to the DVK, as shown in Figure 5-22.
6. Power the PSoC 3 DVK and the TME EBK, as shown in Figure 5-22.
7. Press the Reset (SW1) button on the PSoC 3 DVK to run the newly programmed firmware
image.
8. On reset, the LCD displays a welcome message and starts with the Zone 1 temperature reading
and the corresponding temperature calculation algorithm. The desired and actual fan speeds corresponding to that zone are also displayed.
9. Use the push button SW2 to view the different zone characteristics.
5.4.2.2.2
CY8CKIT-001 PSoC DVK
The steps to run the example firmware on CY8CKIT-001 are:
1. Make the hardware connections on the CY8CKIT-001 DVK, as explained in 5.4.2.1.2 CY8CKIT001 PSoC DVK.
2. Apply 12 VDC power to the PSoC DVK.
3. Attach the MiniProg3 device, first to a USB port on the PC and then to the PROG port on the
CY8CKIT-009 PSoC 3/CY8CKIT-010 PSoC 5LP processor module. Ensure that the TME EBK is
not attached to the PSoC 3 DVK before attaching the USB cable for programming.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
74
Example Projects
4. Open the ThermalManagementSystem_001 project using PSoC Creator and select Debug >
Program to program PSoC 3.
5. Detach the MiniProg3 and remove power supply to the PSoC DVK.
6. Connect the CY8CKIT-025 EBK and TME EBK to the PSoC DVK, as shown in Figure 5-23.
7. Power the PSoC DVK and TME EBK, as shown in Figure 5-23.
8. Press the Reset (SW4) button on the PSoC 3 DVK to run the newly programmed firmware
image.
9. On reset, the LCD displays a welcome message and starts with the Zone 1 temperature reading
and the corresponding temperature calculation algorithm. The desired and actual fan speeds corresponding to that zone are also displayed.
10.Use the push button SW1 to view the different zone characteristics.
5.4.2.3
Testing the Project
In this project, the fan temperature is controlled based on the temperature of the corresponding thermal zone. To test the closed loop speed control of Fan 3, vary the potentiometer on the DVK. This
simulates the condition of changing the corresponding zone temperature in the project. The speed of
Fan 3 is adjusted according to the temperature vs speed graph shown in Figure 5-34. To test the
closed loop speed control of Fan 4, touch the RTD sensor on the CY8CKIT-025 EBK. This results in
variations in the measured RTD temperature. The speed of Fan 4 is adjusted according to the temperature vs speed graph shown in Figure 5-35.
On reset, the LCD displays the characteristics of Zone 1. These characteristics include the zone
temperature, temperature calculation algorithm, desired fan speed, and the actual fan speed. The
fan speeds will match the corresponding zone thermal profiles. Press the push button (SW1 on
CY8CKIT-001 or SW2 on CY8CKIT-030) once to view the characteristics of Zone 2. Press the push
button (SW1 on CY8CKIT-001 or SW2 on CY8CKIT-030) again to view the individual sensor temperatures for each zone and the weighted composite zone temperature. Pressing the button again will
repeat this display sequence.
5.4.3
Project Details
This project demonstrates how the temperature sensors in the CY8CKIT-025 EBK combined with
the fans on the TME EBK can create a complete thermal management system. The example shows
how to combine temperature readings from a number of temperature sensors in a variety of ways
and use the composite temperature to set desired fan speeds according to a customizable transfer
function.
The thermal management example uses the concept of a "Thermal Zone", which describes how to :
■
combine multiple temperature sensor readings to form a composite zone temperature
■
map the zone temperature to a fan speed
By this definition, each fan is controlled according to its own independent thermal zone. This example has two thermal zones because the TME EBK has only two fans installed. Algorithms currently
implemented to combine multiple temperature sensors into a composite zone temperature include:
straight average, weighted average, and maximum.
In this example, the weighted method is used on both fans. A zone temperature-to-fan speed transfer function is then definable for each zone. Linear and table driven transfer functions are currently
implemented. This example uses the table driven transfer function on both fans; that is, a look-up
table maps the composite zone temperature-to-fan speed.
This example is a simulation of a thermal management system. Zone 1, corresponding to Fan 3 in
Figure 5-34 combines temperature measurements from two temperature sensors (potentiometer
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
75
Example Projects
temperature emulator and RTD). The potentiometer temperature emulator allows easy demonstration of fan control over a wide simulated temperature range without the need for an environmental
chamber to cycle through temperatures. In Zone 1, the temperature sensors are combined using a
weighted average where the potentiometer is given 90 percent weight and the RTD is given 10 percent weight. Adjust the potentiometer (R20 on the CY8CKIT-001 DVK and R56 on the CY8CKIT-030
DVK) to vary the simulated temperature value in the approximate range of 15 °C to 100 °C. The
Zone 1 speed transfer function is table driven and follows the profile shown in Figure 5-34.
Figure 5-34. Thermal Management System Project - Zone1 Thermal Profile
Zone 2, corresponding to Fan 4 in Figure 5-35, consists of two temperature sensors and a single fan.
The Zone 2 speed transfer function is table driven and is shown in Figure 5-35. Note that the temperature range is very narrow and close to room temperature. This is to allow simple testing at room by
touching a temperature sensor with a warm finger to cause a fan speed change. In Zone 2, the temperature sensors are combined using a weighted average where the RTD is given 90 percent of the
weight and the diode is given 10 percent weight. In this example, the RTD temperature reading dominates the overall zone temperature calculation.
Figure 5-35. Thermal Management System Project - Zone2 Thermal Profile
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
76
Example Projects
5.4.3.1
Project Schematic
Figure 5-36 shows the PSoC Creator schematic of the project.
Figure 5-36. PSoC Creator Schematic
A four-channel ADC is used to measure the voltages across the RTD, diode, RTD/diode current calibration resistor, and potentiometer, which simulates an analog temperature sensor. IDAC is used to
provide the excitation currents for the diode, RTD, and calibration resistor. The closed loop fan controller component senses and controls the fan speed.
Application notes AN60590 and AN70698 provide detailed explanations on temperature measurement using diode and RTD, respectively. Application note AN66627 describes the fan controller
operation in detail.
5.4.3.2
Component Configuration
Figure 5-37 and Figure 5-38 show the FanController component configuration.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
77
Example Projects
Figure 5-37. FanController Component Configuration - Basic Tab
The Fan Control Method is chosen as hardware (UDB), which means that the fan speed is controlled
using the hardware blocks inside PSoC without any CPU intervention. See the FanController component datasheet in PSoC Creator for details on the other parameters.
Figure 5-38. FanController Component Configuration - Fans Tab
This tab provides the option to choose the number of fans and the speed to RPM mapping of each
fan. The individual fan parameters are configured, as shown in Figure 5-38. The configuration is
done based on the datasheet specifications of the fans used on the TME EBK.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
78
Example Projects
Figure 5-39 shows the ADC configuration to measure the potentiometer voltage. The ±6.144 V voltage range is chosen because the potentiometer voltage can vary from 0 to VDDA. The Bypass Buffer option is selected for the Buffer Mode parameter to measure voltage near the supply rails.
Figure 5-39. ADC Configuration for Potentiometer Voltage Measurement
Figure 5-40 shows the ADC configuration to measure voltage across the sensors (diode and RTD).
The Resolution parameter is set to 20 bits to perform high-resolution temperature measurements.
Figure 5-40. ADC Configuration for Temperature Sensor Measurement
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
79
Example Projects
Figure 5-41 shows the IDAC component configuration. The Polarity parameter of the IDAC is set to
the current sourcing mode and the Speed parameter is set to High Speed to have a faster settling
time for the IDAC output.
Figure 5-41. IDAC Configuration
5.4.3.3
Firmware Description and Flowchart
The thermal management system example consists of the main application and thermal manager.
The main application is responsible for the user interface and for periodically calling the thermal
manager. The application implementation is available in main.c and on the Test Application tab of the
project schematic. The thermal manager implementation is available in ThermalManager.c and on
the Thermal Manager tab of the project schematic.
The main application must call ThermalManager_Start() to initialize the thermal manager. Then it
must periodically call ServiceThermalManager() to run temperature and speed updates. In this
example, this is done every 500 ms but can be changed by modifying
#define THERMAL_UPDATE_MS_RATE in main.c.
All the parameters that define the zone composite temperature sensor algorithm and the zone temperature-to-fan speed algorithm are defined in the beginning of ThermalManager.c. To modify these
settings, refer to ThermalManager.h for the relevant keywords.
The following flowchart shows the basic function of the thermal manager along with the APIs in ThermalManager.c that implement the main service loop.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
80
Example Projects
Figure 5-42. Thermal Manager Flowchart
Start
Initialize Components and
Variables
500 ms
Timer
Expired?
N
Y
Calculate Zone1 and
Zone 2 Temperatures
Calculate Fan 3 and Fan 4
Speeds based on Thermal
Profiles
Fan Speed
Needs
Change?
N
Y
Set Desired Fan Speeds
Launch Next Temperature
Measurement
Handle Button Presses
and Update LCD
In this example, the LCD displays status information about thermal management system across
three screens. You can cycle through the status screens by pressing SW1 on the CY8CKIT-001 DVK
or SW2 on the CY8CKIT-030 DVK. The three screens are:
■
Screen 1 - Zone 1 Summary
This screen displays the current status of Zone 1. Line 1 displays the zone number, current composite zone temperature, and the zone temperature calculation algorithm used. Line 2 displays
the desired fan speed and the actual fan speed for Zone 1.
Figure 5-43. Zone 1 Summary
Z 1 : T = 1 6
F 3 : 4 5 0 0
■
WE I GH T E D
A 3 : 4 5 1 5
Screen 2 - Zone 2 Summary
This screen displays the current status of Zone 2. Line 1 displays the zone number, current composite zone temperature, and the zone temperature calculation algorithm used. Line 2 displays
the desired fan speed and the actual fan speed for Zone 2.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
81
Example Projects
Figure 5-44. Zone 2 Summary
Z 2 : T = 2 6
F 4 : 7 0 0 0
■
WE I GH T E D
A 4 : 7 0 6 2
Screen 3 - Temperature Sensors Summary
This screen displays the current temperature sensor readings for all sensors in the system. Line
1 displays the Zone 1 temperature sensor values. The temperature on the extreme left is the
zone's composite temperature followed by the temperatures of each contributing sensor. Line 2
displays the same information for Zone 2.
Figure 5-45. Temperature Sensors Summary
Z 1 : T = 7 9
Z 2 : T = 3 1
( 8 5 , 2 5 )
( 8 5 , 2 5 )
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
82
A.
Appendix
A.1
Schematic
J3
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
P3_7
P3_5
P3_3
P3_1
P0_7
P0_5
P0_3
P0_1
VSSA
P4_7
P4_5
P4_3
P4_1
P12_2
P12_0
V3_3
Vin
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
2
P3_6
4
P3_4
6
P3_2
8
P3_0
10 RES11
12 P0_6
14 P0_4
16 P0_2
18 P0_0
20 RES10
22 P4_6
24 P4_4
26 P4_2
28 P4_0
30
RES9
32 P12_3
34 P12_1
36
Vadj
38 V5_0
40
1
2
P3_1
P3_6
P4_2
J8
P3_4
TP6
1
P4_0
NO LOAD
VSSA
TP5
1
1
NO LOAD
1
2
J6
+
1
2
3
4
5
6
7
8
P4_3
P3_7
R8
100E
RTD1
PTS080501B100RP100
0.1%
P4_5
1%
TP4
1
J4
P4_4
1
J9
P4_1
1
2
1
NO LOAD
Diode
R7
20E
1%
R10
20E
20x2_Header
VSSA
1%
VSSD
VSSA
Note: P0_2 and P0_3 is for co-related double sampling
VSSA
Note:
CONNECT J6-1 and J6-2 FOR NORMAL OPERATION,
DISCONNECT J6-1 and J6-2 FOR EXTERNAL RTD.
CONNECT EXTERNAL RTD ACROSS J8 AND J9.
From Expansion Connector of PSoC Development Kit
and PSoC 3 Development Kit
RTD
V3_3
R6
330K
R4
V3_3
1%
0E
V3_3
DS600U+ U1
7
6
5
9
SO8
GND
VDD
CTG
TO
SD
!TO
Vth
Vout
1
0402
8
1
2
3
P0_0
P0_5
R5
1.5k
TH1
NCP18XH103F03RB
1
2
3
TP1
TP2
J5
TP3
1
2
PCC-SMP-K
1
2
P0_4
1
1
R3 0E
1
1
J2
RTD/Diode
Calibration
VSSA
VSSA
+
J7
1%
2
1
2
P0_1
3
4
P0_6
Power Supply
VSSA
R9
10K
CP
0.1%
120-09802-0
PDC-09802
VSSA
VSSA
Thermistor
CYPRESS SEMICONDUCTOR © 2011
Title
CY8CKIT-025 PSoC Precision Analog Temperature Sensor Expansion Board Kit
Thermocouple
Note: Place U1 close to Thermocouple
Note: Place J5-2 TO J5-3 FOR NORMAL OPERATION,
Place J5-2 TO J5-1 FOR EXTERNAL INPUT AT J7
Size
A
Date:
Document Number
REF-15102
Friday, April 01, 2011
Rev
**
Sheet
1
of
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
1
83
Appendix
A.2
Board Layout
A.2.1
PDC-09802 Top
A.2.2
PDC-09802 Bottom
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
84
Appendix
A.3
Item
Bill of Materials (BOM)
Qty.
Reference
Value
1
Description
Manufacturer
Manufacturer Part
Number
PCB
Cypress
PDC-09802 Rev02
2
1
J3
40 Pin Header
CONN HEADER .100 DUAL R/A 40POS
Protectron
Electromech
P9104-40-12-1
3
1
J2
Thermocople
Connector
CONN OMEGA Thermocouple Type K
OMEGA
PCC-SMP-K-5
4
1
TH1
THERMISTOR
THERMISTOR 10K OHM NTC 0603
NTC 10K OHM 1%
Murata
NCP18XH103F03RB
5
1
R9
10K, 0.1%
RES 10K OHM 1/8W .1% 0805 SMD
Panasonic - ECG
6
1
J4
8 PIN Connector
CONN TERM BLOCK T/H 8POS 3.5MM Phoenix Contact
1984675
7
3
J7, J8, J9
2 Pin Jumper
Terminal Blocks PT 1.5/2-3.5H 2POS
HRZ 3.5mm SCREW
Phoenix Contact
1984617
8
2
R7, R10
20E, 1%
RES 20.0 OHM 1/8W 1% 0805 SMD
Vishay/Dale
CRCW080520R0FKEA
TEMP SENSOR RTD 100 OHM 0805
Vishay/Beyschlag PTS080501B100RP100
ERA-6AEB103V
9
1
RTD1
TEMP SENSOR
RTD
10
1
R8
100E, 0.1%
RES 100 OHM 1/8W 0.1% 0805 SMD
Panasonic - ECG
ERA-6AEB101V
3M
961102-6404-AR
11
1
J6
2p_jumper
CONN HEADER VERT SGL 2POS
GOLD
12
2
R3, R4
0E Resistor
RES 0.0 OHM 1/8W 0805 SMD
Panasonic - ECG
ERJ-6GEY0R00V
IC SENSOR TEMP 8-USOP
Maxim Integrated
Products
DS600U+
13
1
U1
DS600U+
14
1
R6
330K, 1%
RES 330K OHM 1/8W 1% 0805 SMD
Panasonic - ECG
ERJ-6ENF3303V
15
1
R5
1.5K, 1%
RES 1.50K OHM 1/8W 1% 0805 SMD
Panasonic - ECG
ERJ-6ENF1501V
16
1
J5
3p_jumper
CONN HEADER VERT SGL 3POS
GOLD
3M
961103-6404-AR
No Load Components
17
1
TP1
RED TP
TEST POINT PC MINI .040"D RED
Keystone
Electronics
5000
18
2
TP2, TP3
BLACK TP
TEST POINT PC MINI .040"D RED
Keystone
Electronics
5001
19
3
TP4, TP5, TP6 PADS
PADS
Special Jumper Installation Instructions
20
1
J6
Install jumper
Rectangular Connectors MINI JUMPER
Kobiconn
across pins 1 and 2 GF 13.5 CLOSE TYPE BLACK
151-8030-E
21
1
J5
Install jumper
Rectangular Connectors MINI JUMPER
Kobiconn
across pins 3 and 2 GF 13.5 CLOSE TYPE BLACK
151-8030-E
Install as per Assembly drawing
22
A.4
3
BUMPER CLEAR .500X.23" SQUARE
Richco Plastic Co
RBS-3R
Regulatory Compliance Information
The CY8CKIT-025 PSoC Precision Analog Temperature Sensor Expansion Board has been tested
and verified to comply with the following electromagnetic compatibility (EMC) regulations.
■
EN 55022:2010 Class A - Emissions
■
EN 55024:2010 Class A - Immunity
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
85
Revision History
Document Revision History
Document Title: CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide
Document Number: 001-65791
Revision
ECN#
Issue Date
Origin of
Change
**
3222188
04/11/11
PFZ
*A
3455347
11/29/11
SASH
Updated PSoC Creator version.
*B
3561312
03/24/12
RKAD
Updated existing project; added two new projects.
*C
3639690
06/07/12
PFZ
Updates to Additional Resources section. Updated images in the
Example Projects chapter.
*D
3737398
09/07/12
PFZ
Document changes to reflect support for PSoC5
Description of Change
Initial version of kit guide.
Added the Safety section.
*E
3954642
03/28/13
VRNK
Updated images in the Code Examples chapter.
Minor updates throughout the document.
*F
3988373
04/26/13
VRNK
Updated “CY8CKIT-001 PSoC DVK Thermistor Temperature” on
page 40 and “CY8CKIT-030 PSoC DVK” on page 53.
*G
4121210
09/12/13
SASH
Updated images for PSoC Creator ECR. Added section 5.1.1
*H
4335470
04/07/14
RKAD
Updated section 5.2.2.4.5.
*I
5406476
08/17/16
SRDS
Updated PSoC Creator version to PSoC Creator 3.3 CP3; updated
related images. Updated PSoC Programmer version to 3.24.2.
Added information about floating point variables in “Migrating Projects to use with CY8CKIT-050 and CY8CKIT-010” on page 31.
Updated to new template.
*J
*K
5446907
5705955
09/23/2016
04/21/2017
SRDS /
SAGA
RKAD
Updated Software Installation chapter on page 15:
Updated Figure 2-2.
Updated Figure 2-4.
Updated to new template.
Completing Sunset Review.
CY8CKIT-025 PSoC® Precision Analog Temperature Sensor Expansion Board Kit Guide, Doc. # 001-65791 Rev. *K
86