1、I 摘要 本论文详细论述了由单片机为处理器的自动灌溉控制器的硬件、软件设计。本控制 器以 AT89C51 单片机为核心,由传感器、信号处理电路、键盘、显示电路、输出控制电 路、故障报警电路等构成。它能实现多路数据采集、多路控制信号输出功能。通过传感 器自动检测土壤水分,实现自动闭环控制和定时程序的时间控制等多种自动灌溉控制方 式,并具有土壤水分超出设定范围自动报警功能。土壤含水量的测量采用先进的 LW-02 型水分传感器; A/D 转换采用了 ADC0809 芯片; 键盘、 显示分别采用了独立式按键和 LED 显示块;故障报警选用了压电式蜂鸣器;输出控制电路由三极管、光电耦合器、继电器、 电磁
2、阀等组成。软件设计采取了模块化编程方法,软件程序的开发全部采用了 C51 高级 语言。主要包含的程序有:主程序、键盘扫描子程序、A/D 采样子程序、定时设定子程序 等。同时,在软硬件设计时均采取了有效的抗干扰措施。 关键字:单片机;灌溉;土壤水分传感器;自动控制 II Abstract The hardware layout and software development for single chip microprocessor automatic micro-irrigation controller and system programming are presented in de
3、tail 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 mufti-in
4、put and mufti-output. 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 range.There chose the LW-02 capacitive moisture sensor as the soi
5、l 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 composed of AT89C51,triode,photoelectric coupler,relay, electromagneti
6、c valve and so on.The 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 anti-interference measures are adopted during the design of the hardware and software. Keywords: Single chip microprocessor Micro-irrigation Soil moisture sensor Automatic control III 目录目录 摘要摘要