摘要
蔬菜的生长与温度密切相关,蔬菜大棚是农业发展中一项重要技术,它对于蔬菜的产量提高有着非常重要的作用,尤其是在寒冷的地区,部分蔬菜难以适应当地的气温,采用蔬菜大棚技术可以在这种环境下种植蔬菜,其不仅可以增加当地农民的收入,同时对于我国农业的发展也有着很大的促进作用,因此对蔬菜大棚温度控制系统的研究是一项十分有意义的课题。
为了提高蔬菜大棚的生产效应,实现温度自动控制,设计了蔬菜大棚温度自动控制系统。本论文介绍了一种以微型单片机为主要控制器件,采用 AT89S51 单片机为核心控制器,运用 DS18B20 传感器对大棚温度进行采集,通过 LCD1602 显示器对当前实时温度进行显示。该控制系统可以实时存储相关的温度数据并记录当前的时间。主要包括硬件电路的设计和系统程序的设计。硬件电路主要包括STC89C52单片机最小系统,测温电路、实时时钟电路、LCD液晶显示电路以及通讯模块电路等。系统程序主要包括主程序,读出温度子程序,计算温度子程序、按键处理程序、LCD显示程序以及数据存储程序等。
本设计是通过单片机控制,来实现对蔬菜大棚温度进行自动控制。系统以AT89C52单片机为基础,通过数字及模拟式对温度进行采集并检测,通过显示屏显示当前温度。当采集到的温度高于系统设定值,马达将带动风扇的转动,实现自动控制大棚里的温度。
关键词:单片机;STC89C52;DS1302;DS18B20;LCD1602
The Design of DS18B20 Digit Thermometer
ABSTRACT
Vegetables growth is closely related to temperature, vegetable greenhouses is very important in the agricultural development of the technology, it rises to the production of vegetables has a very important role, especially in cold areas, and some vegetables is difficult to adapt to the local temperature, the vegetable greenhouses technology can grow vegetables in this environment, it can not only increase the income of local farmers, at the same time for the development of agriculture in our country also has a great role in promoting, therefore the research of vegetable greenhouse temperature control system is a very meaningful topic.
In order to improve the production effect of vegetable greenhouse, the temperature automatic control system was designed. This paper introduces a kind of miniature single chip microcomputer as the main control device, using AT89S51 as the core controller, using DS18B20 sensors on the greenhouse temperature acquisition, through LCD1602 display to display the current real-time temperature. The control system can store the relevant temperature data in real time and record the current time. Mainly include hardware circuit design and system program design. The hardware circuit includes the minimum system of STC89C52 single chip microcomputer, temperature measurement circuit, real-time clock circuit, LCD display circuit and communication module circuit, etc. The system program mainly includes main program, readout temperature subroutine, calculation of temperature subroutine, key processing program, LCD display program and data storage program, etc.
The design is controlled by single chip microcomputer to realize automatic control of greenhouse temperature. The system is based on the AT89C52 single chip microcomputer, and the temperature is collected and tested by digital and analog methods, and the current temperature is displayed through the display screen. When the collected temperature is higher than the set value of the system, the motor will drive the fan and realize the automatic control of the temperature in the greenhouse.
keywords: Microcontroller Unit ; STC89C52;DS1302; DS18B20; D
目录
摘要 …………………………………………………………………………………I
ABSTRACT II
第一章 设计任务及方案分析 1
1.1 设计任务及要求 1
1.2 设计总体方案及方案论证 1
1.3 温度测量的方案与分析 1
1.31芯片选择 1
1.32实现方法简介 2
1.33 方案设计 2
第二章 芯片简介 4
2.1 STC89C52芯片简介 4
2.11引脚功能说明 4
2.2 DS18B20简介 7
2.21芯片简介 7
2.22 DS18B20外形和内部结构 8
2.24 DS18B20的工作时序 11
2.25 DS18B20与单片机的典型接口设计 12
2.26 DS18B20的各个ROM命令 13
2.3 74HC595简介 15
2.31芯片简介 15
2.32 74HC595特点: 15
2.33 引脚图及各引脚功能 16
第三章 系统硬件电路的设计 17
3.1主控制电路和测温控制电路原理图 17
3.2驱动电路与显示电路模块原理图 17
第四章 软件编程与功能调试 19
4.2 系统软件设计 19
4.2.1 系统软件设计整体思路 19
4.2.2 系统程序流图 20
4.3 系统的程序 23
第四章 仿真分析与实物制作 51
4.1 PROTUES软件简介 51
4.2 实物制作 51
第五章 总结 52
致谢 53