Academic Workshop Lab Measuring Temperature with Thermistors.

Slides:



Advertisements
Similar presentations
Interfacing to the Analog World
Advertisements

Interfacing to the Analog World
11-1 Bard, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 11: Data Acquisition, Numerical Fixed-Point Calculations, Lab.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Analog-to-Digital Converter (ADC) And
Analogue to Digital Conversion By Cap’n Tim Johnson, PE Prepared 11/12/2013.
Sensors Interfacing.
Digital to Analogue Conversion
5/4/2006BAE Analog to Digital (A/D) Conversion An overview of A/D techniques.
Lecture 9: D/A and A/D Converters
Analogue to Digital Conversion
Interfacing Analog and Digital Circuits
Pressure sensors and thermistors -What do they do and how to calibrate them? E80 Feb 21, 2008.
Programmable logic and FPGA
Coordinate Based Tracking System
11-1 Bard, Tiwari, Telang, Janapa Reddi, Gerstlauer, Valvano, Yerraballi EE 319K Introduction to Embedded Systems Lecture 11: Data Acquisition, Numerical.
Digital I/O Connecting to the Outside World
Engineering 80 – Spring 2015 Temperature Measurements
Digital to Analog Converters
Dynamic Presentation of Key Concepts Module 2 – Part 3 Meters Filename: DPKC_Mod02_Part03.ppt.
Embedded Programming and Robotics
Integrator Op Amp Amplifier
In this PPT, all the materials covered up for the PIC microcontroller set-up would be studied. Preliminary skills: Knowing of basic C grammar and basic.
Digital to Analog Converters
Kirchhoff’s Laws. Changes from circuit in lab manual. 1. The DC voltage supply to use is +5V, not +9V as is shown in the lab manual. 2. A second circuit.
Digital-to-Analog & Analog-to- Digital Conversion Anuroop Gaddam.
ACOE2551 Microprocessors Data Converters Analog to Digital Converters (ADC) –Convert an analog quantity (voltage, current) into a digital code Digital.
Wireless Intelligent Sensor Modules for Home Monitoring and Control Presented by: BUI, Phuong Nhung, 裴芳绒 António M. Silva1, Alexandre Correia1, António.
Data Acquisition Data acquisition (DAQ) basics Connecting Signals Simple DAQ application Computer DAQ Device Terminal Block Cable Sensors.
Agenda and Notes Today, during class! 9:30 a.m. Boeing Space and Intelligence Systems (Matt and Matt) 4 extra credit assignments available at the bottom.
DLS Digital Controller Tony Dobbing Head of Power Supplies Group.
Digital to Analogue Converter
ELN5622 Embedded Systems Class 7 Spring, 2003 Aaron Itskovich
SIGMA-DELTA ADC SD16_A Sigma-Delta ADC Shruthi Sujendra.
Memory Layout and SLC500™ System Addresses. Processor Memory Division An SLC 500 processor's memory is divided into two storage areas. Like two drawers.
Digitization When data acquisition hardware receives an analog signal it converts it to a voltage. An A/D (analog-to-digital) converter then digitizes.
Lecture 15: Digital to Analog Converters Lecturers: Professor John Devlin Mr Robert Ross.
Chapter 2 Introducing the PIC Mid-Range Family and the 16F84A The aims of this chapter are to introduce: The PIC mid-range family, in overview The overall.
Suleyman Demirel University CSS340 Microprocessor Systems – Lecture 2 ATMEGA328P ARCHITECTURE ANALOG INPUTS.
1Date 2004 Strictly Confidential Remote Sense (extracted from a presentation by Robert Kollman)
Computer Architecture Lecture 32 Fasih ur Rehman.
PHY 235 Robotics Workshop Day 4 Robotic Behaviors, Light Sensing, Voltage Dividers, LCD-MOD.
Digital Control CSE 421.
1 Four-Wire RTD measurement: Error Analysis/ Experimental Results.
Closed Loop Temperature Control Circuit with LCD Display Mike Wooldridge ECE 4330 Embedded Systems.
AAPT workshop W03 July 26, 2014 Saint Cloud State University, MN, USA
Microcontroller basics Embedded systems for mortals.
Simple Circuits 1 st year physics laboratories University of Ottawa
Engineering 80 – Spring 2016 Temperature Measurements 1 SOURCE: 3_standardbody__to-226_straightlead.jpg SOURCE:
BITS Pilani Pilani Campus Pawan Sharma ES C263 Microprocessor Programming and Interfacing.
1 Lab 4: D/A Converter Lab 4: D/A Converter This is a simple resistive network for a D/A converter Port 1, Port 0 are digital inputs ==> 00 (minimum),
Networked Embedded Systems Sachin Katti & Pengyu Zhang EE107 Spring 2016 Lecture 13 Interfacing with the Analog World.
MECH 373 Instrumentation and Measurements
Data Acquisition ET 228 Chapter
Digital Control CSE 421.
Purpose of This Minilab
SAR ADC Input Types TIPL 4003 TI Precision Labs – ADCs
Electronic Devices Ninth Edition Floyd Chapter 17.
EE 319K Introduction to Embedded Systems
Haiwell PLC Modules Introduce
Peak-Power Operation In Solar PV
Resistance AIM: Understand resistance, calculate resistor values and know the characteristics of different types of resistors PRIOR KNOWLEDGE: Understand.
Introducing the PIC Mid-Range Family and the 16F84A
Analog and Digital Instruments
Lesson 12: Analog Signal Conditioning
Conversation between Analogue and Digital System
ADC and DAC Data Converter
Medical electronics II
ADC and DAC Data Converter
Data Acquisition Electronics Unit – Lecture 6
Presentation transcript:

