【文章內(nèi)容簡(jiǎn)介】
時(shí)間 4ms 左右,數(shù)據(jù)既有整數(shù)部分也有小數(shù)部分。(4)電氣特性:通常情況下 VDD=5V,除非特別注明。如圖 35 所示。北方民族大學(xué)學(xué)士學(xué)位論文第 9 頁(yè) 共 37 頁(yè)表 35 DHT11 的電氣特性參數(shù) 條件 Min typ max 單位供電 DC 3 5 V測(cè)量 mA平均 1 mA供電電流待機(jī) 100 150 uA采樣周期 秒 1 次注:采樣周期間隔不得低于 1 秒鐘。 DHT11 傳感器模塊電路系統(tǒng)設(shè)計(jì) DHT11 傳感器和 AT89C52 單片機(jī)連接十分簡(jiǎn)單,只用加上 5K 的上拉電阻即可。利用 AT89C52 單片機(jī)的 口與 DHT11 傳感器數(shù)據(jù)口 P2 相連用來(lái)發(fā)收串行數(shù)據(jù)。同時(shí)傳感器的電源端口 P1 和 P4 分別接單片機(jī)的 VDD 和 GND 端。傳感器的第三腳懸浮放置。DHT11 傳感器原件的電路原理圖如圖 36 所示: 圖 36 DHT11 電路原理圖 1602 液晶顯示模塊系統(tǒng)設(shè)計(jì) 1602 液晶顯示屏簡(jiǎn)介 LCD1602 能夠同時(shí)顯示 32 個(gè)字符(16 列 2 行) ?;?51 單片機(jī)溫濕度采集控制系統(tǒng)第 10 頁(yè) 共 37 頁(yè)一般 1602 字符型液晶顯示器實(shí)物如圖 37 和 38 所示:圖 37 液晶屏正面圖 38 液晶屏背面(1)1602LCD 的 RAM 地址映射以及標(biāo)準(zhǔn)字庫(kù)表LCD1602 液晶模塊里面的字符發(fā)生存儲(chǔ)器已經(jīng)存儲(chǔ)了 160 個(gè)不同的字符圖,但是沒(méi)有漢字,12864 液晶模塊可以顯示漢字。我們是通過(guò)指令編程來(lái)實(shí)現(xiàn)LCD1602 的讀寫操作、屏幕和光標(biāo)的操作等操作的(1 為高電平,0 為低電平) 。1602 內(nèi)部顯示地址如圖 39 所示: 圖 39 1602 內(nèi)部顯示地址北方民族大學(xué)學(xué)士學(xué)位論文第 11 頁(yè) 共 37 頁(yè) 1602 液晶顯示模塊電路原理圖圖 310 1602 顯示模塊 報(bào)警模塊 二極管工作原理圖 311 二極管工作原理圖在對(duì)我們所要系統(tǒng)設(shè)計(jì)的課題有了整體的了解之后,需要先建立程序框架的流程圖,對(duì)整個(gè)系統(tǒng)設(shè)計(jì)劃分模塊,逐個(gè)模塊實(shí)現(xiàn)其功能,最終把各個(gè)子模塊合理的連接起來(lái),構(gòu)成總的程序。主程序首先要對(duì)整個(gè)系統(tǒng)進(jìn)行初始化,然后將采集到的溫濕度指令傳給系統(tǒng)的主流程圖如圖 312 所示(以溫度為例):基于 51 單片機(jī)溫濕度采集控制系統(tǒng)第 12 頁(yè) 共 37 頁(yè) 開始初始化延時(shí)溫濕度測(cè)量1602 顯示數(shù)據(jù)判斷溫度溫度低于 26℃ 高于 30℃二極管閃爍 二極管閃爍結(jié)束圖 312 主程序流程圖北方民族大學(xué)學(xué)士學(xué)位論文第 13 頁(yè) 共 37 頁(yè)第 4 章系統(tǒng)軟件系統(tǒng)設(shè)計(jì) LCD1602 液晶顯示模塊系統(tǒng)設(shè)計(jì)LCD1602 液晶顯示模塊可與 AT89C52 直接接口的。軟件流程圖如圖 313 所示:開始LCD 初始化延時(shí)設(shè)第一行顯示位置顯示第一行內(nèi)容設(shè)第二行顯示位置顯示第二行內(nèi)容基于 51 單片機(jī)溫濕度采集控制系統(tǒng)第 14 頁(yè) 共 37 頁(yè)圖 41 1602 液晶顯示模塊程序流程圖 傳感器模塊系統(tǒng)設(shè)計(jì)DHT11 傳感器使系統(tǒng)設(shè)計(jì)更加省時(shí)省力。DHT11 傳感器模塊的軟件流程圖如下圖 314 所示給 DHT11 上電延時(shí)保持高電平檢測(cè)記錄信號(hào)輸出低電平延時(shí)輸出低電平數(shù)據(jù)輸出結(jié)束信號(hào)圖 42 DHT11 傳感器模塊程序流程圖北方民族大學(xué)學(xué)士學(xué)位論文第 15 頁(yè) 共 37 頁(yè)第 5 章 系統(tǒng)分析與調(diào)試本系統(tǒng)設(shè)計(jì)是在 Keil C 環(huán)境下開發(fā)的,Keil C 軟件支持 C 語(yǔ)言的編程及調(diào)試,運(yùn)用方便,是做 C 語(yǔ)言畢業(yè)系統(tǒng)設(shè)計(jì)者的首選。Keil C 程序運(yùn)行如圖 51,52 所示圖 51 keil C 運(yùn)行圖基于 51 單片機(jī)溫濕度采集控制系統(tǒng)第 16 頁(yè) 共 37 頁(yè)圖 52 程序燒錄運(yùn)行圖在完成對(duì)程序的調(diào)試及燒錄之后,還需要對(duì)其進(jìn)行演示,把開發(fā)板與電腦連上,設(shè)置好對(duì)應(yīng)的接口,完成供電及下載。開始供電后、稍等幾秒后LCD1602 液晶屏能正常顯示當(dāng)前溫濕度了之后,觀察當(dāng)前溫濕度的變化。我們可以用手捂住 DHT11 傳感器,令其溫度的顯示超標(biāo),測(cè)試能否達(dá)到報(bào)警。經(jīng)過(guò)測(cè)試,本系統(tǒng)設(shè)計(jì)完全可行,進(jìn)而實(shí)現(xiàn)了對(duì)溫度的簡(jiǎn)單控制。當(dāng)然濕度控制原理跟溫度一樣。北方民族大學(xué)學(xué)士學(xué)位論文第 17 頁(yè) 共 37 頁(yè)第 6 章 結(jié)論與展望本系統(tǒng)以 AT89C52 單片機(jī)為核心部件的控制系統(tǒng),利用軟件編程,最終基本上實(shí)現(xiàn)了各項(xiàng)要求。雖然本系統(tǒng)設(shè)計(jì)還存在某些不足,比如溫濕度測(cè)量不夠精確。不過(guò)本系統(tǒng)大體能反映出系統(tǒng)設(shè)計(jì)的目的和要求,與預(yù)期的結(jié)果相差不多。經(jīng)過(guò)幾個(gè)月的奮斗,從確定題目,到后來(lái)查找資料,理論學(xué)習(xí),實(shí)驗(yàn)編程調(diào)試,這一切都使我的理論知識(shí)和動(dòng)手能力有了很大的提高。學(xué)會(huì)了對(duì)一項(xiàng)設(shè)計(jì)如何系統(tǒng)設(shè)計(jì):首先,要分析需要系統(tǒng)設(shè)計(jì)的系統(tǒng)要實(shí)現(xiàn)什么功能,需要什么器件;然后,針對(duì)系統(tǒng)設(shè)計(jì)購(gòu)買相應(yīng)的硬件,選用硬件時(shí)不僅要選用經(jīng)濟(jì)的,更重要的是如何能更精確更方便的完成系統(tǒng)的要求;再次,對(duì)各個(gè)硬件的軟件實(shí)現(xiàn)要弄清楚,如何更好的實(shí)現(xiàn)各個(gè)硬件的協(xié)調(diào),更好的通過(guò)主控制器件實(shí)現(xiàn)硬件的功能。最后,通過(guò)各種測(cè)試與調(diào)試,讓系統(tǒng)設(shè)計(jì)更好的完成系統(tǒng)要求。 但此系統(tǒng)設(shè)計(jì)中也存在一定的不足,就比如說(shuō)對(duì)濕度的控制方面,由于溫度時(shí)刻都在發(fā)生著變化。而濕度的變化又大體上取決于溫度。因而對(duì)于濕度的控制有點(diǎn)困難?;?51 單片機(jī)溫濕度采集控制系統(tǒng)第 18 頁(yè) 共 37 頁(yè)參考文獻(xiàn)[1] 單片機(jī)課程系統(tǒng)設(shè)計(jì)實(shí)訓(xùn)教材[M]. 北京:清華大學(xué)出版社,2022.[2] 、應(yīng)用與實(shí)踐[M]. 北京:高等教育出版社,2022.[3] 吳金戌,沈慶陽(yáng), 單片機(jī)實(shí)踐與應(yīng)用[M]. 北京:清華大學(xué)出版社,2022.[4] [M]. 電子工業(yè)出版社,2022.[5] [M]. 北京:清華大學(xué)出版社,2022.[6] 單片機(jī)應(yīng)用系統(tǒng)設(shè)計(jì)[M]. 哈爾濱工業(yè)大學(xué)出版社,2022.[7] 單片機(jī)應(yīng)用系統(tǒng)典型模塊開發(fā)大全[M].中國(guó)鐵道出版社,2022[8] 單片機(jī) C 語(yǔ)言教程[M].電子工業(yè)出版社,2022.[9] [M].機(jī)械工業(yè)出版社,2022.北方民族大學(xué)學(xué)士學(xué)位論文第 19 頁(yè) 共 37 頁(yè)致 謝畢業(yè)在即,而畢業(yè)論文則是畢業(yè)前的最后一環(huán),也是非常重要的一環(huán)。為期幾個(gè)月的畢業(yè)系統(tǒng)設(shè)計(jì)過(guò)程中,馮翼老師給與了我很大幫助,無(wú)論是從實(shí)習(xí)期間的懵懂狀態(tài),再到硬件系統(tǒng)設(shè)計(jì)以及畢業(yè)論文的完成后的略有小成,我都會(huì)有深深的感慨。在做畢業(yè)系統(tǒng)設(shè)計(jì)的過(guò)程中,是馮翼老師給我指明了思路,包括硬件采購(gòu),電路連接以及軟件程序系統(tǒng)設(shè)計(jì)等,都給我提供了相當(dāng)大的幫助。在此,特意對(duì)馮翼老師表示深深感謝。同時(shí)還要對(duì)學(xué)校表示感謝,是學(xué)校給我們提供了一次難能可貴的機(jī)會(huì)。還有學(xué)校從硬件方面也對(duì)我們能幫助很大,大大的方便了我們完成畢業(yè)系統(tǒng)設(shè)計(jì)??傊?,無(wú)論是從老師還是到學(xué)校。本次畢業(yè)系統(tǒng)設(shè)計(jì)過(guò)程中我受到了很大的幫助和啟發(fā)。沒(méi)有你們,我的畢業(yè)系統(tǒng)設(shè)計(jì)就堅(jiān)持不下來(lái)。感謝你們,有了你們,我受益匪淺?;?51 單片機(jī)溫濕度采集控制系統(tǒng)第 20 頁(yè) 共 37 頁(yè)附 錄附錄 A 外文文獻(xiàn)Introductions to PID Controllers and IntelligentIndustrial automation level has bee a measure of professions modernization level is an important symbol. At the same time, the development of the theory of control also experienced the classical control theory and modern control theory and intelligent control theory of three phase automatic control system can be divided into the open loop control system and closedloop control system. A control system including the controller, sensors, actuators, and transmitter input and output interface. The output after output interface, actuators, add to the control system, Control system, the accused, the transmitter, through after sensor input interface to controller. Different control system, its sensors and actuators, the transmitter is not the same. At present, the PID control and controller or intelligent instrument has many PID controller in the engineering practice, the products have been widely applied, there are all sorts of PID controller products, panies are developed with PID parameter selfsetting function of intelligent regulator (intelligent regulator), including the PID controller is adjusted by intelligent automatic adjustment or calibration, the adaptive algorithm is proposed to realize. Have realized using PID control pressure, temperature, flow, liquid level controller, can realize PID control function of the programmable logic controller (PLC), and can 北方民族大學(xué)學(xué)士學(xué)位論文第 21 頁(yè) 共 37 頁(yè)realize PID control PC system, etc.PID controllers can be standalone controllers (also called single loop controllers), controllers in PLCs, embedded controllers, or software in Visual Basic or C puter programs.PID controllers are process controllers with the following characteristics:_ Continuous process control_ Analog input (also known as “measurement” or “Process Variable” or “PV”)_ Analog output (referred to simply as “output”)_ Setpoint (SP)_ Proportional (P) , Integral (I) , and/or Derivative (D) constantsExamples of “continuous process control” are temperature, pressure, flow, and level example, controlling the heating of a tank. For simple control, you have two temperature limit sensors (one low and one high) and then switch the heater on when the low temperature limit sensor turns on and then turn the heater off when the temperature rises to the high temperature limit sensor. This is similar to most home air conditioning amp。 heating thermostats.In contrast, the PID controller would receive input as the actual temperature and control a valve that regulates the flow of gas to the heater. The PID controller automatically finds thecorrect (constant)