【正文】
沈陽建筑大學(xué)城市建設(shè)學(xué)院畢業(yè)設(shè)計(jì)(論文) — I— 摘 要 本論文詳細(xì)論述了由單片機(jī)為處理器的自動(dòng)灌溉控制器的硬件、軟件設(shè)計(jì) 。 本控制器以 AT89C51單片機(jī)為核心,由傳感器、信號(hào)處理電路、鍵盤、顯示電路、輸出控制電路、故障報(bào)警電路等構(gòu)成。它能實(shí)現(xiàn)多路數(shù)據(jù)采集、多路控制信號(hào)輸出功能。 通過傳感器自動(dòng)檢測(cè)土壤水分 , 實(shí)現(xiàn)自動(dòng)閉環(huán)控制和定時(shí)程序的時(shí)間控制 等多種自動(dòng)灌溉控制方式,并具有土壤水分超出設(shè)定范圍自動(dòng)報(bào)警功能。 土壤含水量的測(cè)量采用先進(jìn)的 LW02型水分傳感器 ; A/D轉(zhuǎn)換采用了 ADC0809芯片 ; 鍵盤、顯示分別采用了獨(dú)立式按鍵和 LED顯示塊 ; 故障報(bào)警選用了壓電式蜂 鳴器 ; 輸出控制電路由三極管、 光電耦合器 、繼電器、電磁閥等組成。軟件設(shè)計(jì)采取了模塊化編程方法,軟件程序的開發(fā)全部采用了 C51高級(jí)語言。主要包含的程序有 :主程序 、 鍵盤掃描子程序 、 A/D采樣子程序 、 定時(shí)設(shè)定子程序等。同時(shí),在軟硬件設(shè)計(jì)時(shí)均采取了有效的抗干擾措施。 關(guān)鍵 字 :單片機(jī) ; 灌溉 ; 土壤水分傳感器 ; 自動(dòng)控制 沈陽建筑大學(xué)城市建設(shè)學(xué)院畢業(yè)設(shè)計(jì)(論文) — II— Abstract The hardware layout and software development for single chip microprocessor automatic microirrigation controller and system programming are presented in detail in this paper. Based on the AT89C51 single chip microprocessor, the whole system consists of soil moisture sensors, signal transfer circuit, keyboard and monitor display circuit, out port control circuit, malfunction alarm circuit as well as system software. This controller can control muftiinput and muftioutput. It can work in several ways such as closed loop control with sensors, opened loop control based on the preset timing program. In addition, it has automatic alarm function when the soil moisture exceeds the preset chose the LW02 capacitive moisture sensor as the soil moisture sensor, ADC0809 as the A/D conversion, independent key as the keyboard, LED display unit as the monitor display and chose the simple piezoelectric buzzer as the malfunction alarm device. The out port control circuit is posed of AT89C51,triode,photoelectric coupler,relay, electromagic valve and so software designing adopt the popular modularized structure. The development of software programs apply C51 language entirely. The primary programs are main program, keyboard scanning subroutine, A/D sampling subroutine, timer presetting subroutine. Meanwhile, the efficient antiinterference measures are adopted during the design of the hardware and software. Keywords: Single chip microprocessor Microirrigation Soil moisture sensor Automatic control 沈陽建筑大學(xué)城市建設(shè)學(xué)院畢業(yè)設(shè)計(jì)(論文) — III— 目 錄 摘要 ................................................................ I ABSTRACT ........................................................... II 目錄 .............................................................. III 第一章 前言 ......................................................... 6 研究背景 ............................................................ 6 研究目的和意義 ...................................................... 7 任務(wù)和要求 .......................................................... 7 第二章 智能灌溉系統(tǒng)的組成 ........................................... 9 灌溉總系統(tǒng)的組成 .................................................... 9 灌溉系統(tǒng)結(jié)構(gòu)總框圖 ................................................. 10 單片機(jī)灌溉量的確定 ................................................. 10 灌水量的確定 ........................................... 10 灌水時(shí)間間隔的確定 ..................................... 10 一次 灌水延續(xù)時(shí)間的確定 ................................ 10 灌水次數(shù)與灌水總量的確定 ............................... 11 開啟和關(guān)閉供水系統(tǒng)的土壤含水量臨界點(diǎn)的確定 ............. 11 第三章 GTM900C 無線模塊 ............................................ 13 GTM900C 模塊介紹 ................................................... 13 GTM900C模塊產(chǎn)品定位 ................................... 14 GTM900C 模塊產(chǎn)品特性 ................................... 14 GTM900C 模塊產(chǎn)品的應(yīng)用 ................................. 15 GTM900C 無線模塊的業(yè)務(wù)演示框圖 ......................... 15 GTM900C 無線模塊 AT命令 ............................................. 1 AT 命令類型 ............................................. 1 消息發(fā)送和寫入命令 ..................................... 2 GTM900C 信號(hào)連接器和天線接口 ........................................ 5 沈陽建筑大學(xué)城市建設(shè)學(xué)院畢業(yè)設(shè)計(jì)(論文) — IV— 信號(hào)連接器 .............................................. 5 天線接口 ................................................ 6 接口信號(hào) ................................................ 6 接口的使用 .......................................................... 9 UART 接口的功能特性 .................................... 9 UART 接口信號(hào)定義 ...................................... 9 UART 接口 DCEDTE 配線 ................................ 10 第四章 系統(tǒng)硬件設(shè)計(jì) ................................................ 11 土壤水分傳感器的選擇與使用 ......................................... 11 土壤水分傳感器的選擇 ................................... 11 土壤水分傳感器的測(cè)量原理及其實(shí)現(xiàn)方法 ................... 11 傳感器在田間的埋設(shè) ..................................... 14 單片機(jī)的選擇 ....................................................... 15 單片機(jī)的發(fā)展概況及其選擇 ............................... 15 89C51單片機(jī)性能與應(yīng)用 ................................ 15 引腳功能 .............................................. 16 振蕩器電路及復(fù)位電路設(shè)計(jì) ........................................... 18 存儲(chǔ)器的配置 ....................................................... 19 數(shù)據(jù) 采集處理電路 ................................................... 20 模數(shù)轉(zhuǎn)換器的選擇 ...................................... 20 ADC0809 引腳及接口電路設(shè)計(jì) ............................ 21 顯示系統(tǒng)的電路設(shè)計(jì) ................................................. 23 輸出控制電路設(shè)計(jì) ................................................... 24 故障報(bào)警電路及鍵盤接口電路設(shè)計(jì) ..................................... 25 第五章 系統(tǒng)軟件設(shè)計(jì) ................................................ 28 主程序設(shè)計(jì) ......................................................... 28 鍵盤掃描子程序設(shè)計(jì) ................................................. 30 實(shí)時(shí)時(shí)鐘中斷與控制功能的完成 ....................................... 31 時(shí)間灌溉控制功能的實(shí)現(xiàn) ............................................. 32 沈陽建筑大學(xué)城市建設(shè)學(xué)院畢業(yè)設(shè)計(jì)(論文) — V— 其它控制功能的實(shí)現(xiàn) ................................................. 32 定時(shí)設(shè)定功能的實(shí)現(xiàn) ..................................... 33 濕度范圍設(shè)定功能的實(shí)現(xiàn) ................................. 33 第六章 技術(shù)經(jīng)濟(jì)分析 ................................................ 35 第七章 結(jié)論 ....................................