【正文】
write_dat(tab_lcd_num[set_humi_L_shi])。//設(shè)置濕度數(shù)值減 if(set_humi_L==0) set_humi_L=100。 set_humi_L++。//顯示位置第一行第一列 for(i=0。//顯示設(shè)置濕度十位 write_cmd(0xc7)。 } set_humi_H_ge=set_humi_H%10。//設(shè)置濕度數(shù)值加 if(set_humi_H==100) set_humi_H=0。i13。 write_dat(tab_lcd_num[set_temp_L_ge])。//計算設(shè)置溫度個位 set_temp_L_shi=set_temp_L/10。 } if(k3==0)//按下 K2 { while(k3==0)。i++) write_dat(tab_set_temp_L[i])。 } //設(shè)置溫度下限 //////////////////////////////// if(key_flag==1)//按 鍵標(biāo)志 1 { write_cmd(0x01)。 write_dat(tab_lcd_num[set_temp_H_shi])。//設(shè)置溫度數(shù)值減 if(set_temp_H==0)//到 0,加為 100 set_temp_H=100。 set_temp_H++。//顯示位置第一行第一列 for(i=0。i++) {write_cmd(0xc0+i)。i++) {write_cmd(0x80+i)。//顯示溫濕度十位 write_cmd(0xcd)。//顯示溫度十位 write_cmd(0x8d)。b0。//定義按鍵 K4 /////////////////////////延時函數(shù) ///////////////////////////// void delay(uchar x) { uchar a,b。//濕度上限賦值 78,濕度下限賦值 48 sbit k1=P3^2。//設(shè)定溫度的變量 uchar set_humi_H_ge,set_humi_H_shi。智能可以觀察到的增長和發(fā)展,通過在計算功率和通過對如何感覺知識積 累增長,決定復(fù)雜不斷變化的世界。有學(xué)位或情報,可以沿各維度的測量水平的情報。我們的結(jié)論與一個簡短的工作特性 F 智能(控制)系統(tǒng)。同樣, PID 控制器將自動熱,陽光明 媚的日 子(當(dāng)它是熱外加熱器)和寒冷,多云的日子。 相反, PID 控制器將接收輸入的實際溫度控制 PID 控制器自動地找到正確的(常北方民族大學(xué)學(xué)士學(xué)位論文 第 25 頁 共 36 頁 數(shù))的氣體,保持溫度穩(wěn)定在設(shè)定熱水器的流動。 PID 控制器可以獨立的控制器(也被稱為單回路控制器),控制器在 PLC,嵌入式控制器,或軟件在 Visual Basic 或 C 計算機程序。輸出接口,輸出驅(qū)動器后,添加到控制系統(tǒng),控制系統(tǒng),被 控制系統(tǒng) ,發(fā)射機,通過傳感器輸入接口后控制器。 基于 51 單片機溫濕度采集控制系統(tǒng) 第 20 頁 共 36 頁 附 錄 附錄 A 外文文獻 Introductions to PID Controllers and Intelligent Industrial 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 realize PID control PC system, etc. PID controllers can be standalone controllers (also called single loop controllers), controllers in PLCs, embedded controllers, or software 北方民族大學(xué)學(xué)士學(xué)位論文 第 21 頁 共 36 頁 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) constants Examples 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。 總之,無論是從老師還是到學(xué)校。在做畢業(yè)系統(tǒng)設(shè)計的過程中,是馮翼老師給我指明了思路,包括硬件采購,電路連接以及軟件程序系統(tǒng)設(shè)計等,都給我提供了相當(dāng)大的幫助。 而濕度的變化又大體上取決于溫度。 經(jīng)過幾個月的奮斗,從確定題目,到后來查找資料,理論學(xué) 習(xí),實驗編程調(diào)試,這一切都使我的理論知識和動手能力有了很大的提高。當(dāng)然濕度控制原理跟溫度一樣。 Keil C 程序運行如圖 51,52所示 圖 51 keil C 運行圖 基于 51 單片機溫濕度采集控制系統(tǒng) 第 16 頁 共 36 頁 圖 52 程序燒錄運行圖 在完成對程序的調(diào)試及燒錄之后,還需要對其進行演示,把開發(fā)板與電腦連上,設(shè)置好對應(yīng)的接口,完成供電及下載。 1602 內(nèi)部顯示地址如圖 39 所示: 圖 39 1602 內(nèi)部顯示地址 北方民族大學(xué)學(xué)士學(xué)位論文 第 11 頁 共 36 頁 1602 液晶顯示模塊電路原理圖 圖 310 1602 顯示模塊 報警模塊 二極管工作原理 圖 311 二極管工作原理圖 在對我們所要系統(tǒng)設(shè)計的課題有了整體的了解之后,需要先建立程序框架的流程圖,對整個系統(tǒng)設(shè)計劃分模塊,逐個模塊實現(xiàn)其功能,最終把各個子模塊合理的連接起來,構(gòu)成總的程序。傳感器的第三腳懸浮放置。 北方民族大學(xué)學(xué)士學(xué)位論文 第 9 頁 共 36 頁 表 35 DHT11 的電氣特性 參數(shù) 條件 Min typ max 單位 供電 DC 3 5 V 供電電流 測量 mA 平均 1 mA 待機 100 150 uA 采樣周期 秒 1 次 注 :采樣周期間隔不得低于 1秒鐘。 ( 2)接口說明 : 如果連接線長度 短于 20 米,則應(yīng)該加上 5K 上拉電阻 ,大于 20 米時根據(jù)實際情況來選擇合適阻值的上拉電阻。 DHT11 傳感器實物圖如下 33 所示: 基于 51 單片機溫濕度采集控制系統(tǒng) 第 8 頁 共 36 頁 圖 33 DHT11 傳感器實物圖 ( 1)引腳介紹: Pin1: (VDD),電源引腳,供電電壓為 3~,供電電壓 5V 即可。 圖 32 AT89C52 模塊電路原理圖 DHT11 傳感器模塊系統(tǒng)設(shè)計 DHT11 傳感器簡介 DHT11 數(shù)字溫濕度傳感器是一款 4 針單排引腳封裝的傳感器模塊。 AT89C52 單片機的內(nèi)部結(jié)構(gòu),引腳,指令與 MCS51 系列單片機基本相同。其中 AT89C52單片機主控模塊是本系統(tǒng)設(shè)計的核心模塊,核心模塊主要是指 AT89C52 芯片,它控制整個系統(tǒng)的運行,利用 AT89C52 單片機各個口分別控制其它模塊,使 DHT11傳感器, LCD1602 液晶顯示器,二極管形成一個穩(wěn)定運行的系統(tǒng),進而滿足本系統(tǒng)設(shè)計的功能需要 ;報警模塊主要是指將二極管接入單片機電路。在方案系統(tǒng)設(shè)計中,我們應(yīng)該始終遵循簡潔至上的原則,因此我將所有的外圍模塊與 AT89C52 模塊接口全部采用串行方式。 單片機主芯片選擇方案 對于本系統(tǒng)設(shè)計,由于對單片機的要求不高,只要選取片內(nèi)帶 RAM 和 ROM的單片機