Academic Workshop Lab Measuring Temperature with Thermistors

2 Cypress Confidential Objective Exploit PSoC topology to build inexpensive digital thermometer. Understand the operation of a negative temperature coefficient (NTC) thermistor. Understand how to calculate Steinhart Hart constants for a specific thermistor. Calculate temperature using the Steinhart & Hart equation. Calculate temperature using a look up table.

3 Cypress Confidential Hardware Overview CY8C3210-PSoCEval1 board. MiniProg Thermistor 10k resistor Breadboard wire

4 Cypress Confidential Reference Material AN2028 Ohmmeter AN2017 Thermistor Based Thermometer AN2239 ADC Selection

5 Cypress Confidential Measuring Resistance Unlike measuring voltage or current, measuring a a passive characteristic like resistance requires stimulus A Classic method is to push current into a resistor and measure the developed voltage. Only as accurate as Current Source ADC Gain and Offsets Resistance limited to ADC range. Requires different current values for wide range of resistors. Very popular when cost of accurate current sources was less than the cost of computation.

6 Cypress Confidential PSoC and Measuring Resistance For this circuit the following equation holds. Solving for R test results in: Offset errors removed by difference Measurement offset voltages subtract out! Gain errors removed by quotient Measurement path errors divide out! Accuracy determined by an external reference resistor …

7 Cypress Confidential PSoC and Measuring Resistance And ADC resolution For an n bit ADC the number of counts seen across aR is: The reading is accurate to +/-.5 counts. Overall resolution tolerance is: For 14 bits and an attenuation of 15/16, the equation simplifies to: Tol (%)a 0.332% % % % %100

8 Cypress Confidential Thermistors A negative temperature coefficient thermistor (NTC) is a semiconductor device that becomes less resistive as its temperature increases. The change in resistance is “roughly” expressed by the equation below. Where: A is some empirical value less than one for negative temperature coefficient (NTC) thermistors. T 1 & T 2 are temperatures measured in Kelvin. R(T 1 ) & R(T 2 ) are the thermistor’s resistances at these temperatures.

9 Cypress Confidential NTC Thermistors ”Roughly” is defined as a good approximation for an academic introduction to thermistors. It shows the temperature/resistance relationship to be ideally exponential. It won’t hold up for real world temperature- measuring application. But for small temperature differences the following holds:

10 Cypress Confidential Steinhart-Hart Equation The Steinhart-Hart equation describes the resistance change of a thermistor as related to its temperature. The equation below shows it to be a 3 rd order logarithmic polynomial using three constants. Where: A, B, and C are empirical constants. T K & is temperature in Kelvin. R is the thermistor’s resistance in Ohms.

11 Cypress Confidential Steinhart-Hart Equation Many thermistors come with these three parameters defined. For this particular thermistor they are in the datasheet If not they must be calculated. This is done by taking three points in the conversion table and solving for these constants. It makes most sense to use the minimum, maximum, and a middle value for the temperature range for which you are interested. From the Thermistor Table TcTc Resistance 0°C32,660 ohms 40 °C5,325 ohms 80 °C1,257 ohms Note: This is an example and not for the thermistor we are using

12 Cypress Confidential Steinhart-Hart Equation Apply the three data points to the following equation. To get the three following equations. Solve to get: A = e-2 B = e-3 C = e-7

13 Cypress Confidential Thermistors The cost of thermistors is primarily determined by the accuracy of the thermistor’s resistance. This is where the exponential nature of thermistors works out to your advantage. A thermistor’s resistance tolerance shows up as a temperature shift. This can be calibrated out with a single point calibration. In test, bring the thermistor to 25˚C and measure its temperature. Suppose it reads 26.2˚C Software needs to store a 1.2˚offset in memory.

