【正文】
摘 要 近年來(lái)單片機(jī)發(fā)展十分迅速,單片機(jī)的應(yīng)用已經(jīng)滲透到各個(gè)行業(yè)。而溫度的測(cè)量及控制變得越來(lái)越重要,溫度的控制在各個(gè)領(lǐng)域都有積極的意義。傳統(tǒng)的溫度采集方法不僅費(fèi)時(shí)費(fèi)力,而且精度差,單片機(jī)的出現(xiàn)使得溫度的采集和數(shù)據(jù)處理問(wèn)題能夠得到很好的解決。所以采用單片機(jī)對(duì)溫度進(jìn)行控制不僅具有控制方便、簡(jiǎn)單、靈活性大等特點(diǎn),而且還可以大幅度提高被控溫度的技術(shù)指標(biāo),從而能夠大大提高產(chǎn)品的質(zhì)量。 本設(shè)計(jì)是基于 AT89C51 單片機(jī)的恒溫箱控制系統(tǒng),系統(tǒng)分為硬件和軟件兩部分,其中硬件包括:溫度傳感器、顯示、控制和報(bào)警的設(shè)計(jì);軟件包 括:顯示程序設(shè)計(jì)、控制程序設(shè)計(jì)和溫度報(bào)警程序設(shè)計(jì)。編寫(xiě)程序結(jié)合硬件進(jìn)行調(diào)試,能夠?qū)崿F(xiàn)設(shè)置和調(diào)節(jié)初始溫度值,進(jìn)行顯示屏顯示,當(dāng)加熱到設(shè)定值后立刻報(bào)警。 本設(shè)計(jì)從實(shí)際應(yīng)用出發(fā)選取了體積小、精度相對(duì)高的數(shù)字式溫度傳感元件 DS18B20 作為溫度采集器,單片機(jī) AT89C51 作為主控芯片, LCD1602 作為顯示輸出, 并且其中包含了 PID 算法, 實(shí)現(xiàn)了對(duì)溫度的實(shí)時(shí)測(cè)量與恒定控制。 關(guān)鍵詞 : 單片機(jī);恒溫;控制;報(bào)警; PID Abstract In recent years, microcontroller is developed very rapid,microcontroller applications have perated into various the measurement and control of temperature bees more and more important, the temperature control has a positive significance in various traditional method of temperature acquisition is not only timeconsuming and laborious, but poor accuracy,the emergence of microcontroller makes the problem of data acquisition and processing temperature can get very good using microcontroller to control temperature is not only easy to control, simple, flexibility and other characteristics, but also can greatly improve the temperature which was charged with technical indicators, which can greatly improve the quality of the product. Thermostatic control play a decisive role in the process of industrial production, temperature control directly affects the yield and quality of industrial design is the constant temperature box control system based on AT89C51 microcontroller, the system is divided into two parts of hardware and software,the hardware includes:temperature sensor,display,control and alarm design。software includes:a display program design, programdesign and temperature alarm program design. Write a program bining hardware debugging,can realize the setting and adjusting the initial temperature, for display, alarm immediately when heated to the set design from practical application selected small,relatively high accuracy digital temperature sensor DS18B20 as the temperature logger,AT89C51 microcontroller as the master chip, LCD1602 as display output,and also contains the PID algorithm,realize the realtime measurement of temperature and constant control. Keywords: microcontroller; thermostat; control; alarm; PID I 目 錄 第 1 章 緒論 ..................................................................................................................... 1 課題背景 ............................................................................................................. 1 課題意義 ............................................................................................................. 1 課題內(nèi)容 ............................................................................................................. 2 恒溫箱的發(fā)展與趨勢(shì) ......................................................................................... 2 本文結(jié)構(gòu)安排 ..................................................................................................... 3 第 2 章 系統(tǒng)概述 ............................................................................................................. 4 設(shè)計(jì)思路分析 ..................................................................................................... 4 系統(tǒng)需求分析 ..................................................................................................... 4 方案選擇 ............................................................................................................. 5 恒溫箱的工作過(guò)程 ............................................................................................. 6 本章小結(jié) ............................................................................................................. 6 第 3 章 系統(tǒng)硬件設(shè)計(jì) .................................................................................................... 7 硬件電路設(shè)計(jì)概述 ............................................................................................. 7 系統(tǒng)功能介紹 ..................................................................................................... 8 時(shí)鐘頻率電路設(shè)計(jì) ............................................................................................. 8 顯示電路的設(shè)計(jì) ................................................................................................. 9 開(kāi)關(guān)鍵盤設(shè)計(jì) ....................................................................................................11 溫度報(bào)警電路設(shè)計(jì) ........................................................................................... 12 溫度采集電路 ................................................................................................... 13 本章小結(jié) ........................................................................................................... 19 第 4 章 系統(tǒng)軟件設(shè)計(jì) .................................................................................................. 20 軟件任務(wù)分析 ................................................................................................... 20 程序流程圖 ....................................................................................................... 20 II 系統(tǒng)控制算法 ................................................................................................... 24 參數(shù)整定 ........................................................................................................... 26 本章小結(jié) ........................................................................................................... 27 結(jié) 論 ............................................................................................................................... 28 參考文獻(xiàn) ......................................................................................................................... 29 致 謝 ............................................................................................................................... 30 附 錄 .......................................................