【正文】
復(fù)雜,成本較高。而且隨著科學(xué)技術(shù)和生產(chǎn)的不斷發(fā)展,溫度傳感器的種類還是在不斷增加豐富來滿足生產(chǎn)生活中的需要。在農(nóng)業(yè)中,用于保證蔬菜大棚的恒溫保產(chǎn)等 。 而系統(tǒng)的過程則是:首先 ,通過設(shè)置按鍵 ,設(shè)定恒溫運(yùn)行時(shí)的溫度值,并且用數(shù)碼管顯示這個溫度值 .然后 ,在運(yùn)行過程中將采樣的溫度模擬量送入 A/D轉(zhuǎn)換器中進(jìn)行模擬 數(shù)字轉(zhuǎn)換,再將轉(zhuǎn)換后的數(shù)字量用數(shù)碼管進(jìn)行顯示,最后用單片機(jī)來控制加熱器 ,進(jìn)行加熱或停止加熱,直到能在規(guī)定的溫度下恒溫加熱。在實(shí)時(shí)檢測和自動控制的單片機(jī)應(yīng)用系統(tǒng)中,單片機(jī)往往是作為一個核心部件來使用,僅單片機(jī)方面知識是不夠的,還應(yīng)根據(jù)具體硬件結(jié)構(gòu),以及具體應(yīng)用對象特點(diǎn)的軟件結(jié)合,以作完善。 本文從硬件和軟件兩方面來講述 室 溫自動控制過程 ,在控制過程中主要應(yīng)用 AT89C5 LED 顯示器,而主要是通過 DS18B20 數(shù)字溫度傳感器采集環(huán)境溫度,以單片機(jī)為核心控制部件,并通過四位數(shù)碼管顯示實(shí)時(shí)溫度的一種數(shù)字溫度計(jì)。 關(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.外文 資料譯文 ................................................. 54 第 1章 緒 論 1 第 1 章 緒 論 課題的背景及其意義 二十一世紀(jì)是科技高速發(fā)展的信息時(shí)代,電子技術(shù)、微型單片機(jī)技術(shù)的應(yīng)用更是空前廣泛, 伴隨著科學(xué)技術(shù)和生產(chǎn)的不斷發(fā)展,需要對各種參數(shù)進(jìn)行溫度測量。 溫度是表征物體冷熱程度的物理量,溫度測量則是工農(nóng)業(yè)生產(chǎn)過程中一個很重要而普遍的參數(shù)。 在單片機(jī)溫度測量系統(tǒng)中的關(guān)鍵是測量溫度、控制溫度和保持溫度,溫度測量是工業(yè)對象中主要的被控參數(shù)之一。 第 1章 緒 論 2 課題研究的內(nèi)容及要求 我本次的畢業(yè)設(shè)計(jì)的題目是單片機(jī) 水 溫控制系統(tǒng)設(shè)計(jì)。其中,有部分應(yīng)用場合對精度提高的幅度要求也不是特別高。而爐內(nèi)溫度控制部分,采用一套 PID 閉環(huán)負(fù)反饋控制系統(tǒng),由 DS18S20 檢測爐內(nèi)溫度,用中值濾波的方法取一個值存入程序存取器內(nèi)部一個單元作為最后檢測信號,并在 LED 中顯示。同時(shí) DS18S20 能提供九位溫度讀數(shù),它無需任何外圍硬件即可方便地構(gòu)成溫度檢測系統(tǒng)。 ( 2)能夠設(shè)定水的溫度值,設(shè)定范圍是 30℃ ~ 90℃ 。溫度是工業(yè)生產(chǎn)過程中重要的被控參數(shù)之一,當(dāng)今計(jì)算機(jī)控制技術(shù)在這方面的應(yīng)用,已使溫度控制系統(tǒng)達(dá)到自動化、智能化,比過去單純采用電子線路進(jìn)行 PID 調(diào)節(jié)的控制效果要好得多,可控性方面也有了很大的提高 。系統(tǒng)受環(huán)境影響大,不能實(shí)現(xiàn)復(fù)雜的控制算法,不能用數(shù)碼管顯示,不能用鍵盤