【正文】
的圖 此方案是傳統(tǒng)的一位式模擬控制方案,選用模擬電路,用電位器設(shè)定值,反饋的溫度值和設(shè)定值比較后,決定加熱或不加熱。溫度是工業(yè)生產(chǎn)過(guò)程中重要的被控參 數(shù)之一 , 當(dāng)今計(jì)算機(jī)控制技術(shù)在這方面的應(yīng)用 , 已使溫度控制系統(tǒng)達(dá)到自動(dòng)化、智能化 , 比過(guò)去單純采用電子線路進(jìn)行 PID 調(diào)節(jié)的控制效果要好得多 ,可控性方面也有了很大的提高 。 ( 4) 用單片機(jī) AT89C51 控制,通過(guò)按鍵來(lái)控制水溫的設(shè)定值,數(shù)值采用數(shù)碼管顯示。 ( 2) 能夠設(shè)定水的溫度值,設(shè)定范圍是 30℃ ~ 90℃ 。而且還要 以單片機(jī)為主機(jī),使溫度傳感器通過(guò)一根口線與 單片機(jī)相連接,再加上溫度控制部分和人機(jī)對(duì)話部分來(lái)共同實(shí)現(xiàn)溫度的監(jiān)測(cè)與控制 。同時(shí) DS18S20 能提供九位溫度讀數(shù),它無(wú)需任何外圍硬件即可方便地構(gòu)成溫度檢測(cè)系統(tǒng)。它具有微型化、低功耗、高性能、抗干擾能力強(qiáng)、易配微處理器等優(yōu)點(diǎn),特別適合于構(gòu)成多點(diǎn)的溫度測(cè)控系統(tǒng),可直接將溫度轉(zhuǎn)化成串行數(shù)字信號(hào)供微機(jī)處理,而且每片 DS18S20 都有唯一的產(chǎn)品號(hào),可以一并 存入其 ROM 中,以便在構(gòu)成大型溫度測(cè)控系統(tǒng)時(shí)在單線上掛接任意多個(gè) DS18S20 芯片。而爐內(nèi)溫度控制部分,采用一套 PID 閉環(huán)負(fù)反饋控制系統(tǒng),由 DS18S20 檢測(cè)爐內(nèi)溫度,用中值濾波的方法取一個(gè)值存入程序存取器內(nèi)部一個(gè)單元作為最后檢測(cè)信號(hào),并在 LED 中顯示。 1. 課題的主要研究的內(nèi)容 本 文所要研究的課題是基于單片機(jī)控制的 水 溫 控制系統(tǒng)的設(shè)計(jì),主要是介紹了對(duì)水箱 溫度的顯示、 控制及報(bào)警,實(shí)現(xiàn)了溫度的實(shí)時(shí)顯示及控制。其中,有部分應(yīng) 用場(chǎng)合對(duì)精度提高的幅度要求也不是特別高。電路板的設(shè)計(jì)技術(shù)和機(jī)械加工工藝的巧妙結(jié)合,使其具備了顯示直觀、體積做工精細(xì)等特點(diǎn),能為它在其它領(lǐng)域的廣泛應(yīng)用打下良好的基礎(chǔ)。 第 1章 緒 論 2 課題研究的內(nèi)容及要求 我本次的畢業(yè)設(shè)計(jì)的題目是單片機(jī) 水 溫 控制 系統(tǒng)設(shè)計(jì)。在日常生活中,也可廣泛實(shí)用于地?zé)?、空調(diào)器、電加熱器等各種家庭室溫測(cè)量及工業(yè)設(shè)備溫度測(cè)量場(chǎng)合。 在單片機(jī)溫度測(cè)量系統(tǒng)中的關(guān)鍵是測(cè)量溫度、控制溫度和保持溫度,溫度測(cè)量是工業(yè)對(duì)象中主要的被控參數(shù)之一。 由于溫度測(cè)量的普遍性,溫度傳感器的數(shù)量在各種傳感器中居首位 。 溫度是表征物體冷熱程度的物理量,溫度測(cè)量則是工農(nóng)業(yè)生產(chǎn)過(guò)程中一個(gè)很重要而普遍的參數(shù)。如在日趨發(fā)達(dá)的工業(yè)之中,利用測(cè)量與控制溫度來(lái)保證生產(chǎn)的正常運(yùn)行。 關(guān)鍵詞 : 單片機(jī)系統(tǒng) ; 傳感 器 ; 數(shù)據(jù)采集 ; 模數(shù)轉(zhuǎn)換器 ; 溫度 英文摘要 II Abstract In recent years, with the puter peration in the social field, the application of SCM is to keep at the same time, traditional control testing update on Crescent benefits. In realtime detection and automatic control system of singlechip applications, often as a singlechip core ponent to use only singlechip is not enough knowledge, but also the specific hardware structure and the specific features of application software objects bine to make perfect. In this paper, both hardware and software for automatic control of water temperature on the process, in the control of the main application of the process of AT89C51, ADC0809, LED display, LM324 parator, but mainly through the digital temperature sensor DS18B20 collecting ambient temperature to singlechip microputer as the core control ponents, and through four realtime digital display of a digital thermometer temperature. Software using assembly language for programming, so that the implementation of Directive speed, to save storage space. In order to facilitate the expansion and changes to the design of modular software structure, so that the logic of the relationship between program design more concise,Hardware software cooperation under the control of it. And systematic process is: First of all, by setting the button, set the thermostat temperature at the time of operation, and digital display of the temperature. Then, in the running temperature of the process of sampling analog into the A / D converter in the simulation digital converter, and then converted digital control with digital display, the last singlechip microputer to control the heater used for heating or stop heating until the temperature in the provisions under the constant temperature heating. Key words: Singlechip microputer system ; Sensor; Data Acquisition;ADC; Temperature 目錄 i 目 錄 第 1 章 緒 論 ................................................... 1 課題的背景及其意義 ............................................ 1 課題研究的內(nèi)容及要求 .......................................... 2 課題的研究方案 ................................................ 3 第 2 章 設(shè)計(jì)理論基礎(chǔ) ........................................... 6 單片機(jī)的發(fā)展概況 .............................................. 6 AT89C51 系列單片機(jī)介紹 ........................................ 7 AT89C51 系列基本組成及特性 .............................. 7 AT89C51 系列引腳功能 .................................... 8 AT89C51 系列單片機(jī)的功能單元 ........................... 11 ADC0809 模數(shù)轉(zhuǎn)換器 ........................................... 14 運(yùn)算放大器 LM324 ............................................. 16 移位寄存器 74LS164 ........................................... 18 數(shù)碼顯示管 LED ............................................... 19 數(shù)字溫度計(jì) DS18S20 ........................................... 20 第 3 章 硬件電路設(shè)計(jì) .......................................... 21 單片機(jī)控制單元 ............................................... 21 溫度采樣部分 ................................................. 21 模數(shù)轉(zhuǎn)換部分 ................................................. 23 模數(shù)轉(zhuǎn)換技術(shù) ........................................... 23 積分型模數(shù)轉(zhuǎn)換器 ....................................... 24 顯示部分 ..................................................... 24 調(diào)節(jié)執(zhí)行單元 ................................................. 25 第 4 章 軟件設(shè)計(jì) ................................... 26 目錄 ii 主程序流程圖 ................................................. 26 中斷子程序流程圖 ............................................. 27 按鍵流程圖 ................................................... 28 顯示流程圖 ................................................... 29 第 5 章 系統(tǒng)調(diào)試及結(jié)論分析 ................................... 30 硬件調(diào)試 ..................................................... 30 硬件電路故障及解 決方法 ................................. 30 硬件調(diào)試方法 ........................................... 31 軟件調(diào)試 ..................................................... 31 軟件電路故障及解決方法 ................................. 31 軟件調(diào)試方法 ........................................... 32 結(jié)論分析 ..................................................... 33 第 6 章 總結(jié)與展望 ............................................. 34 總結(jié) ......................................................... 34 展望 ......................................................... 35 參考文獻(xiàn) ........................................................ 36 致 謝 ........................................................... 37 附 錄 ........................................................... 40 1.系統(tǒng)總程序清單 ............................................... 40 2.系統(tǒng)的原理圖 ................................................. 49 3.外文資料原文 ................................................. 50 4.外文資料譯文 ..........................................