版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p> 一、畢業(yè)設(shè)計(jì)(論文)內(nèi)容及研究意義(價(jià)值)</p><p><b> 設(shè)計(jì)的內(nèi)容:</b></p><p> 此次設(shè)計(jì)是采用8051單片機(jī)作為主控芯片,設(shè)計(jì)一款酒精測(cè)試儀, 用C語(yǔ)言編寫主控芯片的控制程序,再結(jié)合外圍電路,使酒精測(cè)試儀可鍵盤輸入。通過(guò)酒精濃度的輸入,進(jìn)行響應(yīng)的電路報(bào)警。</p><p><
2、;b> 研究意義:</b></p><p> 近年來(lái)隨著經(jīng)濟(jì)迅速發(fā)展,人們的生活水平日夜提高。私家車也越來(lái)越多。各種應(yīng)酬也越來(lái)越多酒這東西貼近了我們的生活。而酒后駕車也頻頻發(fā)生給人們的生活和生命安全帶來(lái)了巨大的傷害。酒后駕駛引起的交通事故是由于司機(jī)飲酒過(guò)多造成酒精濃度較高。精神麻痹反應(yīng)遲鈍肢體不受大腦控制。人體酒精濃度低于一個(gè)特定值時(shí)就不出現(xiàn)上述癥狀從而可以避免發(fā)生危險(xiǎn)。所以研究一個(gè)酒精測(cè)試
3、是非常有必要和意義的事。</p><p> 目前世界上絕大數(shù)國(guó)家都在使用呼吸酒精測(cè)試儀對(duì)駕駛員進(jìn)行現(xiàn)場(chǎng)檢測(cè)來(lái)確定其體內(nèi)酒精濃度的多少。確保其生命財(cái)產(chǎn)安全。此外酒精測(cè)儀還可以測(cè)定某一特定環(huán)境下的酒精濃度如酒精生產(chǎn)車間可以避免發(fā)生火災(zāi)。</p><p> 二、畢業(yè)設(shè)計(jì)(論文)研究現(xiàn)狀和發(fā)展趨勢(shì)(文獻(xiàn)綜述)</p><p><b> 研究現(xiàn)狀:</b
4、></p><p> 酒精測(cè)試儀的精度關(guān)鍵的一部就是對(duì)乙醇的檢測(cè)。這就關(guān)系到傳感器的制造與研發(fā)。目前氣體傳感器正在向著低功耗,多功能,集成化方向發(fā)展。同時(shí)還要增加其可靠性實(shí)現(xiàn)元件和應(yīng)用電路集成化,多功能。發(fā)展MEMS技術(shù)。發(fā)展現(xiàn)場(chǎng)適用的變送器和智能化的傳感器。</p><p><b> 發(fā)展趨勢(shì):</b></p><p> 目前對(duì)酒
5、精測(cè)試的裝置有燃料電池型,半導(dǎo)體型,紅外線型,氣體色譜分析性和比色型五種類型。但由于價(jià)格方面的原因目前市場(chǎng)上用的是燃料電池型和半導(dǎo)體型。</p><p> 燃料電池型是世界都在研究的環(huán)保型能源。它可以把氣體直接轉(zhuǎn)換為電能而不產(chǎn)生污染。酒精傳感器只是它的一個(gè)分支。在燃燒室內(nèi)充滿特種催化劑。使進(jìn)入燃燒室內(nèi)的酒精能進(jìn)行充分燃燒轉(zhuǎn)換為電能。也就是在電極上產(chǎn)生電壓消耗在外加負(fù)載上。使電壓與燃燒室內(nèi)的酒精濃度成正比。<
6、;/p><p> 與半導(dǎo)體型相比,燃料電池型的呼吸酒精測(cè)試儀具有穩(wěn)定性好、精度高、抗干擾性能好等優(yōu)點(diǎn)。但由于其傳感器結(jié)構(gòu)要求特別高所以生產(chǎn)成本提別高,制造難度特別大所以只有少數(shù)國(guó)家能夠生產(chǎn)。</p><p> 三、畢業(yè)設(shè)計(jì)(論文)研究方案及工作計(jì)劃</p><p> 1、研究方案(軟硬件的設(shè)計(jì)方法:系統(tǒng)框圖、各個(gè)軟件部分的主要功能)</p><
7、p> 選用單片機(jī)AT89S51本設(shè)計(jì)的核心元件,利用單片機(jī)靈活的編程設(shè)計(jì)和豐富的IO端口,及其控制的準(zhǔn)確性,實(shí)現(xiàn)基本的檢測(cè)功能單片的外圍電路外接輸入鍵盤用于濃度標(biāo)準(zhǔn)值功能的控制,外接LCD1602顯示器用于顯示作用。</p><p> 發(fā)光二極管采用集成驅(qū)動(dòng)器LM3914。其內(nèi)部有十個(gè)電壓比較器可以控制十個(gè)發(fā)光二極管。相鄰電壓為0.12V??梢圆捎命c(diǎn)狀顯示也可采用條狀顯示。</p><
8、;p> ADC0809為8路8位的A\D轉(zhuǎn)換器具有起??刂贫恕^D(zhuǎn)換時(shí)間為100us。輸入電壓為0-5V。供電電壓為5V。三位數(shù)碼顯示具體數(shù)值。</p><p> 傳感器遇到酒精氣體后,阻值發(fā)生變化,所要測(cè)得電壓發(fā)生變化,在經(jīng)過(guò)LM3914的放大比較,驅(qū)動(dòng)相應(yīng)的二極管發(fā)光,顯示酒精濃度的高低。單片機(jī)不斷采集ADC0809模數(shù)轉(zhuǎn)換后變化電壓,經(jīng)數(shù)據(jù)處理交數(shù)碼管處理。</p><p>
9、<b> 結(jié)構(gòu)方案圖</b></p><p> 傳感器——信號(hào)調(diào)制——A\D—單片機(jī)</p><p> 2、重點(diǎn)與難點(diǎn)(此部分要求條理清晰,分一,二,三……等小點(diǎn)描述清楚,以及解決途徑)</p><p> 本次設(shè)計(jì)的酒精測(cè)試儀系統(tǒng)的關(guān)鍵問(wèn)題是:1.使用LCD顯示器來(lái)顯示酒精濃度和輸入的相關(guān)信息。2.傳感器電路的設(shè)計(jì)。首先設(shè)計(jì)一個(gè)基準(zhǔn)電壓
10、2.5V,采用差動(dòng)輸入使得V輸出=V酒精濃度-2.5V。從而使得傳感器的輸出范圍符合AT89S51的范圍。發(fā)光二極管點(diǎn)越亮,酒精濃度越高燃燒產(chǎn)生的電壓值越大,超過(guò)設(shè)定值,電路報(bào)警。</p><p><b> 3、工作計(jì)劃</b></p><p><b> 四、主要參考文獻(xiàn):</b></p><p> 【1】岳睿 .呼
11、吸式酒精傳感器的研究進(jìn)展【J】.化學(xué)傳感器,2006(3):6-9。</p><p> 【2】劉豐年.氣體傳感器測(cè)試系統(tǒng)【D】.碩士學(xué)位論文.吉林:哈爾濱理工大學(xué),2003。</p><p> 【3】何希才.傳感器技術(shù)與應(yīng)用【M】.北京:北京航空航天大學(xué)出版社,2005。</p><p> 【4】張培仁.MCS-51單片機(jī)原理與應(yīng)用【M】.北京:清華大學(xué)出版社
12、,2003</p><p> 【5】王幸之.AT89系列單片機(jī)原理與接口技術(shù)【M】.北京:北京航空航天大學(xué)出版社,2004。</p><p> 【6】何立民.單片機(jī)高級(jí)教程應(yīng)用與設(shè)計(jì)【M】.北京:北京航空航天大學(xué)出版社,2000.</p><p> 【7】魏英智.DS18B20在溫度控制中的應(yīng)用.煤炭機(jī)械。2005(3):92-93</p>&l
13、t;p> 【8】何希才《常用集成電路實(shí)用實(shí)例》 電子工業(yè)出版社,2007</p><p> 【9】陳有卿《通用集成電路應(yīng)用于實(shí)例分析》中國(guó)電力出版社,2007</p><p> 【10】馬中梅《單片機(jī)C語(yǔ)言程序設(shè)計(jì)》北京航空航天大學(xué)出版社,2007</p><p><b> 外文文獻(xiàn)</b></p><p>
14、;<b> 中文譯文</b></p><p> AT89CX051微控制器的模擬-數(shù)字變換器應(yīng)用</p><p> Atmel AT89C1051和AT89C2051微控制器是具有低引腳數(shù)和寬工作電壓范圍的單片閃光器(Flash)和不可缺少的比較器。這篇應(yīng)用手冊(cè)描述了這兩種低成本的數(shù)字化變換技術(shù)。它們被用于Atmel AT89C1051和AT89C2051微控制
15、器的比較器中。</p><p> RC 模擬數(shù)字變換器</p><p> 這種變換方法組成簡(jiǎn)單,但準(zhǔn)確性下降和變換時(shí)間長(zhǎng)。在下列提到的例子中,分辨率超過(guò)50毫伏,準(zhǔn)確性低于0.1volt或是更少。變換時(shí)間為7毫秒或是更少</p><p> 如圖一所示,如果采用RC模擬數(shù)字轉(zhuǎn)換方法只需要一個(gè)AT89CX051微控制器,兩個(gè)電阻器和一個(gè)電容器。微控制器的輸出(11
16、腳)大約從零和VCC間變化。它交替為電容充放電。這個(gè)電容器與內(nèi)部比較器的非反向輸入相連(12腳)。微控制器計(jì)算電容器電壓達(dá)到與內(nèi)部變換比較器輸入電壓的時(shí)間。比較器電壓要和未知輸入電壓相匹配(13腳)。未知電壓是所測(cè)時(shí)間的函數(shù)。</p><p> 在圖一中HP LED 所顯示不需要變化,但是要用軟件來(lái)實(shí)現(xiàn)簡(jiǎn)單二進(jìn)制電壓作用。模數(shù)變換器在兩個(gè)顯示屏上顯示伏特和0.1伏特。電壓分辨率不利用RC轉(zhuǎn)換軟件的判別,它在提供
17、調(diào)試工具的同時(shí)也給出了一個(gè)方法。</p><p> 典型電容器充放電周期波形如圖二所示。放電部分曲線和充電部分曲線相同,大約都在VC=VCC=2線上。除了已給出的說(shuō)明的地方,放電部分周期運(yùn)用了下面的方程和討論:</p><p> 下列指數(shù)方程中,電容器的電壓是時(shí)間的函數(shù): </p><p> 其中VC是t時(shí)刻的電容器電壓,VCC是給定電壓,RC是電容器和電阻器
18、值的乘積。電壓?jiǎn)挝粸榉?,時(shí)間單位為秒。電阻為歐姆,電容為法拉。乘積RC為時(shí)間恒量,影響網(wǎng)絡(luò)的波形。當(dāng)電容器充放電開始時(shí)波形最陡,并隨時(shí)間變化。不能用浮點(diǎn)計(jì)算和超函數(shù)來(lái)求解指數(shù)方程是RC變換方法的首要問(wèn)題。在一個(gè)壓縮的時(shí)間范圍里,指數(shù)曲線呈現(xiàn)遠(yuǎn)遠(yuǎn)超出其寬度的陡升趨勢(shì),近似為垂線。曲線在橫向的持續(xù)變化超過(guò)了橫向變化,產(chǎn)生了很大的誤差。是這種方法失敗的原因。而且它不能解決曲線在漸近線VCC附近劇烈震動(dòng)的問(wèn)題。如果每一次取樣時(shí)間間隔里使用查表繪
19、出計(jì)算初值,微型控制器不需要適時(shí)解決指數(shù)方程。這種方法在簡(jiǎn)化變換軟件時(shí),可以根據(jù)應(yīng)用需要把數(shù)據(jù)編碼和格式化。可能使數(shù)據(jù)對(duì)稱以減小表的大小。</p><p> RC轉(zhuǎn)換方法的第二個(gè)問(wèn)題是方程各項(xiàng)值變化引起的固有誤差。圖三是電阻電容積值的變化導(dǎo)致電壓變化的放大圖。如圖所示,隨著電容電阻乘積中電壓減小,電容電壓隨之減小。</p><p> 電容器充放電周期的對(duì)稱減小了電容電阻乘積值變化帶來(lái)的
20、影響,提高了變換準(zhǔn)確性。這是通過(guò)周期充電部分的計(jì)算電壓小于VCC/2而放電部分的計(jì)算電壓大于VCC/2。誤差在VCC/2達(dá)到最小。</p><p> 在RC被賦值之前,比較器輸出采樣時(shí)間間隔必須確定。采樣間隔應(yīng)盡可能小以縮短變換時(shí)間和增大變換分辨率。采樣間隔受執(zhí)行必要編碼所需時(shí)間限制。編碼時(shí)間由微控制器的時(shí)鐘速度決定。在伏特計(jì)應(yīng)用中,由于微控制器在12MHZ時(shí)鐘下運(yùn)行,每五微秒為一個(gè)采樣間隔。</p>
21、;<p> 時(shí)間恒量RC影響著電容器充放電的波形。時(shí)間恒量必須選擇合適的值以使波形最陡部分達(dá)到所需的分辨水平。充電部分的波形最陡出現(xiàn)在原點(diǎn)附近,而放電部分則出現(xiàn)在VCC附近。由于波形的對(duì)稱,兩個(gè)部分的波形可能用同一時(shí)間恒量來(lái)計(jì)算。</p><p> 圖四是電壓和原點(diǎn)附近采樣時(shí)間關(guān)系放大圖。在圖中,是變換器達(dá)到所需分辨率的所需電壓。是先前所定的采樣間隔。曲線坐標(biāo)VC表示電容電壓,在曲線中呈直線。在
22、圖中,由于采樣在電壓間隔中心進(jìn)行,所以曲線的斜面是理想的。實(shí)際可能要小一些。也有可能大。或者分辨率會(huì)減小。將采樣時(shí)間間隔從原點(diǎn)偏移1/2t以后,其中心點(diǎn)對(duì)應(yīng)第一次電壓間隔采樣點(diǎn)。</p><p> 為了求得第一次采樣所需斜面,要獲得時(shí)間恒量的最小值,解方程一得RC</p><p> 然后設(shè)為所需分辨率得最小值(0.05volt),時(shí)間為先前確定的采樣間隔(5毫秒)。在第一個(gè)采樣點(diǎn)=1/
23、2計(jì)算RC。其中VC=1/2,t=1/2</p><p> R和C的乘積不能小于計(jì)算出的時(shí)間恒量最小值。</p><p> 用帶1%公差電阻和5%公差的電容:(Rnorm-1%)(Cnorm-5%)>4.99*10-4</p><p> 在伏特計(jì)中,R和C的值選擇分別為267歐姆和2毫微法。得到一個(gè)最小時(shí)間恒量大約5.02*10-4</p>
24、<p> 另外一個(gè)約束條件是R的值。再提到圖一,5.1歐上拉電阻連接微控制器的11腳。這個(gè)電阻是微控制器內(nèi)部上拉。但是在電容器充放電周期的充電過(guò)程中對(duì)網(wǎng)絡(luò)RC的時(shí)間恒量有決定性影響。它產(chǎn)生不對(duì)稱的充放電波。能造成變換誤差。為減小電容器充放電通道差異的影響,R的值應(yīng)選得比上拉內(nèi)阻值大得多。在伏特計(jì)應(yīng)用中,R的值選擇為267歐姆,此值遠(yuǎn)遠(yuǎn)大于上拉內(nèi)阻。</p><p> 時(shí)間恒量(RC)決定了電容器充
25、放電周期的持續(xù)時(shí)間。它是所需變換分辨率的函數(shù)。電容器充放電所需時(shí)間越多,在計(jì)算周期所需的采樣量越多,查找表個(gè)數(shù)越多。</p><p> 電容器充放電所需的時(shí)間通過(guò)計(jì)算電容電壓從漸近線上升到最小可晰電壓間隔一半所需的時(shí)間來(lái)近似得到。波形的充電部分,漸近線在VCC。由于波形的對(duì)稱,定值同時(shí)用在周期充電和放電部分。解方程1得到時(shí)間: </p><p> 設(shè)VCC為0.05。所需電壓為:VC=
26、VCC-(1/2)(0.05)=VCC-0.025</p><p><b> 由方程三:</b></p><p> 所需測(cè)量回路采樣最小值通過(guò)計(jì)算電容器電壓達(dá)到VCC/2得到,根據(jù)不同采樣間隔劃分。如果電容電壓上升緩慢,而電容電阻值很大,時(shí)間常數(shù)用最大值計(jì)算。由于電容器充放電波形的對(duì)稱,采樣數(shù)將同時(shí)在周期的兩個(gè)部分代入計(jì)算。</p><p>
27、;<b> 從方程 3 </b></p><p> 半周期最小采樣數(shù)為:</p><p> 為了提高準(zhǔn)確性,在周期充電部分電壓計(jì)算從0到VCC/2,而放電部分從VCC到1/2VCC。在表中總個(gè)數(shù)是先前每半周期計(jì)算采樣數(shù)的二倍。</p><p> 查表包含軟件一個(gè)專門值。它和每次采樣計(jì)算電壓值相對(duì)應(yīng)。對(duì)每半個(gè)周期,平臺(tái)第N個(gè)值對(duì)應(yīng)t=(N
28、-1)時(shí)的電壓。是先前確定的采樣間隔。對(duì)充電半周期,通過(guò)求解方程一得到電容器開始充電起消耗時(shí)間,來(lái)求得每次采樣的電壓。對(duì)放電半周期,通過(guò)求解下列方程得到電容器開始放電起消耗時(shí)間,求得每次采樣電壓。</p><p> 放電半周期采樣對(duì)應(yīng)電壓通過(guò)在方程4中用N代替t計(jì)算。其中N表示采樣數(shù),在充電半周期中也用同一個(gè)值。方程4變成:V=5*e-N(.)</p><p> 電容器充放電周期電壓計(jì)
29、算略表如下。</p><p> 電壓在前半周期中上升,在后半周期中下降。它變化軌跡決定了表數(shù)的排列。如表所示,每半周期的采樣數(shù)大于所需中等大小值2.500v。它可以在每次半周期最后采樣前實(shí)現(xiàn)比一般中間值更快的周期。在所需分辨率0.050v。記下N=0,N=1時(shí)采樣計(jì)算電壓的差值。但是臨近采樣的電壓隨著N的遞增而下降。在一個(gè)周期中。電壓和時(shí)間表現(xiàn)非線性關(guān)系。</p><p> 表中所列計(jì)
30、算電壓沒有加入查找表。但用來(lái)確定表數(shù)。在伏特計(jì)應(yīng)用中,計(jì)算電壓在0.1伏周圍,結(jié)果儲(chǔ)存在packed-BCD式的表中,兩個(gè)數(shù)字一比特。</p><p> 例子:對(duì)應(yīng)2.523伏的表中十六進(jìn)制的25,顯示2.5v</p><p> 伏特計(jì)原件的精度是+/-1(0.1v)但即使使用精密元件,通過(guò)RC模擬-數(shù)字變換方法無(wú)法到達(dá)這個(gè)精度。不同的元件值可能造成+/-0.104伏的誤差,如下所示,
31、</p><p> 計(jì)算最壞情況下誤差VC=2.5v。首先用方程3確定與r和c一般值對(duì)應(yīng)的t</p><p> 結(jié)果顯示在2.5v處0.208v的變化。或是+/-0.104v的最壞誤差。最差的變換誤差可以通過(guò)用較小公差元件來(lái)進(jìn)一步減小。變換準(zhǔn)確性和線性受電容器特性的影響。伏特計(jì)元件中使用的電容器是聚苯乙烯薄膜,雖然準(zhǔn)確性不好,但因隔絕了吸收和其他影響而減小了誤差。</p>
32、<p> 沒有被測(cè)試的誤差源包括:比較器的局限性,充放電周期的不對(duì)稱性,電容器電壓達(dá)不到起點(diǎn)或是VCC,VCC的變化。這些因素造成的變換誤差比單獨(dú)的元件誤差值大。</p><p><b> 連續(xù)近似模數(shù)變換</b></p><p> 這種轉(zhuǎn)換方法雖然增加元件數(shù)但提高了分辨率和準(zhǔn)確性。并縮短了轉(zhuǎn)換時(shí)間。</p><p> 連續(xù)
33、近似(sa)ADCs結(jié)合一個(gè)數(shù)字模擬轉(zhuǎn)換器,一個(gè)比較器和一個(gè)連續(xù)近似電阻(SAR)當(dāng)反饋DAC 時(shí),SAR通過(guò)執(zhí)行二進(jìn)制代碼的搜索,將產(chǎn)生與電壓相配的輸出。比較器比較DAC未知電壓和輸出,并返回SAR的結(jié)果。</p><p> SAR開始搜索控制最寬輸出變化最主要的DACbit,由于DAC輸出在未知值下為零輸入SAR在最小主要位周圍移動(dòng)。</p><p> 實(shí)驗(yàn)結(jié)果為未知值對(duì)應(yīng)二進(jìn)制編
34、碼。在一個(gè)8位的轉(zhuǎn)換器中,要八次反復(fù)才能找到正確的二進(jìn)制編碼。得到相關(guān)的快速變換。</p><p> 在這個(gè)應(yīng)用中,一個(gè)帶積分模擬比較器AT89CX051微控制器執(zhí)行軟件中SAR功能。減少元件數(shù)。軟件DAC的選擇是一個(gè)MC位,低消耗的電流輸出類型。7和6比特型相對(duì)來(lái)說(shuō)適合于MC1407和MC1408-6。MC1408連續(xù)在1.992毫安下+/-1/2LSB,25度全輸出電流范圍確保準(zhǔn)確。MC1408-8的準(zhǔn)確性
35、超過(guò)0.19%,保證了八位的單一性和線性。DAC輸出設(shè)定時(shí)間為300十億分之一秒</p><p> DAC包含二進(jìn)制加權(quán),用的二進(jìn)制代碼檢測(cè)輸入電流的電流導(dǎo)引開關(guān)。 輸入電流由LM336-2. 5精密電壓參考源和一臺(tái)連續(xù)電阻器得到。 按比例繪制的當(dāng)前輸出變?yōu)橐徊僮鞣糯笃麟妷?,作為一電流?duì)電壓( I/ V)變換器。LF355B選做電流電壓變化器。 因?yàn)樽儞Q器有低的輸入補(bǔ)償電壓和高的輸出旋轉(zhuǎn)比率, 電流電壓變換器的
36、輸出被送入AT89CX051 比較器,和未知的電壓比較。 當(dāng)被編譯電壓超過(guò)未知的電壓時(shí),比較器的輸出變大,這被軟件檢測(cè)。 第2個(gè)在一個(gè)非反向運(yùn)算放大器,統(tǒng)一獲得緩沖區(qū)可能被在未知的電壓源和提供間隔的AT89CX051 比較器輸入之間插入一個(gè)統(tǒng)一緩沖區(qū)。 LM336-2.5 參考提供名義上的2.490伏特的輸出(Vref)。 實(shí)際電壓可能從2.390伏特變化到2.590伏特。在LM336-2. 5數(shù)據(jù)表里表明的方法使基準(zhǔn)電壓和溫度系數(shù)相平
37、衡。 連接DAC的14腳的當(dāng)前參考電阻器(Rref) 的額定值是1240歐姆, 產(chǎn)生一個(gè)2.490 V / 1240歐姆(Vref/Rref)= 2.008 milliamps的參考電流(Iref)。 在DACscales lref用8比特從0/</p><p> 電路不提供補(bǔ)償調(diào)整。由于LF355B運(yùn)算放大器振幅有較低偏移電壓,所以偏移電壓不需要調(diào)整。如果偏移電壓要調(diào)整, 增加補(bǔ)償在LF355B數(shù)據(jù)表內(nèi)加入了
38、電路偏移修正。隨著I/V變換器獲得電阻器值的改變,結(jié)果可能變化。 電阻器連接非反向運(yùn)算放大器的輸入應(yīng)該具有相同值以作為獲得電阻器與輸入偏移電流平衡。 1240歐電阻器連接 DAC的腳15 ,2500歐電阻器和運(yùn)算放大器腳3 連接可能相抵消,性能稍微下降。 MC1408-8DAC需要提供+5.0- 5.0的電源; 選擇±5.0伏使功耗減到最小。 LF355B運(yùn)算放大器需要提供±5. 0伏和±15伏雙極的電源。
39、為與DAC兼容選擇-0.5v為負(fù)極,也可根據(jù)需要用-15v代替。正極電源可選擇+15v,這樣可限制運(yùn)算放大器輸出的抖動(dòng),達(dá)到比較器輸出限制5v以上。</p><p> A到D變換的速度受DAC輸出設(shè)定時(shí)間,運(yùn)算放大器的旋轉(zhuǎn)速度和設(shè)定時(shí)間,比較器響應(yīng)時(shí)間和旋轉(zhuǎn)速度和執(zhí)行連續(xù)近似算法所需時(shí)間的限制。DAC輸出設(shè)定時(shí)間和比較器執(zhí)行SA算法所需的響應(yīng)時(shí)間是可以忽略的。從輸入到運(yùn)算放大器最大電壓是5 伏, 需要一微秒旋轉(zhuǎn)
40、時(shí)間和( 看LF355B數(shù)據(jù)表)4 微秒的停滯時(shí)間。 這種延遲在軟件里適用; 參考附加信息的目錄。 一臺(tái)12 MHz 處理器時(shí)鐘和一微秒指令周期的輸出結(jié)果,8 位的變換可以在被300微秒內(nèi)進(jìn)行。 未知輸入電壓在變化時(shí)必須保持不變的量。 這里提出的逐步近似法模數(shù)轉(zhuǎn)換器的明顯缺陷是需要雙極的電源和大量微控制器I/O 腳來(lái)控制DAC。 +15伏特電源可能通過(guò)一個(gè)帶單獨(dú)的電源的LF355B運(yùn)算放大器代替,單獨(dú)的電壓源為5v,作用和在標(biāo)記擺動(dòng)的輸
41、出等同。控制DAC的微控制器I/O腳的數(shù)量可以通過(guò)用7或6位的DAC代替來(lái)減少。 并行輸入DAC可被連續(xù)的DAC輸入替換(更昂貴)。 交替,邏輯交替的加入以接收微控制器的連續(xù)數(shù)據(jù)和DAC當(dāng)前并行數(shù)據(jù)。 這應(yīng)用軟件可能從Atmel的BBS 下載獲得: (408). 請(qǐng)?jiān)谠创a文件的開始時(shí)參見意見塊以獲得關(guān)于特征和</p><p><b> 附錄2 外文文獻(xiàn)</b></p>&
42、lt;p> Analog-to-Digital Conversion Utilizing the</p><p> AT89CX051 Microcontrollers</p><p> The Atmel AT89C1051 and AT89C2051.microcontrollers feature on-chip Flash,low pin count, wide ope
43、rating voltage,range and an integral analog comparator.This application note describes two low-cost analog-to-digital conversiontechniques which utilize the analog comparato r in the AT89C1051 and AT89C2051 microcontroll
44、ers.</p><p> RC Analog-to-Digital Converter</p><p> This conversion method offers. An extremely low component count at the expense of accuracy and conversion time. In the example presented bel
45、ow,resolution is better than 50 millivolts, accuracy is somewhat less than a tenth of a Volt and conversion time is seven milliseconds or less.</p><p> As shown in Figure 1, the RC analog-todigital. convers
46、ion method requires only two resistors and a capacitor in addition to the AT89CX051 microcontroller. A microcontroller output (pin 11), which swings from approximately ground to VCC, alternately charges and discharges th
47、e capacitor connected to the </p><p> non-inverting input of the internal comparator (pin 12). The microcontroller</p><p> measures the time required for the voltage on the capacitor to match
48、the unknown voltage applied to the inverting input of the internal comparator (pin 13).The unknown voltage is a function of the measured time.</p><p> The HP LED displays shown in Figure 1 are not required
49、for the conversion, but are utilized by the software to implement a simple two-digit voltmeter.The result of the analog-to-digital conversion is displayed in volts and tenths of a volt on the two displays. The voltmeter
50、application does not utilize the full resolution of the RC conversion software,but serves to demonstrate the method as well as providing a tool for debug.</p><p> The waveformfor a typical capacitor charge/
51、discharge cycle is shown in Figure2. The discharge portion of the curve is identical to the charge portion rotated about the line VC = VCC/2. The equations and discussion below apply to the charge portion of the cycle, e
52、xcept where indicated.</p><p> The voltage on the capacitoras a function of time is given by the exponential equation:</p><p> VC = VCC (1-e -t/RC) (
53、1)</p><p> where VC is the voltage on the capacitor at time t, VCC is the supply voltage and RC is the product of the values of the resistor and capacitor. Note that voltage is expressed in Volts, time in s
54、econds, resistance in Ohms and capacitance in Farads. The product RC is also known as the “time constant” of the network and affects the shape of the waveform. The waveform is steepest when capacitor charging or discharg
55、ing begins and flattens with time.</p><p> The first problem with the RC conversion method is the difficulty of solving the exponential equation without utilizing floating point calculations and transcenden
56、tal functions. On a compressed time scale, the exponential curve appears straight over much of its length, suggesting that it might be approximated by a line. This scheme fails due to the continuous variation in slope ov
57、er the length of the curve, which produces significant error. It also does not address the problemwhere the curve rol</p><p> The microcontroller need not solve the exponential equation in real time if a lo
58、okup table is used to map pre-calculated values to each sampled time interval. This scheme allows the data to be encoded and formatted as required by the application while simplifying the conversion software. Symmetries
59、in the data may be exploited to reduce the size of the table.</p><p> The second problem with the RC conversion method is the substantial error which results from variations in component values. Figure 3 sh
60、ows an exaggerated view of the variation in the voltage on the capacitor due to variations in the values of the resistor and capacitor. As shown in the figure, the variation in the voltage on the capacitor decreases as t
61、he voltage on the capacitor decreases.</p><p> The symmetry of the capacitor charge/discharge cycle can be exploited to reduce the effect of variations in component values on conversion accuracy. This is do
62、ne by utilizing the charge portion of the cycle to measure voltages less than VCC/2 and the discharge portion to measure voltages greater than VCC/2. The worst case error is reduced to the error at VCC/2.</p><
63、p> Before component values can be assigned, the time interval at which the comparator output is to be sampled must be determined. The sample interval should be as short as possible to maximize converter resolution an
64、d minimize conversion time. The sample interval is limited by the time required to execute the requisite code, which is determined by the clock rate of the microcontroller. In the voltmeter application, the microcontroll
65、er operates with a 12-MHz clock, resulting in a sample interval of </p><p> The time constant (RC) affects the shape of the capacitor charge/discharge waveform. The value of the time constant must be chosen
66、 so that the steepest parts of the waveform are resolvable to the desired resolution. The steepest part of the charge portion of the waveform occurs near the origin, while the steepest part of the discharge portion occur
67、s near VCC. Due to the symmetry of the waveform, the same time constant may be used for measurements made on either portion of the waveform.</p><p> Figure 4 shows an expanded view of the relationship betwe
68、en voltage and sample time near the origin. In the figure, ?V is the desired voltage resolution of the converter and ?t is the sample interval determined previously. The curve labeled ’VC’ represents the voltage on the c
69、apacitor,</p><p> which appears linear at this scale. In the figure, the slope of the curve is ideal, causing sampling to occur near the center of the voltage intervals. The slope of the curve may be less t
70、han shown, but may not be greater, or resolution will be lost. Note that the first sample is offset from the origin by1/2to center the sample in the first voltage interval. To obtain the minimum value of the time constan
71、t which will produce the required slope at the first sample, solve Equation 1 for RC:</p><p> RC = -t/1n(1-VC/VCC) (2)</p><p> Then set to the minim
72、um desired resolution (0.05-volt), to the sample interval determined previously (five microseconds), and calculate RC at the first sample point, where </p><p> VC = 1/2 and t = 1/2:</p><p> T
73、he product of the values of R and C must not be less than the calculated minimum time constant. Utilizing a resistor with a one percent tolerance and a capacitor with a five percent tolerance</p><p> ?。≧norm
74、-1%)(Cnorm-5%)>4.99*10-4</p><p> In the voltmeter application, the selected values of R and C are 267 kilohms and 2 nanofarads, respectively, yielding a minimum time constant of approximately 5.02?10-4.
75、An additional constraint is placed on the value of R. Referring again to Figure 1, note the 5.1 kilohm pullup resistor</p><p> connected to pin 11 of the microcontroller. This resistor is present to supplem
76、ent the microcontroller’s weak internal pullup, but has the detrimental effect of changing the time constant of the RC network during the charge portion of the capacitor charge/discharge cycle. This produces an asymmetry
77、 in the charge/discharge waveform, which contributes to conversion error. To minimize the effect of differences in the capacitor charge and discharge paths, the value of R should be chosen to be much g</p><p&g
78、t; The time constant (RC), which is a function of the desired converter resolution, determines the duration of the capacitorcharge/discharge cycle. The more time required for the capacitor to charge and discharge, the g
79、reater the number of samples required in the measurement loop and the greater the number of entries in the lookup table.</p><p> Figure 2. Typical Capacitor Charge/DIscharge Cycle</p><p> Figu
80、re 3. Capacitor Voltage Variation as a Function of RC Variation</p><p> Cto the symmetry of the capacitor charge/discharge waveform, the determined sample count may be used for measurements made during eith
81、er portion of the cycle.</p><p> From Equation 3:</p><p> tmax = -RmaxCmax?ln(1-(1/2)VCC/VCC)</p><p> = -(Rnom+1%)(Cnom+5%)ln(1/2)</p><p> = -(1.01)(267?103)(1.05)(
82、2?10-9)ln(1/2)</p><p><b> ??393 ?s.</b></p><p> The minimum number of samples for half the cycle is:</p><p> tmax/ ?t = (393?10-6)/(5?10-6) = 79</p><p>
83、 To maximize accuracy, voltages from zero to VCC/2 are measured during the charge portion of the capacitor charge/discharge cycle and voltages from VCC to VCC/2 are measured during the discharge portion of the cycle. As
84、a result, the total number of entries in the table is twice the number of samples calculated previously for each half cycle. The lookup table contains application-specific values corresponding to the calculated voltage a
85、t each sample. For each half cycle, the Nth entry in the tabl</p><p> VC = VCC?e-t/RC (4) </p>
86、<p> The size and contents of the table may vary from application to application depending on the sample interval and conversion resolution. As the resolution increases, the number of entries in the table grows.&
87、lt;/p><p> In the voltmeter application, with resolution equal to 0.05 Volt, the lookup table contains 158 entries, which is twice the number of samples per half cycle calculated above.</p><p> V
88、oltages corresponding to samples taken during the charge half cycle are calculated by replacing ’t’ with ’N ?t’ in Equation 1, where N represents the sample number (0-78). By setting ?t equal to the sample interval of 5
89、microseconds, R to 267 kilohms, C to 2 nanofarads, and VCC to 5.00-volts, Equation 1 becomes:</p><p> V = 5(1-e-N (.))</p><p> Voltages corresponding to samples taken during the discharge half
90、 cycle are calculated by replacing ’t’ with ’N ?t’ in Equation 4, where N represents the sample number (0-78). Using the same values as for the charge half cycle, Equation 4 becomes:</p><p> V = 5?e-N(.))&l
91、t;/p><p> An abbreviated list of the voltages calculated for the capacitor charge/discharge cycle is shown below. The ordering of the voltages, increasing in the first half, decreasing in the second, tracks th
92、e voltage on the capacitor and defines the ordering of the table entries.</p><p> N = 0 V= 0.000</p><p> N = 1 V= 0.047</p><p><b> . .</b></p><p><b&g
93、t; . .</b></p><p><b> . .</b></p><p> N = 74 V= 2.499</p><p> N = 75 V= 2.523</p><p> N = 76 V= 2.546</p><p> N = 77 V= 2.569</p
94、><p> N = 78 V= 2.591</p><p> N = 0 V= 5.000</p><p> N = 1 V= 4.953</p><p><b> . .</b></p><p><b> . .</b></p><p><
95、;b> . .</b></p><p> N = 74 V= 2.501</p><p> N = 75 V= 2.477</p><p> N = 76 V= 2.454</p><p> N = 77 V= 2.431</p><p> N = 78 V= 2.409</p>
96、;<p> As shown by the list, the number of samples in each half cycle is greater than required to reach the midrange value of 2.500-volts. This allows for “fast” cycles which overshoot the nominal midrange value b
97、efore the last sample is taken in each half cycle. Note that the difference between the calculated voltages at samples N=0 and N=1 is within the desired resolution of 0.050-volt, but the difference in voltage between adj
98、acent samples decreases as N increases. This reflects the non-linear relat</p><p> The calculated voltages shown in the list are not entered into the lookup table, but are used to determine the values of th
99、e table entries. In the voltmeter application, the calculated voltages are rounded to tenths of a volt and the result stored in the table in packed-BCD form, two digits per byte. Example: the table entry corresponding to
100、 2.523-volts is 25 hex, which displays as 2.5-volts.</p><p> The voltmeter prototype demonstrated accuracy of +/- one count (0.1 Volt), but accuracy of somewhat less than a tenth of a Volt is about the best
101、 that can be expected from the RC precision components, variations in component values may contribute an error of ?0.104-volt, as shown below. To calculate the worst case error at VC = 2.5-volts, first determine the corr
102、esponding t at the nominal values of R and C using Equation 3:</p><p> t = -RnomCnom?ln(1-VC/VCC)</p><p> = -RnomCnom?ln(1-2.5/5.0)</p><p> = -RnomCnom?ln(0.5).</p><p&
103、gt; Substitute for t in Equation 1 to get minimum VC:</p><p> VCmin = VCC (1-e-t/(Rmax Cmax))</p><p> = VCC (1-e(Rnom Cnom/Rmax Cmax)ln(0.5))</p><p> = 5 (1-eln(0.5)/(1.01?1.05)
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫(kù)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 基于單片機(jī)的酒精濃度測(cè)試儀的設(shè)計(jì)
- 開題報(bào)告---基于單片機(jī)的車速測(cè)試儀設(shè)計(jì)
- 基于單片機(jī)的酒精濃度測(cè)試儀的設(shè)計(jì)
- 基于單片機(jī)的酒精濃度測(cè)試儀 畢業(yè)設(shè)計(jì)
- 基于單片機(jī)的酒精測(cè)試儀的設(shè)計(jì)【畢業(yè)設(shè)計(jì)】
- 基于單片機(jī)的酒精濃度測(cè)試儀設(shè)計(jì)畢業(yè)設(shè)計(jì)
- 畢業(yè)論文(設(shè)計(jì))基于單片機(jī)酒精濃度測(cè)試儀
- 基于51單片機(jī)的酒精測(cè)試儀設(shè)計(jì)-畢業(yè)論文
- 基于51單片機(jī)的酒精測(cè)試儀設(shè)計(jì)-畢業(yè)論文
- 基于單片機(jī)的頻率特性測(cè)試儀開題報(bào)告
- 基于單片機(jī)的電容測(cè)試儀設(shè)計(jì)
- 基于單片機(jī)的酒精濃度測(cè)試儀設(shè)計(jì)畢業(yè)論文1
- 畢業(yè)論文范文——基于51單片機(jī)的酒精測(cè)試儀設(shè)計(jì)
- 基于單片機(jī)的脈搏測(cè)試儀的設(shè)計(jì)
- 基于單片機(jī)的酒精濃度檢測(cè)儀設(shè)計(jì)開題報(bào)告
- 基于單片機(jī)的交警用酒精測(cè)試儀設(shè)計(jì)和制作畢業(yè)論文
- 基于單片機(jī)的電容測(cè)試儀論文
- 基于單片機(jī)酒精濃度檢測(cè)儀的開題報(bào)告
- 基于單片機(jī)的交警用酒精測(cè)試儀設(shè)計(jì)和制作畢業(yè)論文
- 開題報(bào)告 ---基于at89s52單片機(jī)的綜合測(cè)試儀
評(píng)論
0/150
提交評(píng)論