You are on page 1of 9

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014

Page 9.1

Lab 9 Temperature Data Acquisition System


T is !aboratory assignment accompanies t e boo"# $mbe%%e% Systems& 'ea!(Time )nter*acing to A'+ ,orte- + +icrocontro!!ers# )S./(13& 901(1423390134# by 4onat an 5. 6a!7ano# copyrig t 8 2012. Goals 9 Stu%y AD, con7ersion# /yquist T eorem# 6a!7ano Postu!ate# 9 De7e!op a temperature measurement system using a t ermistor# Review 9 :peration o* t e AD, system in t e L+3S1921 %ata s eet# 9 Data s eets on t e :PA2330 %ua! op amp ),# an% )/A122P instrumentation amp 9 6a!7ano , apters 1 an% 9 on t ermistors# ana!og amp!i*iers# ana!og !o; pass *i!ters# an% AD,<s# %ata acquisition systems. 9 Design temp!ates& therm10 !ls# therm10"ref#$% !ls# lpf !ls at ttp&//users.ece.ute-as.e%u/=7a!7ano/Starter*i!es/ 9 T) &ilter'ro( *i!terpro>%esign>program>%o;n!oa%( .e-e ?7ersion 2@ at ttp&//users.ece.ute-as.e%u/=7a!7ano/$$343+/ 9 'erio)icTimer0A*nts$19+, -ip( AD.T0ATri//er$,11 -ip( AD.S0Tri//er$,11 -ip AD.'rintResults$19+, -ip at ttp&//users.ece.ute-as.e%u/=7a!7ano/arm/ 9 $-pan%e% :L$D %ri7er at ttp&//users.ece.ute-as.e%u/=7a!7ano/arm/rit121-92-4.c

Starter files

Requirements T is e-periment ;i!! use an AD, con7erter on t e L+3S1921 to construct a %igita! t ermometer. T e temperature range is 0 to 40 A,. ?Bou may a%Cust t e temperature range to ot er 7a!ues as you see *it@. T e measure% temperature %ata ;i!! be %isp!aye% numerica!!y as a *i-e%(point number on t e :L$D# using a 0.01 *i-e%(point *ormat. T e temperature 7ersus time %ata ;i!! a!so be grap ica!!y p!otte%. Bour temperature measurement reso!ution s ou!% be 0.1 A, or better. T e a7erage temperature accuracy s ou!% be 1 A, or better. T e *requency components o* t e signa! are 0 to 10 DE. Approach an) .onstraints Figure 9.1 s o;s t e %ata(*!o; grap o* t e temperature %ata acquisition system. T e t ermistor con7erts temperature to resistance# t e bri%ge con7erts resistance to a sma!! 7o!tage# t e ana!og amp con7erts a sma!! 7o!tage into t e 0 to G36 range# t e ana!og *i!ter remo7es ig *requency noise ?impro7es S/'@# an% t e AD, con7erts ana!og 7o!tage to a 10(bit integer. T e perio%ic timer triggers t e AD,# an% t e )S' e-ecutes ; en t e AD, is comp!ete. .ecause t e timer starts t e AD,# t ere is no samp!ing Citter. T e system is rea! time as !ong as t e so*t;are is *ast enoug to "eep up ?no !ost %ata@. Data are passe% to t e *oregroun% using any appropriate %ata structure ?suc as a mai!bo- or F)F:# s o;n as Data in Figure 9.1@. T e main program con7erts integer to *i-e%( point %ata using a tab!e !oo"up(interpo!ation sc eme. T e resu!ts are %isp!aye% on t e :L$D.

T emistor

'

.ri%ge

Amp

AD,

ADC

)S' Table

Data

Timer0A :L$D %isp!ay

main

OLED