14 Cypress Confidential Thermistors In consumer products this calibration is many times left to the user. The user interface allows access to the temperature offset register. The user sets this if they think the temperature is a bit low or a bit high. A good rule of thumb is that a thermistor resistance uncertainty of n% works out to a temperature shift of approximately (n/3)˚C. This will help determine if any calibration is needed. Temperature calculations are only as accurate as the resistance measurement of the thermistor

15 Cypress Confidential Let’s Get Started Desired Topology Connect 10k Ohm from P05 to P01. Connect 10k Ohm thermistor from P01 to P03. Start Designer Name the Project Therm. Therm V0_Out REFHI PSoC 10k ADC REFLO P05 P01 P03 V2_Out V1_In buf1 buf0 InputAtten R 15R Buffer

16 Cypress Confidential EVAL1 Connections 10K Therm P05 P03 P01 Wire

17 Cypress Confidential Starting a New Project Open PSoC Designer Select Start new project

18 Cypress Confidential Starting a New Project Select Project Type Name The Project

19 Cypress Confidential Starting a New Project Select Device and Coding Method CY8C PXI C OK

20 Cypress Confidential Global Resource Settings

21 Cypress Confidential Select PGA UM Select PGA and name it InputAtten Insert into ACB00 Set the PGA parameters to: Atten Value set to 15/16 Reference to AGND Input connected to column MUX to read all three points on the resistor string

22 Cypress Confidential Select Second PGA UM Select PGA and name it Buffer Insert into ACB01 Set the PGA parameters to: This UM generate API in multiplex the input lines.

23 Cypress Confidential Select AMUX4 UM Select an AMUX4 and rename it ADCMUX Set its parameter has shown.

24 Cypress Confidential Select ADCINC UM Select an ADCINC UM and rename it ADC. Select a single modulator and place it in ASC10. Select the clock to be VC2. Place the digital block in DBB0. Input connects to Buffer. PWM is not used

25 Cypress Confidential Select LCD UM Select and LCD UM and name it LCD. Connect to Port 2 BarGraph is not needed.

26 Cypress Confidential Rename Buffers and Pins Connect the AnalogOutBuf_1 to P05. Rename this pin V0_Out. Connect the AnalogOutBuf_0 to P03. Rename V2_Out. Change PO1 to be an AnalogInput. Rename it V1_In.

27 Cypress Confidential Add Initialization Code In the Initialization Section Add code to start Buffer, InputAtten, ADC, and LCD. Add code to connect REFHI to the column1 analog bus. Add code to connect REFLO to the column0 analog bus. Declare iV0, iV1, iV2, iRvalue to be global variables. Enable global interrupt. Declare bTempValue to be a global 8 bit variable. Add LookUp table. (Cut and Paste from File on CD)

28 Cypress Confidential LookUp Table Temperature Conversion The Steinhart-Hart equation requires using the floating point math library. Floating point is slow and uses buckets more ROM compared to integer math. An alternative is to use a look up table. For any particular thermistor, the manufacturer either supplies a R/T conversion table, or supplies the three Steinhart-Hart coefficients. If only the coefficients are supplied, a table can be generated from them. This particular thermistor has a R/T conversion table that supplied.

29 Cypress Confidential Create a Look Up Table Excel file ThermTable.xls contains the 81resistance values for temperature for 0°C to 80 °C. Calculate half values for ½°C to 79 ½°C using the following equation. ½ degrees are used for rounding. Add the value zero at the end.

30 Cypress Confidential Create a Look Up Table* These values are used to make an ROM array WThermTable[ ] containing 81 values. *code is provided in lab file

31 Cypress Confidential Add Code Control Loop In the Control Loop Set ADCMUX to P05. Run ADC. Wait for data. Place in iV0 Set ADCMUX to P01. Run ADC. Wait for data Place in iV1. Set ADCMUX to P03. Run ADC. Wait for data Place in iV2. Calculate Resistance. Display on LCD.

32 Cypress Confidential Add Code CalculateR If iV0<-iV1 (Open Circuit) lRvalue = -1 Else If iV1 <= iV2 (Short Circuit) iRvalue = 0 Else Calculate Resistance Add half denominator to numerator to implement round off.

33 Cypress Confidential Run Build the Project. Record RAM and ROM Usage. Download to the Eval board and run. Using the look up table determine the temperature.

34 Cypress Confidential Summary PSoC makes measure resistance a cost effective option. Temperature can easily be measure using thermistor with the Steinhart-Hart equation or look up table.

35 Cypress Confidential Questions