基于单片机温度控制系统设计
摘 要
近年来随着计算机在社会领域的渗透, 单片机的应用正在不断地走向深入,同时带动传统控制检测日新月益更新。在实时检测和自动控制的单片机应用系统中,单片机往往是作为一个核心部件来使用,仅单片机方面知识是不够的,还应根据具体硬件结构,以及具体应用对象特点的软件结合,以作完善。
本文从硬件和软件两方面来讲述水温自动控制过程,在控制过程中主要应用AT89C51、ADC0809、LED显示器、LM324比较器,而主要是通过 DS18B20数字温度传感器采集环境温度,以单片机为核心控制部件,并通过四位数码管显示实时温度的一种数字温度计。软件方面采用汇编语言来进行程序设计,使指令的执行速度快,节省存储空间。为了便于扩展和更改,软件的设计采用模块化结构,使程序设计的逻辑关系更加简洁明了,使硬件在软件的控制下协调运作。
而系统的过程则是:首先,通过设置按键,设定恒温运行时的温度值,并且用数码管显示这个温度值.然后,在运行过程中将采样的温度模拟量送入A/D转换器中进行模拟-数字转换,再将转换后的数字量用数码管进行显示,最后用单片机来控制加热器,进行加热或停止加热,直到能在规定的温度下恒温加热。
关键词:单片机系统;传感器;数据采集;模数转换器;温度
Abstract
In recent years, with the computer penetration in the social field, the application of SCM is to keep at the same time, traditional control testing update on Crescent benefits. In real-time detection and automatic control system of single-chip applications, often as a single-chip core component to use only single-chip is not enough knowledge, but also the specific hardware structure and the specific features of application software objects combine to make perfect.
In this paper, both hardware and software for automatic control of water temperature on the process, in the control of the main application of the process of AT89C51, ADC0809, LED display, LM324 comparator, but mainly through the digital temperature sensor DS18B20 collecting ambient temperature to single-chip microcomputer as the core control components, and through four real-time digital display of a digital thermometer temperature. Software using assembly language for programming, so that the implementation of Directive speed, to save storage space. In order to facilitate the expansion and changes to the design of modular software structure, so that the logic of the relationship between program design more concise,Hardware software co-operation under the control of it.
And systematic process is: First of all, by setting the button, set the thermostat temperature at the time of operation, and digital display of the temperature. Then, in the running temperature of the process of sampling analog into the A / D converter in the simulation - digital converter, and then converted digital control with digital display, the last single-chip microcomputer to control the heater used for heating or stop heating until the temperature in the provisions under the constant temperature heating.
Key words:Single-chip microcomputer system ;Sensor;Data Acquisition;ADC;Temperature
目 录
第1章 绪 论 1
1.1课题的背景及其意义 1
1.2课题研究的内容及要求 2
1.3课题的研究方案 3
第2章 设计理论基础 6
2.1单片机的发展概况 6
2.2 AT89C51系列单片机介绍 7
2.2.1 AT89C51系列基本组成及特性 7
2.2.2 AT89C51系列引脚功能 8
2.2.3 AT89C51系列单片机的功能单元 11
2.3 ADC0809模数转换器 14
2.4运算放大器LM324 16
2.5移位寄存器74LS164 18
2.6数码显示管LED 19
2.7数字温度计DS18S20 20
第3章 硬件电路设计 21
3.1单片机控制单元 21
3.2温度采样部分 21
3.3模数转换部分 23
3.3.1模数转换技术 23
3.3.2积分型模数转换器 24
3.4显示部分 24
3.5调节执行单元 25
第4章 软件设计 28
4.1主程序流程图 28
4.2中断子程序流程图 29
4.3按键流程图 30
4.4显示流程图 31
第5章 系统调试及结论分析 32
5.1硬件调试 32
5.1.1硬件电路故障及解决方法 32
5.1.2硬件调试方法 33
5.2软件调试 33
5.2.1软件电路故障及解决方法 33
5.2.2软件调试方法 34
5.3结论分析 35
第6章 总结与展望 36
6.1总结 36
6.2展望 37
参考文献 38
致 谢 39
附 录 40
1.系统譆@绦蚯宓 40
2.系统的原理图 49
3.外文资料原文 50
4.外文资料译文 54