毕业设计论文
------基于单片机的粮仓温度控制系统
系 别 专 业 班 级 姓 名 指导教师
自动化工程系 测控技术与仪器
2009年5 月 5 日
东北大学秦皇岛分校毕业设计(论文) 第I页
基于单片机的粮仓温度控制系统
摘 要
随着单片机技术的飞速发展,单片机在各个领域得到了广泛的应用。粮食是人类生存的必需品,温度是保存好粮食的先决条件,储存大量的粮食对稳定国民经济的发展起到至关重要的作用。粮库一般较大,测量点会很多。粮仓温度测量方法以及相应的智能控制一直是粮食保存的一个重要问题。
该系统是以AT89C51单片机和DS18B20数值温度传感器为核心组成的粮仓温度控制系统。该系统利用AT89C51单片机采集了各个温度点的温度,实现温度显示、报警等功能。它以AT89C51单片机为主控制芯片,采用数字温度传感器DS18B20实现多路温度的检测,利用LCD1602液晶显示器形象直观的显示测出的温度值。本文在确定法设计方案基础上,着重论述了系统的软硬件设计,并且描述了系统电路设计、硬件设计框图及所使用各种芯片功能和特性。通过PROTEUS软件和KEIL C仿真出了该系统。
关键词:单片机 DS18B20 液晶显示 键盘 报警
东北大学秦皇岛分校毕业设计(论文) 第II页 Temperature Control System Of The Granary Based On Single-chip
Author:Mu Xiqing
Tutor:Fan Lina
Abstract
Along with the single chip microcomputer technology rapid development, the microcontroller obtained the widespread application in each domain. The grain is the human survival essential item,the temperature is the precondition of preserving the grain well, storing up the massive grain plays a crucial role in the development of the stable national economy. Provision room is generally big, so there will be a lot of measurement points. Grain temperature measurement method and the corresponding intelligent control of food preservation has been an important issue.
The system is based on AT89C51 single-chip and numerical temperature sensor DS18B20, which composite the core temperature control system. This system has gathered each temperature using AT89C51 monolithic integrated circuit, which realizes functions temperature display and alarm functions and so on. It takes AT89C51 monolithic integrated circuit as main control chip, which uses digit temperature sensor DS18B20 to realize the multi-channel temperature detections. Temperature value which determines is displayed using the LCD1602 liquid-crystal in direct-viewing demonstration. This article focuses on system's software and hardware design emphatically on the foundation of determining the design of the program. It describes the system circuit design, the hardware design diagram as well as the function and the characteristic of the chip which is used in the system. This system is simulated through the PROTEUS and KEIL C software.
Key Words: Single-chip Microcomputer DS18B20 Liquid-crystal display
Keyboard Warning
东北大学秦皇岛分校毕业设计(论文) 第III页
目录
一 绪论 ............................................................................................................................ 1
1.1背景 ................................................................................................................................................................ 1 1.2设计的目的和意义 ........................................................................................................................................ 1 1.3相关领域国内外技术和发展趋势 ................................................................................................................ 2
二 系统方案设计 ............................................................................................................ 4
2.1方案设计 ........................................................................................................................................................ 4 3.2方案论证 ........................................................................................................................................................ 5
三 温度传感器 ................................................................................................................ 6
3.1温度传感器的选型 ........................................................................................................................................ 6
3.1.1传感器的选择原则 .......................................................................................................................... 6 3.1.2温度传感器的选择 .......................................................................................................................... 6 3.2 温度上、下限值的设定原理 ............................................................................................................. 7
四 系统硬件设计 ............................................................................................................ 8
4.1系统工作原理综述 ........................................................................................................................................ 8 4.2 DS1820与单片机接口电路 .......................................................................................................................... 9
4.2.1单片机89C51为本系统的核心 .................................................................................................... 10 4.2.2中央处理器AT89C51简介 ............................................................................................................ 13 4.3 DS18B20简介及测温电路设计 .................................................................................................................. 16
4.3.1 DS18B20 的性能特点 ................................................................................................................... 17 4.3.2 DS18B20的外形和内部结构 ........................................................................................................ 17 4.3.3高速暂存存储器 ............................................................................................................................ 21 4.3.4 DS18B20单总线(1一Wire)的基本原理..................................................................................... 22 4.4液晶显示电路 ............................................................................................................................................... 29
4.4.1 LCD1602主要技术参数 ................................................................................................................ 29 4.4.2 LCD1602的引脚说明 .................................................................................................................... 30 4.4.3控制指令说明 ................................................................................................................................ 30 4.5按键电路 ...................................................................................................................................................... 31 4.6报警电路 ...................................................................................................................................................... 33
五 软件功能及框图 ...................................................................................................... 34
5.1主程序 .......................................................................................................................................................... 34 5.2 读出温度子程序 ......................................................................................................................................... 34 5.3 温度转换命令子程序 ................................................................................................................................. 34 5.4 计算温度子程序 ......................................................................................................................................... 34 5.5显示数据刷新程序子程序 .......................................................................................................................... 34 5.6按键处理子程序 .......................................................................................................................................... 34
六 单片机的抗干扰问题 .............................................................................................. 40
6.1干扰因素 ...................................................................................................................................................... 40 6.2硬件抗干扰措施 .......................................................................................................................................... 40
6.2.1合理选择元器件 ............................................................................................................................ 40 6.2.2电源干扰的抑制 ............................................................................................................................ 40