Figure 9.1. Data-flow graph of the data acquisition system (R means resistance, V means voltage) . Figure 9.2 s o;s one possib!e ca!!(grap . $ac o* t e mo%u!es ? 1L2D# AD.# Data@ as separate ea%er an% imp!ementation *i!es. /otice t e main program %oes not %irect!y access t e AD.( Timer or 1L2D )/: port registers. T e mo%u!e Data can emp!oy any appropriate met o% to pass %ata *rom bac"groun% to *oregroun%.

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014 main S;itc es :L$D AD, :L$D Timer AD, Data

Page 9.2

Figure 9.2. One possible call-graph of the data acquisition system . T is %ata acquisition system inc!u%es a t ermistor# ; ic con7erts temperature into a resistance. :ne possib!e ;ay to con7ert resistance into 7o!tage is to use a bri%ge. A secon% possibi!ity is to use a constant current source. )n eit er case# an ana!og amp!i*ier boosts t e 7o!tage so t e *u!! sca!e temperature range ?e.g.# 0 to 40 A,@ maps into t e *u!!(sca!e range o* t e AD, ?0 to 3 6@. A !o;(pass ana!og *i!ter# ;it a cuto** *requency o* about H t e samp!ing rate# remo7es ig *requencies t at mig t ot er;ise cause a!iasing. A !o;(pass ana!og *i!ter must be imp!emente% in t is !ab. , oose t e LPF cuto** *requency greater t an or equa! to 20 DE# an% !ess t an H * s. 1. Temperature('esistance ,a!ibration o* t e T ermistor& T e t ermistor resistance 7aries non!inear!y ;it its temperature. )t is 7ery important to use temperature units o* Ie!7in in t is equation an% not A,. ' J 'o e ?; ere T is temperature in %egrees Ie!7in@ T e t ermistors in t is !ab a7e a resistance o* eit er 30 " or 100 " at 23 A,. )* you ;ant to put t e probe into ;ater# you ;i!! a7e to ;ater(proo* t e tip o* t e probe. :ne ;ater(proo* met o% is to !ig t!y paint t e bare ;ires ;it paint or epo-y. Do not use e!ectrica! tape. Do not so!%er/epo-y/paint t ermistors *rom c ec"out# because %e7ices *rom c ec"out nee% to be returne%. 2. , oose a samp!ing rate )n t is !ab# ;e ;i!! process temperature signa!s ?0 to 10 DE@. Accor%ing to t e /yquist T eorem# ;e nee% a samp!ing rate greater t an 20 DE. Bou are *ree to c oose any samp!ing rate ?* s@ greater t an 20 DE. :utput compare interrupts ;i!! be use% to samp!e t e AD, in a bac"groun% t rea%. T is ig priority interrupt ;i!! estab!is t e samp!ing rate. T is se!ection o* samp!ing *requency ;i!! a**ect t e %esign o* ana!og an% %igita! *i!ters. So# ; en you c ange t e samp!ing rate# you ;i!! a7e to re%esign t e *i!ters. 3yquist Theorem& )* *ma- is t e !argest *requency component o* t e ana!og signa!# t en you must samp!e more t an t;ice *ma- in or%er to *ait *u!!y represent t e signa! in t e %igita! samp!es. For e-amp!e# i* t e ana!og signa! is A G . sin?2 *t G @ an% t e samp!ing rate is greater t an 2*# you ;i!! be ab!e to %etermine A# .# *# an% *rom t e %igita! samp!es. "alvano 'ostulate& )* *ma- is t e !argest *requency component o* t e ana!og signa!# t en you must samp!e more t an ten times *ma- in or%er *or t e reconstructe% %igita! samp!es to !oo" !i"e t e origina! signa! ; en p!otte% on a 7o!tage 7ersus time grap . 3. Dar%;are )nter*ace Figure 9.3 s o;s one possibi!ity *or t e ana!og e!ectronics o* t e %igita! t ermometer. Bou ;i!! a%% an ana!og *i!ter in t is !ab. , oose t e cuto** *requency o* t e LPF to be about H t e samp!ing rate. T e amp!i*ier s ou!% con7ert t e entire temperature range into t e 0 to G3 6 AD, range. .ecause you are using rai!(to(rai! op amps# t e entire system can be po;ere% by a sing!e G3.3 6 supp!y. PL$AS$ D: /:T KS$ G12 :' L12 6 SKPPL)$S )/ TD)S LA.. )* you a7e recei7e% *ree samp!es *rom T) in c!ass# you s ou!% %esign your system using state o* t e art components ?i* you %i% not come to c!ass t at %ay# you can bui!% t e circuit using TL,2204 *rom 2 n% *!oor c ec"out@. T e gain o* t e )/A122P amp!i*ier is %etermine% by t e resistor ' M. )* you are using an AD223# connect t e re*erence pin to 2.36 an% se!ect '2 to be t e resistance o* t e mi%(point temperature ?see Therm10"ref#$% !ls@. Mo to T).com an% %o;n!oa% t eir %esign too! ca!!e% &ilter'ro. ) !i"e 7ersion 2 o* t is %esign too!# ; ic is poste% on t e $$343+ !ab page ttp&//users.ece.ute-as.e%u/=7a!7ano/$$343+/. T e !in" can be *oun% at ttp&//users.ece.ute-as.e%u/=7a!7ano/$$343+/*i!terpro>%esign>program>%o;n!oa%( .e-e
G/T

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014


G3.36 G2.306 '1 '1 62 'M 'T '2 61 G3.36
)/A122P 's '1a

