【正文】
WRVCCGNDVCCGNDVoutGND 圖 1602LCD 引腳圖 引腳功能說明: 1602LCD 采用標(biāo)準(zhǔn)的 14 腳(無背光)或 者 16 腳(帶背光)接 口,各 個(gè) 引腳接口說明如下: 陜西理工學(xué)院畢業(yè)設(shè)計(jì) 第 15 頁 共 48 頁 第 1 腳: VSS 為地電源。 對(duì)比度過高時(shí) 將 會(huì)產(chǎn)生“鬼影”,使用時(shí)可以通過一個(gè) 10K 的電位器調(diào)整對(duì)比度。 第 6 腳: E 端為使能端,當(dāng) E 端由高電平跳成低電平 的 時(shí) 候 ,液晶模塊 則 執(zhí)行命令。 液晶顯示原理 讀寫操作時(shí)序如圖 和圖 所示: 圖 讀操作時(shí)序 圖 寫操作時(shí)序 報(bào)警系統(tǒng)設(shè)計(jì) 本系統(tǒng)采用紅 LED 燈作為光報(bào)警提示,當(dāng)系統(tǒng)檢測到的數(shù)據(jù)不符合給定的要求時(shí),現(xiàn)場為紅燈 綠燈 報(bào)警提示;如圖 陜西理工學(xué)院畢業(yè)設(shè)計(jì) 第 16 頁 共 48 頁 圖 報(bào)警系統(tǒng)電路圖 陜西理工學(xué)院畢業(yè)設(shè)計(jì) 第 17 頁 共 48 頁 4 系統(tǒng)軟件設(shè)計(jì) 本系統(tǒng)軟件系統(tǒng)設(shè)計(jì)包括:系統(tǒng)初始化模塊,數(shù)據(jù)采集模塊,無線模塊, 1602LCD 顯示模塊,報(bào)警模塊。 溫濕 度判斷控制模塊也是系統(tǒng)的核心模塊之一,所謂判斷控制模塊,就是對(duì)當(dāng)前溫室內(nèi)的實(shí)際溫濕度與給定的溫濕度范圍進(jìn)行比較,先進(jìn)行判斷,然后再進(jìn)行控制,控制模塊是決定系統(tǒng)將要進(jìn)行什么工作的。發(fā)射數(shù)據(jù)時(shí),首先將nRF24L01 配置為發(fā)射模式。第一行顯示: TRH RH:%,第二行顯示:TRH T:。 LED 是由單片機(jī)控制 LED 燈組成的,其轉(zhuǎn)換規(guī)律為: , LED 不亮。反之,如果當(dāng)前溫濕度高于用戶設(shè)定的上限溫濕度值,則說明當(dāng)前溫濕度過高,系統(tǒng)也會(huì)自動(dòng)啟動(dòng)警報(bào)燈,直至溫濕度值降到適當(dāng)范圍時(shí)警報(bào)燈熄滅。系統(tǒng)是采用 AT89C52 單片機(jī)、 DTH11 數(shù)字溫濕度傳感器、 LCD1602 液晶顯示模塊、 NRF24L01 無線模塊、 LED 發(fā)光二極管等器件實(shí)現(xiàn)的溫室大棚監(jiān)控系統(tǒng),實(shí)現(xiàn)了溫濕度采集、數(shù)據(jù)顯示、報(bào)警的功能。 陜西理工學(xué)院畢業(yè)設(shè)計(jì) 第 26 頁 共 48 頁 致 謝 在這次畢業(yè)設(shè)計(jì)中,最應(yīng)該感謝的是我的 指導(dǎo)老 師 梁芳 老師,本次溫室大棚環(huán)境參數(shù)監(jiān)控系統(tǒng)的成功設(shè)計(jì)與 梁 老師的幫助是息息相關(guān)的。 陜西理工學(xué)院畢業(yè)設(shè)計(jì) 第 27 頁 共 48 頁 參考文獻(xiàn) [1] 高職富 .溫室環(huán)境控制技術(shù)的現(xiàn)狀及發(fā)展前景 [J].中國市場 ,20xx 年第 35 期 :106107 [2] 吉紅 .自動(dòng)控制在國外設(shè)施農(nóng)業(yè)中的應(yīng)用 [J].農(nóng)業(yè)環(huán)境與發(fā)展 ,20xx(5):5254 [3]陳桂友,柴遠(yuǎn)斌.單片機(jī)應(yīng)用技術(shù) [M].北京:機(jī)械工業(yè)出版社, 20xx, 1088. [4] 范薇薇 .基于無線傳感器網(wǎng)絡(luò)的溫室控制系統(tǒng)研究 [D].中國知網(wǎng) ,20xx [5] 王中心 .溫室土壤溫濕度無線信息采集與監(jiān)控系統(tǒng)的設(shè)計(jì)與實(shí)現(xiàn) .中國知網(wǎng) ,20xx [6] 李文仲 ,段朝玉 .短距離無線數(shù)據(jù)通信入門與實(shí)戰(zhàn) [M],北京航空航天大學(xué)出版社 ,20xx [7]熊詩波.機(jī)械工程測試技術(shù)基礎(chǔ)(第 4 版) [M].北京:機(jī)械工業(yè)出版社, 20xx, 60102. [8] 徐愛鈞 .單片機(jī)原理實(shí)用教程 .電子工業(yè)出版社 ,20xx,3 [9] 張新榮.基于單片機(jī)的多路溫度監(jiān)測系統(tǒng)設(shè)計(jì) [J].工業(yè)控制計(jì)算機(jī), 20xx(7): 1321. [10] 孫育才. MCS51 系列單片微型計(jì)算機(jī)及其應(yīng)用( 第四版) [M].南京:東南大學(xué)出版社, 20xx, 5658. [11] 馬靖善,秦玉平. C 語言程序設(shè)計(jì) [M].北京:清華大學(xué)出版社, 20xx, 1115. [12] LEWIS control system using IEC 61499[M].Institution of Electrical Engineers,20xx [13] CHRISTENSEN J H. Basic concept of IEC 61499[C].Fachtagung Verteilte Automat isierung,Magdeburg DE,20xx:22 23 [14] IEC 65/240/CD,Function blocks for industrial process measurement and control systems Part 1:Architecture[S].1999 [15] IEC 61499 2 (and Committee Draft to be published),Function blocks for industrial process measurement and control systems Part 2:Engineering Task Support[S].1999 [16] Willing sensor work concept challenges and amp。 功能特性 AT89C51 提供以下的功能標(biāo)準(zhǔn): 4K 字節(jié)閃爍存儲(chǔ)器, 128 字節(jié)隨機(jī)存取數(shù)據(jù)存儲(chǔ)器, 32 個(gè)I/O 口, 2 個(gè) 16 位定時(shí) /計(jì)數(shù)器, 1個(gè) 5 向量兩級(jí)中斷結(jié)構(gòu), 1 個(gè)串行通信口,片內(nèi)震蕩器和時(shí)鐘電路。 引腳 描述 VCC:電源電壓 GND:地 P0 口 : P0 口是一組 8 位漏極開路雙向 I/O 口,即地址 /數(shù)據(jù)總線復(fù)用口。 P0 口在閃爍編程時(shí), P0 口接收指令,在程序校驗(yàn)時(shí),輸出指令,需要接電阻。閃爍編程時(shí)和程序校驗(yàn)時(shí), P1 口接收低 8 位地址。在訪問外部程序存儲(chǔ)器或 16 位地址的外部數(shù)據(jù)存儲(chǔ)器時(shí), P2 口送出高 8 位地址數(shù)據(jù)。對(duì)P3 口寫如“ 1”時(shí),它們被內(nèi)部電阻拉到高電平并可作為輸入端時(shí),被外部拉低的 P3 口將用電阻輸出電流。即使不訪問外部存儲(chǔ)器, ALE 以時(shí)鐘震 蕩頻率的 1/16 輸出固定的正脈沖信號(hào),因此它可對(duì)輸出時(shí)鐘陜西理工學(xué)院畢業(yè)設(shè)計(jì) 第 29 頁 共 48 頁 或用于定時(shí)目的。此外,這個(gè)引腳會(huì)微弱拉高,單片機(jī)執(zhí)行外部程序時(shí),應(yīng)設(shè)置 ALE 無效。欲使中央處理器僅訪問外部程序存儲(chǔ)器, EA 端必須保持低電平。 XTAL1:震蕩器反相放大器及內(nèi)部時(shí)鐘發(fā)生器的輸入端。 外接石英晶體及電容 C1, C2 接在放大器的反饋回路中構(gòu)成并聯(lián)震蕩電路。 10PF 這種情況下,外部時(shí)鐘脈沖接到XTAL1 端,即內(nèi)部時(shí)鐘發(fā)生器的輸入端, XTAL2 則懸空。 PD 是掉電模式,當(dāng) PD=1 時(shí),激活掉電工作模式,單片機(jī)進(jìn)入掉電工作狀態(tài)。此時(shí),片內(nèi)隨機(jī)存取數(shù)據(jù)存儲(chǔ)器和所有特殊功能寄存器的內(nèi)容保持不變。二是通過硬件復(fù)位也可將閑散工作模式終止。 Description The AT89C51 is a lowpower, highperformance CMOS 8bit microputer with 4K bytes of Flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’ s highdensity nonvolatile memory technology and is patible with the industrystandard MCS51 instruction set and pinout. The onchip Flash allows the program memory to be reprogrammed insystem or by a conventional nonvolatile memory programmer. By bining a versatile 8bit CPU with Flash on a monolithic chip, the Atmel AT89C51 is a powerful microputer which provides a highlyflexible and costeffective solution to many embedded control applications. Function characteristic The AT89C51 provides the following standard features: 4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16bit timer/counters, a five vector twolevel interrupt architecture, a full duplex serial port, onchip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Powerdown Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. Pin Description VCC: Supply voltage. GND: Ground. Port 0: Port 0 is an 8bit opendrain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as highimpedance 0 may also be configured to be the multiplexed loworder address/data bus during accesses to external program and data memory. In this mode P0 has internal 0 also receives the code bytes during Flash programming,and outputs the code bytes during programverification. External pullups are required during programverification. Port 1 Port 1 is an 8bit bidirectional I/O port with internal Port 1 output buffers can sink/source four TTL 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 1 pins that are externally being pulled low will source current (IIL) because of the internal 1 also receives the loworder address bytes during Flash programming and verification. Port 2 Port 2 is an 8bit bidirectional I/O port with internal Port 2 output buffers can sink/source four TTL 1s are written to Port 2 pins they are pulled high by the internal pullups and can be used as inputs. As inputs,Port 2 pins that are externally being pulled low will source current, because of the internal 2 emits the highorder address byte during fetches f