【正文】
明 19 軟件程序設(shè)計(jì) 20 主程序模塊流程圖 21 DS18B20測(cè)溫程序及流程圖 22 按鍵掃描程序及流程圖 25 26 Keil uVision2軟件 26 27第5章 結(jié)論 28參 考 文 獻(xiàn) 29致 謝 31附錄1 系統(tǒng)硬件電路圖 32附錄2 系統(tǒng)軟件程序 33II 沈陽(yáng)工業(yè)大學(xué)本科生畢業(yè)設(shè)計(jì)(論文)第1章 緒論 課題研究目的利用單片機(jī)設(shè)計(jì)一個(gè)具有制冷和制熱兩種工作模式的空調(diào)溫度控制器。 single chip microputer。s living standard, the air conditioner has been widely applied. Temperature controller of air conditioner is mainly posed of sensors to monitor indoor temperature, the temperature signal processing the collected with the set temperature value, to control the onoff relay, the temperature is controlled in the set value, the air conditioner working condition with people demand and the state of the environment changes rapidly and automatically, accurate to the requirements of the people, and make the air conditioner working state is maintained in a reasonable state. In the industrial and agricultural production, scientific research and in people39。針對(duì)測(cè)溫系統(tǒng)溫度采集、接收、處理、顯示部分的總體設(shè)計(jì)方案進(jìn)行了論證,進(jìn)一步介紹了單片機(jī)在系統(tǒng)中的應(yīng)用,分析了系統(tǒng)各部分的硬件及軟件實(shí)現(xiàn)。在此基礎(chǔ)上描述了系統(tǒng)研制的理論基礎(chǔ),對(duì)測(cè)溫系統(tǒng)的一些主要參數(shù)進(jìn)行了討論。在本系統(tǒng)中,主要是同過(guò)DS18B20采集被測(cè)溫度并轉(zhuǎn)換成數(shù)字信號(hào)送單片機(jī),以單片機(jī)為核心數(shù)據(jù)處理系統(tǒng),通過(guò)兩位數(shù)碼管,顯示設(shè)定溫度,通過(guò)繼電器來(lái)控制壓縮機(jī)、四通閥從而控制空調(diào)制冷或制熱。本文主要從硬件和軟件兩方面介紹了單片機(jī)溫度控制系統(tǒng)的設(shè)計(jì)。因此,溫度傳感器的應(yīng)用數(shù)量居各種傳感器之首??照{(diào)機(jī)的溫度控制器主要是由溫度傳感器感受室內(nèi)溫度變化,將采集到的溫度信號(hào)處理后與設(shè)定的溫度值進(jìn)行比較,控制繼電器的通斷,使溫度被控制在設(shè)定值左右,使空調(diào)器的工作狀態(tài)隨著人們要求和環(huán)境狀態(tài)而自動(dòng)變化,迅速準(zhǔn)確的達(dá)到人們的要求,并使空調(diào)器的工作狀態(tài)保持在最合理的狀態(tài)下。密級(jí):公開(kāi) 基于單片機(jī)的空調(diào)溫度控制器設(shè)計(jì)The design of air conditioning temperature controller based on MCU學(xué) 院:信息科學(xué)與工程專 業(yè) 班 級(jí):測(cè)控技術(shù)與儀器1003班學(xué) 號(hào):100401316學(xué) 生 姓 名:劉 和 平指 導(dǎo) 教 師:顏 華 (教授)2014 年 6 月I 摘 要隨著經(jīng)濟(jì)的發(fā)展和人們生活水平的提高,空調(diào)機(jī)受到了廣泛的應(yīng)用。在工農(nóng)業(yè)生產(chǎn)、科學(xué)研究和在人們的生活領(lǐng)域中,溫度測(cè)控系統(tǒng)占有很重要的地位,得到了廣泛的應(yīng)用。目前,溫度傳感器正從模擬式向數(shù)字集成式方向飛速發(fā)展。該系統(tǒng)以STC12C5608AD單片機(jī)為核心,主要由溫度檢測(cè)電路、按鍵與顯示電路、繼電器控制電路等構(gòu)成。本論文概述了溫控器的發(fā)展及基本原理,介紹了溫度傳感器的原理及特性,分析了DS18B20溫度傳感器的優(yōu)劣。同時(shí)在介紹溫度控制系統(tǒng)功能的基礎(chǔ)上,提出了系統(tǒng)的總體構(gòu)成。關(guān)鍵詞:DS18B20;單片機(jī);溫度控制;空調(diào)AbstractWith the development of economy and the improvement of people39。s lives, temperature measurement and control system plays a very important role, has been widely applied. Therefore, the number of temperature sensor applications of various sensors of the first home. At present, the temperature sensor from analog to digital integrated development.This paper mainly describes the hardware and software aspects of the design of singlechip temperature control system. The system STC12C5608AD microcontroller core, mainly by the temperature detection circuit, buttons and display circuit, relay control circuit, etc.. In this system, mainly through the DS18B20 collection with the measured temperature and converted into a digital signal sent to the microcontroller, microcontroller as the core data processing system, through two digital tube display set temperature, the pressor is controlled by relays, Stone valve to control the air conditioning, refrigeration or heating. This paper outlines the development and the basic principles of the thermostat, introduced the principle and characteristics of the temperature sensor. Analysis of the merits of the DS18B20 temperature sensor. Based on this description of the theoretical basis for the development of the system, some of the key parameters of the measurement system were discussed. While the introduction of a temperature control system functions is proposed based on the overall structure of the system. Temperature measurement system for collecting, receiving, processing, display part of the overall design has been demonstrated, further describes the SCM applications in the system, and analyzes the various parts of the system hardware and software.Keywords: DS18B20。 temperature control。該控制器能夠?qū)崟r(shí)檢測(cè)并顯示室溫,能利用鍵盤設(shè)定溫度、風(fēng)速和工作模式,并根據(jù)設(shè)定的溫度、當(dāng)前溫度和工作模式,使壓縮機(jī)處于制熱、制冷或暫停工作狀態(tài)。溫度控制器屬于信息技術(shù)的前沿尖端產(chǎn)品,尤其是溫度控制器被廣泛用于工農(nóng)業(yè)生產(chǎn)、科學(xué)研究和生活等領(lǐng)域,數(shù)量日漸上升。隨著電子技術(shù)和微型計(jì)算機(jī)的迅速發(fā)展,微機(jī)測(cè)量和控制技術(shù)得到迅速發(fā)展和廣泛運(yùn)用??照{(diào)也就是空氣調(diào)節(jié)器,是一種用于給空間區(qū)域提供處理空氣的機(jī)組。它使得人們的生活環(huán)境更加舒適,也滿足了工藝加工過(guò)程對(duì)精度的要求。目前空調(diào)機(jī)已經(jīng)廣泛地應(yīng)用于生產(chǎn)、生活中。單片機(jī)具有集成度高、通用性好、功能強(qiáng),特別是體積小,重量輕,功耗低,可靠性高,抗干擾能力強(qiáng)和使用方便等特點(diǎn)[2]?;趩纹瑱C(jī)的空調(diào)溫度控制系統(tǒng),控制簡(jiǎn)單方便,測(cè)量范圍更廣,精度更高,提高了智能化的程度,增加了功能,備受人們喜歡[3]。眾所周知,空調(diào)正朝著節(jié)能、舒適、靜噪于一體的方向發(fā)展。通過(guò)巧妙的設(shè)計(jì)和安裝可實(shí)現(xiàn)美觀典雅和舒適衛(wèi)生的和諧統(tǒng)一,是國(guó)際和國(guó)內(nèi)的發(fā)展潮流。其應(yīng)用的范圍將極為廣闊,極大地方便了人們的工作和生活,可以說(shuō)節(jié)能空調(diào)將是未來(lái)一種新的發(fā)展趨勢(shì)。在很多場(chǎng)合都需要對(duì)溫度進(jìn)行測(cè)控,而溫度測(cè)控離不開(kāi)溫度傳感器,因此,掌握正確的測(cè)溫方法及溫度傳感器的使用方法極為重要。據(jù)此,可以選擇某種溫度傳感器與被測(cè)物體接觸進(jìn)行溫度測(cè)量,這種方法稱為接觸式測(cè)溫。此外,物體受熱后溫度升高的同時(shí)還伴有熱輻射,因此,可利用溫度傳感器接收被測(cè)物體在不同溫度下輻射能量的不同來(lái)測(cè)量溫度,這種測(cè)溫方法稱為非接觸式測(cè)溫。 溫度傳感器產(chǎn)品分類目前,溫度傳感器沒(méi)有統(tǒng)一分類方法。按測(cè)溫方式分類有接觸式溫度傳感器和非接觸式溫度傳感器。模擬式溫度傳感器輸出的是隨溫度變化的模擬量信號(hào)。數(shù)字式溫度傳感器輸出的是隨溫度變化的數(shù)字量,同模擬輸出相比,它輸出響應(yīng)較慢,但容易與MPU接口。(1)熱敏電阻式溫度傳感器 電阻式溫度傳感器分為熱電阻式溫度傳感器和熱敏電阻溫度傳感器,他們的特點(diǎn)是自身的電阻值隨溫度而變化。其優(yōu)點(diǎn)是靈敏度高,體積小,壽命長(zhǎng),工作穩(wěn)定,易于實(shí)現(xiàn)遠(yuǎn)距離;缺點(diǎn)是互換性差,非線性嚴(yán)重; (2)熱電阻式溫度傳感器利用熱電阻溫度系數(shù)隨溫度變化的特性而制成的溫度傳感器。對(duì)于大多數(shù)金屬導(dǎo)體,其電阻值都具有隨溫度升高而增大的特性。常用的金屬導(dǎo)體材料有鉑、銅、鐵和鎳;(3)熱電偶式溫度傳感器熱電偶是一種傳統(tǒng)的溫度傳感器,其測(cè)溫范圍一般為50到+1600℃,最高可達(dá)+2800℃,并且有較高的測(cè)量精度。它的理論基礎(chǔ)是建立在熱電效應(yīng)上,將熱能轉(zhuǎn)化為電能。模擬集成溫度傳感器是在20世紀(jì)80年代問(wèn)世的。模擬集成溫度傳感器的主要特點(diǎn)是功能單一(僅測(cè)量溫度)、測(cè)溫誤差小、價(jià)格低、響應(yīng)速度快、傳輸距離遠(yuǎn)、體積小、微功耗,適合遠(yuǎn)距離測(cè)溫、控溫,不需要進(jìn)行非線性校準(zhǔn)。(5)智能溫度傳感器 智能溫度傳感器(亦稱數(shù)字溫度傳感器)是在20世紀(jì)90年代中期問(wèn)世的。目前,許多著名的集成電路生產(chǎn)商已開(kāi)發(fā)出上百種智能溫度傳感器產(chǎn)品【5】。智能溫度傳感器內(nèi)部都包含溫度傳感器、A/D傳