Page 9.3

L+4041,)LP'

6 out

2(po!e .utter;ort LPF

L+3S1921 AD,

'2a

Figure 9.3. Possible thermistor interface (easy to construct, but more expensive). 5e nee% an instrumentation amp ?prema%e or bui!t@ because o* its ig input impe%ance an% goo% ,+''. T is semester# T) as an )/A122P instrumentation amp!i*ier t at ;or"s ;e!! *or t is !ab. )* you %i% not a7e an AD223# AD220 or )/A122# t en you can bui!% your o;n instrumentation amp!i*ier using 3 op(amps# as s o;n in Figure 9.4. T e gain o* t e 3(op(amp instrumentation amp!i*ier is a *unction o* t e resistors ' 3 '4 '3 an% '2. T e TL,2204 operates rai!(to(rai!# ; ic means its output can s;ing a!! t e ;ay *rom 0 to G3.3 6. Any o* t e rai!(to( rai! op amps mentione% in c!ass can be use% in t is !ab& AD1032# TL,2204# or :PA2330. T ese op amps can operate on a sing!e G3.36 supp!y. n fact, if you connect the !"#22$% up to the usual &12 '12 ( supplies, you )ill *amage the *evice an* *amage your microcontroller.

G3.36 '1 '1 62 '4 '3 'T '4 '2 61

'3

'2 6 out '2

TL,2204

'3

2(po!e .utter;ort LPF

L+3S AD,

Figure 9.%. + goo* thermistor interface (har*er to construct, but cheaper to buil*). T e a%7antage o* using an instrumentation amp ?;it its ig N in@ is you can ana!yEe t e trans*er *unction *rom ' T to 61 consi%ering on!y t e bri%ge input ?G2.30 6@# '1 an% 'T. /orma!!y# t e '1 resistor in t e bri%ge is c osen !arge enoug to pre7ent se!*( eating t e t ermistor. Assume t e %issipation constant to be about 1 m5/A,. Limit t e t ermistor po;er to 0.1 m5 so t at t e se!*( eating error is be!o; 0.1 A,. T e ' 2 resistor in t e bri%ge estab!is es one o* t e e-treme 7a!ues o* t e temperature range. For e-amp!e# ; en t e t ermistor resistance# ' T# equa!s '2# t en t e bri%ge output 7o!tage is 0. T e gain o* t e %i**erentia! amp!i*ier# a!ong ;it t e AD, range ?0 to G3 6 in our case@ ;i!! %etermine t e temperature range o* t e system. 4. So*t;are ,on7ersion& Ksing t e ca!ibration %ata# t e non!inear t ermistor equation# t e c aracteristics o* your ana!og circuit an% t e response o* t e microcontro!!er AD,# %etermine t e AD, output samp!e *or eac temperature *or about 3 to 20 temperature points ;it in t e 0 to 40 A, temperature range. ?Again# you are *ree to a%Cust t e temperature range# as you see *it.@ T ere is an $-ce! sprea%s eet to assist you ca!!e% Therm10 !ls or Therm10"ref#$% !ls %epen%ing on ; et er your instrumentation re*erence pin is groun% or 2.36. S o; bot # a tab!e o* *igures an% a p!ot o* t is %ata. )nc!u%e appropriate interme%iate 7o!tages in t e tab!e ?e.g.# t ermistor resistance# bri%ge output# an% ana!og circuit output.@ Design a so*t;are con7ersion routine t at ca!cu!ates temperature *rom t e AD, samp!e. Bou s ou!% consi%er 7arious met o%s& a@ !inear equation ?%on<t use because it as errors too !arge@# b@ non!inear equation# c@ !arge tab!e !oo"up ?one entry *or eac AD, 7a!ue# i.e.# 1024 entries@# %@ sma!! tab!e !oo"up ?O30 entries@ ;it !inear interpo!ation in bet;een. P!ease consi%er %ropout an% o7er*!o; ; en imp!ementing t e con7ersion so*t;are. 3. 'ea!(time AD, samp!ing&

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014

Page 9.4

T e program ;i!! continuous!y samp!e t e AD, at a samp!ing *requency# * s# se!ecte% in part 2. T e AD, must be imp!emente% using interrupts. T ere are t;o goo% approac es to imp!ementing rea!(time AD, samp!ing. T e *irst approac is to imp!ement a perio%ic interrupt using SysTic" or a timer at t e %esire% samp!ing rate. )n t e )S' you start t e AD, con7ersion# ;ait *or it to comp!ete# rea% t e AD, resu!t# an% pass t e %ata *rom t e )S' to t e main program using a mai!bo- or F)F: queue. T ere is some samp!ing Citter to t is approac %ue to t e 7ariab!e %e!ay bet;een interrupt trigger an% t e e-ecution o* t e )S' ? AD.S0Tri//er$,11 -ip @. T e secon% approac is to create a ar%;are timer perio% ;it a *requency matc ing t e %esire% samp!ing rate. T e timer is interna!!y connecte% to t e AD, to create a ar%;are trigger. T e AD, is con*igure% to start a con7ersion perio%ica!!y by t e ar%;are timer. T e AD, is arme% to generate an interrupt on comp!etion. )n t is secon% approac # t e AD, )S' %oes not nee% to start t e con7ersion. )n *act# t e AD, comp!etion *!ag triggers t e interrupt. T is )S' simp!y rea%s t e %ata# ac"no;!e%ges t e interrupt an% passes t e %ata to t e *oregroun% using a mai!bo- or F)F: queue. T ere is no samp!ing Citter to t is approac ? AD.T0ATri//er$,11 -ip @. T e main or *oregroun% t rea% ;i!! get %ata *rom t e mai!bo- or F)F:# ca!cu!ate temperature *rom t e AD, samp!e# an% t en %isp!ay t e measure% temperature bot numerica!!y an% grap ica!!y on t e :L$D %isp!ay. 2. Temperature 'eso!ution ?s"ip t is section@& To measure temperature resolution, we use the students t-test to determine if the system is able to detect the change. To use the students t test we need to make the following assumptions: 1) the errors in one data set are independent (not correlated to) the errors in the other data set; 2) the errors in each data sample are independent (not correlated to) the errors in other data within that set; 3) the errors are normally distributed; 4) the variance is unknown; 5) the variances in the two sets are equal. If a random variable, X, is normally distributed with a mean is and a standard deviation of , then the probability that it falls between 1 is 68 %. I.e., P(- < X < +) = 0.68 Similarly, P(-1.96 < X < +1.96) = 0.95 P(-2 < X < +2) = 0.954 P(-2.58 < X < +2.58) = 0.99 P(-3 < X < +3) = 0.9997 The square of the standard deviation is called variance, 2. In most situations, we do not know the mean and standard deviation, so we collect data and estimate them. In particular, we take multiple measurements assuming the temperature is constant. Let Xi be repeated measurements under the same conditions, and N is the number of measurements (e.g., N = 10).

1 ? , i , @2 - 1 i - i The N-1 term is used in the calculation of S because there are N-1 degrees of freedom. These expressions are unbiased estimates of and , meaning as the sample size increases the estimates approach truth. Formally, we say the expected value of , is , or E( , ) = . Similarly, the expected value of S2 is 2, or E(S2) = 2. For example, we collect two sets of data (e.g., 10 measurements in each set, N = 10), and we want to know if the means of two sample sets are different. Consider the measurements in the two data sets as the sum of the true value plus an error: X01 = 0 + e0i Xi1 = 1 + e1i Assumption 1 states that e0i are not correlated to e 1i. Assumption 2 states that e 0i are not correlated to e 0j and e1i are not correlated to e1j. Thermal noise will satisfy these assumptions. We employ a test statistic to test the hypothesis H0: 0= 1. First, we estimate the means and variances of the data (assuming equal sized samples) 1 1 2 .0 = ? , 0i , 0 @ 2 , 0 = , 0i - 1 i - i

, =

, i

.2 =

,1 =

- i

,1i

2 .1 =

1 ? , 1i , 1 @ 2 - 1 i

From these, we calculate the test statistic t:

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014


t= ,1 , 0
2 .0

Page 9.3

2 - + .1 The two sets of data, together, have 2N-2 degrees of freedom. The students t table, shown as Table 9.1, has two dimensions. In the vertical direction, we specify the degrees of freedom, df. For example, if there are 10 data points in each data set, then df equals 18. In the horizontal direction we select the probability of being correct. For example, if we wish to be 99% sure of the test, then we select the 99% column. Selecting the row and the column allows us to pick a number threshold. For example, the number in the df=18 row, confidence=99% column is 2.878. This means if H0 is true, then Probability of t < -2.878 = 0.005 and Probability of t > 2.878 = 0.005 Therefore Probability of -2.878 < t < 2.878 = 0.99 (confidence interval of 99%)

If we collect data and calculate t such that the test statistic t is greater than 2.878 or less than -2.878, then we claim we reject the hypothesis H 0. If the test statistic t is between -2.878 and 2.878 we do not claim the hypothesis to be true. In other words we have not proven the means to be equal. Rather, we say we do not reject the hypothesis H0. 90% 98% 99.8% 99.9% confidence 80% 99% 0.05 0.01 0.001 0.0005 df p= 0.10 0.005 8 1.397 1.860 2.896 4.501 5.041 3.355 9 1.383 1.833 2.821 4.297 4.781 3.250 10 1.372 1.812 2.764 4.144 4.587 3.169 11 1.363 1.796 2.718 4.025 4.437 3.106 12 1.356 1.782 2.681 3.930 4.318 3.055 13 1.350 1.771 2.650 3.852 4.221 3.012 14 1.345 1.761 2.624 3.787 4.140 2.977 15 1.341 1.753 2.602 3.733 4.073 2.947 16 1.337 1.746 2.583 3.686 4.015 2.921 17 1.333 1.740 2.567 3.646 3.965 2.898 18 1.330 1.734 2.552 2.878 3.610 3.922 19 1.328 1.729 2.539 3.579 3.883 2.861 20 1.325 1.725 2.528 3.552 3.850 2.845 21 1.323 1.721 2.518 3.527 3.819 2.831 22 1.321 1.717 2.508 3.505 3.792 2.819 23 1.319 1.714 2.500 3.485 3.767 2.807 24 1.318 1.711 2.492 3.467 3.745 2.797 25 1.316 1.708 2.485 3.450 3.725 2.787 26 1.315 1.706 2.479 3.435 3.707 2.779 27 1.314 1.703 2.473 3.421 3.690 2.771 28 1.313 1.701 2.467 3.408 3.674 2.763 29 1.311 1.699 2.462 3.396 3.659 2.756 30 1.310 1.697 2.457 3.385 3.646 2.750 40 1.303 1.684 2.423 3.307 3.551 2.704 50 1.299 1.676 2.403 3.261 3.496 2.678 60 1.296 1.671 2.390 3.232 3.460 2.660 80 1.292 1.664 2.374 3.195 3.416 2.639 100 1.290 1.660 2.364 3.174 3.390 2.626 120 1.289 1.658 2.358 3.160 3.373 2.617 1.282 1.645 2.326 3.090 3.291 2.576 Table 9.1. Students t distribution table. 'reparation 4)o this before your lab perio)5 1. .ru)e calibration T e t ermistor resistance 7aries non!inear!y ;it its temperature. Per*orm a 7ery cru%e temperature ca!ibration e-periment ;it t;o points some; ere in your temperature range o* 0 to 40 A,. 5e e-pect most stu%ents to use room temperature an% a-i!!a temperature *or ca!ibration. Bour s"in temperature in t e a-i!!a

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014

Page 9.2

region ?arm pit@ is about 32 A,. T e room temperature can be measure% any t ermometer# suc as t e eating/A, system. 1ptional measurement :ne temperature stan%ar% can be create% ;it a mi-ture o* crus e% ice an% ;ater in an insu!ate% 7esse! ?e.g.# a Styro*oam cup@. .alibration Kse t e $-ce! sprea%s eet to %etermine '0 an% *rom t e t;o ca!ibration points. )n particu!ar# Therm10 !ls or Therm10"ref#$% !ls %epen%ing on ; et er your instrumentation re*erence pin ?)/A122 pin 3@ is groun% or 2.36. T is quic" ca!ibration ;i!! on!y be use% to c oose resistors in t e circuit. A rea! ca!ibration ;i!! be per*orme% as proce%ure 3. 2. 'e7ie; t e tec nica! in*ormation on t e AD, system o* L+3S1921. List t ree ;ays you cou!% use to initiate t e AD, con7ersion process. 5 at is t e ;ay to "no; ; en t e con7ersion process as been comp!ete% P P!ace t e ans;ers to t ese t;o questions in t e beginning comment section o* your main program. Bou may use t e e-amp!e AD, programs# but it is your responsibi!ity to un%erstan% t e mo%es. 3. , oose one o* t e options as %iscusse% in ar%;are section an% %esign t e appropriate t ermistor amp!i*ier. .e prepare% %uring c ec"out to %iscuss t e reasons *or your c oice o* %esign. Bou must a%% a t;o(po!e .utter;ort !o;(pass anti(a!iasing ana!og *i!ter. S o; name an% number o* a!! t e pins in7o!7e% inc!u%ing po;er. A%% bypass capacitors on a!! c ips. 5 y is it is important to connect bypass capacitors across t e po;er pins *or t e ana!og ), componentsP Labe! a!! resistance an% capacitance 7a!ues an% types. For e-amp!e# 1" 3Q carbon# or 0.01F 10Q R0' ceramic. Bou %o not nee% to s o; circuits on t e e7a!uation boar%# suc as s;itc es an% t e :L$D. Dra; t e circuit using t e ,AD too! P,. Artist. 4. T is program is not use% to measure temperature. 'at er it is use% to stu%y t e /yquist T eorem as %escribe% in Proce%ure 1@. ,reate a rea!(time %ata acquisition system t at ta"es 1000 samp!es at 1000 DE# t en prints out t e %ata 7ia t e KA'T ? AD.'rintResults$,11 -ip @. Bou s ou!% *irst co!!ect t e %ata# ne-t print it out# an% t en stop. 3. 5rite t e so*t;are system t at samp!es t e AD, at a rate at or abo7e 20 DE. Pass t e %ata *rom bac"groun% into t e *oregroun% using a mai!bo- or F)F: queue. )n t e main program con7ert t e AD, %ata to *i-e% point temperature an% %isp!ay it on t e :L$D bot numerica!!y an% grap ica!!y. A Ssynta-(error(*reeT ar%copy !isting *or t e so*t;are is require% as preparation. T e TA ;i!! c ec" o** your !isting at t e beginning o* t e !ab perio%. Bou are require% to %o your e%iting be*ore !ab. T e %ebugging ;i!! be %one %uring !ab. Document c!ear!y t e operation o* t e routines. T e AD, an% AD, trigger ?e.g.# Timer0A@ mo%u!es must be ;ritten at a !o; !e7e!# !i"e t e boo"# ;it out ca!!ing Ste!!aris5are %ri7er co%e. :t er co%e can use Ste!!aris5are %ri7er co%e. 'roce)ure 4)o this )urin/ your lab perio)5 1. /asic un*erstan*ing& T e purpose o* t is section is to 7eri*y t e 3yquist Theorem an% t e "alvano 'ostulate. Menerate a continuous ;a7e*orm ?0.3 to G2.36@ ;it an a%Custab!e *requency *rom 10 DE to 10 "DE. Kse a *unction generator but ma"e sure t e output is 0.3 to G2.36. P!ease connect t e ana!og ;a7e*orm to a scope an% 7eri*y t e 7o!tage range is bet;een 0 an% G36 be*ore connecting to t e microcontro!!er. 6:LTAM$S :KTS)D$ TD)S 'A/M$ 5)LL DA+AM$ TD$ L+3S1921. /e-t connect t e signa! to an ana!og input. )n t is part# ;e ;i!! not be using t e t ermistor or ana!og amp!i*ier. Kse t e so*t;are system *rom Preparation 4@ to capture 100 %ata points at 1 "DE samp!ing. ,o!!ect %ata *or *requencies about 100 DE ?6a!7ano Postu!ate@# 300 DE ?/yquist@# an% 2 "DE ?a!iase%@. Kse t e KA'T output to trans*er %ata to t e P,. P!ot t e resu!ts by connecting t e %ata points ;it a straig t !ine. Describe t e concepts o* /yquist T eorem# 6a!7ano Postu!ate# an% a!iasing using t is speci*ic %ata. .e prepare% to e-p!ain your resu!ts %uring c ec"out.

Figure 9.3. 'esu!ts ;it samp!ing rate 1 times t e *requency an% ;it 32 times t e *requency.

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014

Page 9.0

2. .tatic analog circuit test & Per*orm t ese tests be*ore connecting t e circuit to t e L+3S1921. ,onstruct an% e7a!uate t e t ermistor circuit. :ne by one rep!ace t e t ermistor ;it 4 regu!ar resistors t at a7e resistances ;it in t e typica! range o* your t ermistor. :ne test resistor s ou!% a7e a resistance equa! to t e resistance o* t e t ermistor near t e ma-imum temperature# an% anot er test resistor s ou!% a7e a resistance equa! to t e resistance o* t e t ermistor near t e minimum temperature. 'ecor% t e 7o!tage 7a!ues at strategic p!aces in your ana!og circuit. 5 at 7o!tage output %o you get ; en t e t ermistor is %isconnecte%P 5 at 7o!tage output %o you get ; en t e t ermistor ;ires are s orte%P T ese measurements s ou!% matc t e numbers in t e therm10 !ls %esign temp!ate. Bou s ou!% mo%i*y your temperature measurement so*t;are to output speci*ic error con%itions i* t e t ermistor is s orte% or %isconnecte%. 3. 0ynamic analog circuit test & Again# per*orm t ese tests be*ore connecting t e circuit to t e L+3S1921. Disconnect t e t ermistor# an% connect a sine(;a7e signa! generator in its p!ace. +a"e sure t e 7o!tage !e7e! o* t e signa! generator is ;it in range# so t at t e inputs an% outputs o* your ana!og circuit are not saturate%. 'ecor% t e sine(;a7e amp!itu%es o* t e input an% output 7o!tages. Start at about 1 DE an% co!!ect measurements at ten %i**erent *requencies. +a"e sure you c oose *requencies !arge enoug to see t e gain ro!! o**. ,a!cu!ate t e gain at eac *requency. P!ot t e gain 7ersus *requency response o* your circuit. )n systems ; ere t e s ape o* t e signa! is important# suc as au%io or 7i%eo# t e p ase 7ersus *requency response is important. Bou %o not a7e to measure t e p ase response o* your ana!og circuit. 4. +nalog1to10igital #onversion& +o%i*y your rea!(time system so it %isp!ays AD, samp!e on t e :L$D as a %ecima! number *rom 0 to 1023. ,onnect t e output o* your t ermistor amp!i*ier to t e input o* t e AD, system. Kse your *our *i-e% resistors an% co!!ect %igita! samp!es. A%% t e AD, samp!e to t e %ata co!!ecte% in part 2. 3. #alibration. )n t is section your so*t;are ;i!! output t e AD, samp!e as a %ecima! number. 5e %e*ine t e temperature as measure% by t e F!u"e 106 mu!timeter as re*erence trut . T ere is a I(type t ermocoup!e t at p!ugs into t e F!u"e a!!o;ing it to measure temperature. )ts range is (40 to 220 U, ?(40 to 300 UF@# an% its accuracy is 2.2 U, or 2 Q. T ere are t;o o* t ese meters on t e 4 t *!oor !ab# so recor% ;it ; ic F!u"e meter you ca!ibrate%. Bou are a!!o;e% to use anot er temperature re*erence# as !ong as it is as goo% as t is F!u"e. P!ace your t ermistor an% t e re*erence t ermometer at t e same temperature ?room temperature or an insu!ate% cup ;it crus e% ice an% ;ater@. 5ait *or bot your AD, measurement an% t e re*erence t ermometer to stabi!iEe. 'ecor% bot t e true temperature an% t e AD, samp!e as measure% by your system. 'ecor% bot t e true temperature an% t e AD, samp!e as measure% by your system. )ncorporate t is ca!ibration %ata into a ea%er *i!e ca!!e% calib.h. )n particu!ar# i* you c ange t ermistors or reca!ibrate# on!y c anges to t is ea%er *i!e ;i!! be require%. Bou can use or not use t e sprea%s eets Therm10 !ls or Therm10"ref#$% !ls as !ong as you incorporate t e non!inearity o* t e t ermistors in an appropriate manner. :ne possib!e so!ution is to use t e 0 an% 40 A, to create a 31(point tab!e *rom T erm10.-!s. T en# use t e ca!ibration point as a temperature o**set to a%Cust t e t erm10.-!s. ).e.# samp!e t e AD,# use t e t erm10.-!s !oo"up tab!es to con7ert AD, into temperature# t en a%% a temperature correction as %etermine% by t e one(point ca!ibration. Figure 9.2. !he Flu3e 4$( can measure temperature. 2. +ccuracy . Accuracy is %e*ine% as t e abso!ute %i**erence bet;een t e true temperature an% t e 7a!ue measure% by your %e7ice. Accuracy is %epen%ent on t e same parameters as reso!ution# but in a%%ition it is a!so %epen%ent on t e stabi!ity o* t e trans%ucer an% t e qua!ity o* t e ca!ibration proce%ure. P!ease use t e same F!u"e meter as you use% in ca!ibration. )n t is section your so*t;are ;i!! output t e temperature as a *i-e%(point number ;it a 0.01 A, *ormat. ,o!!ect 3 measurements at one temperature& eit er in crus e% ice/;ater# room air# or in an insu!ate% container o* ;ater# creating a tab!e s o;ing t e true temperature ?-ti as %etermine% by t e F!u"e meter@# an% measure% temperature ?- mi using your %e7ice@. ,a!cu!ate a7erage accuracy by ca!cu!ating t e a7erage %i**erence bet;een trut an% measurement# 1 n A7erage accuracy ?;it units in A,@ J x xm i n i = 1 ti 0. 5epro*ucibility & P!ace t e t ermistor in eit er crus e% ice/;ater# room air# or in an insu!ate% container o* ;ater# an% recor% 10 in%epen%ent temperature measurements. ,a!cu!ate t e stan%ar% %e7iation o* t ese %ata an% report S ?estimation o* @ as repro%ucibi!ity.

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014

Page 9.1

1. S6ip this part 5esolution& Ta"e 10 measurements at 30A, . /e-t# set t e temperature to 30.1 A,# an% recor% 10 more in%epen%ent temperature measurements. Again# ca!cu!ate t e stan%ar% %e7iation o* t ese %ata. /e-t ca!cu!ate t e stu%ent<s t statistic an% use it to %etermine i* your system as a temperature reso!ution o* 0.1 A, or better.

10 measurements with Tin = T1 10 measurements with T Tin = T1+T pdf

ADC Digital Output


Figure 9.$. 5esolution means if the temperature increases by !, the system )ill probably notice. Deliverables (exact components of the lab report) A) Objectives (1/2 page maximum) B) Hardware Design Circuit diagram of the thermistor interface ,@ So*t;are Design ?a ar%copy so*t;are printout is %ue at t e time o* %emonstration@ 1) Calibration data (procedure 5 and the calib.h file) 2) Low level ADC interface (ADC.c and ADC.h files) 3) Main program used to measure temperature D) Measurement Data 1) Sketch three waveforms (procedure 1) 2) Static circuit performance (procedure 2,4) 3) Dynamic circuit performance (procedure 3) 4) Accuracy (procedure 6) 5) Reproducibility (procedure 7) $@ Ana!ysis an% Discussion ?gi7e s ort ans;ers to t ese questions@ 1) What is the Nyquist theorem and how does it apply to this lab? 2) Explain the difference between resolution and accuracy? 3) Derive an equation to relate reproducibility and precision of the thermometer. 4) What is the purpose of the LPF? 5) If the R versus T curve of the thermistor is so nonlinear, why does the voltage versus temperature curve look so linear? 6) There are four methods (a,b,c,d) listed in the 4) Software Conversion section of methods and constraints. For one of the methods you did not implement, give reasons why your method is better, and give reasons why this alternative method would have been better. .hec6out 4show this to the TA5 Bou s ou!% be ab!e to %emonstrate t e proper operation o* %igita! t ermometer. 5e e-pect your accuracy to be at !east 1 A, an% your repro%ucibi!ity to be !ess t an 0.1 A,. A har)copy printout of your software will be /iven to your TA( an) /ra)e) for style at a later time 7ints 1@ T is is a !ong !ab ;it many parts# so start ear!y. 2@ Don<t try to comp!ete t e e-periment in one *u!! s;oop. 'un t e ar%;are test program gi7en abo7e be*ore testing your so*t;are. Debug t e system in an ana!ytica!# step(;ise manner. 3@ P!ease %o not use regu!ar op amps t at require V12 6 supp!ies. An a%7antage o* t e sing!e supp!y op amp ;it rai!(to(rai! outputs is t at t e output o* your ana!og amp!i*ier ;i!! remain ;it in t e 0 to G36 AD, range. 4@ ,ircuits bui!t ;it eit er t e )/A122P or AD223 are 7ery easy to imp!ement an% a7e muc impro7e% per*ormance o7er instrumentation amps bui!t ;it t ree op amps.

4onat an 5. 6a!7ano

Lab 9 Temperature Data Acquisition System Spring 2013 3/13/2014

Page 9.9

5) The underlined sections identify components that must be performed and included in the lab report. 6) How to connect the UART to a PC. A@ First# you p!ug t e L+3S1921 into t e P, .@ :pen t e %e7ice manager in 5in%o;s to see ; ic ,:+ port it is. )t ;i!! be some; ere in t e range ,:+4 to ,:+19. ,@ )* your :S as DyperTermina!# open it. )* your :S %oesnWt a7e DyperTermina! ?or e7en i* it %oes@# ) !i"e puttyX you can get putty at ttp&//;;;.putty.org/. Se!ect t e ,:+ port# 119200 bits/sec# 1 bit %ata# no parity# no ar%;are *!o; contro!. D@ :pen t e ttp&//users.ece.ute-as.e%u/=7a!7ano/arm/AD,Print'esu!ts>1921.Eip e-amp!e# compi!e %o;n!oa% an% run.

4onat an 5. 6a!7ano

You might also like