广东工业大学 华立学院
本科毕业设计(论文)
基于单片机和温度传感器的温度控制系统
系 部 机电与信息工程学部 专 业 电气工程及其自动化 年 级 2012 级 班级名称 12电气2班 学 号 5112228912030207 学生姓名 邓政伟 指导教师 李升源
摘 要
随着社会的发展,温度的测量与控制显得越来越重要。人类的生活、工业上的控制、天气预报、物资仓管、室内种植等领域都离不开温度的测量与控制。在21世纪,现代科学技术迅速发展,特别是数字技术的应用更是得到大力发展,温控传感器也登上了科学技术的舞台。温度控制控系统通过传感器检测温度,然后将数据输入到处理器处理,可以在数码管或LCD屏等显示出来。然后由控制器可以控制加热或者制冷,从而达到控温的目的。本毕业设计利用单片机STC89C52和温度传感器DS18B20对环境温度进行检测,然后通过处理,再在数码管上显示温度的数值,我们要远程实时控制目标温度,就要利用串口通信,在上位机的VB软件上显示温度数据,然后我们利用LED灯的亮灭来进行模拟加热和制冷。为了保证单片机输入电压的稳定性,故电源部分用电源芯片Viper22a和三端稳压器78L05设计一个5V开关电源。本毕业设计会对每个功能模块进行详细的分析与概述,利用52单片机和DS18B20所组成的温控系统,具有硬件电路简单,软件编程工作量少,测温非常精准,系统稳定,接线少等优点。
关键词:单片机,温控,传感器,电源芯片
I
ABSTRACT
With the development of the society, the temperature measurement and control is more and more important.Human life, industrial control, weather forecast, material warehouse, indoor, and other fields is inseparable from the temperature measurement and control.In the 21st century, the rapid development of modern science and technology, especially the application of digital technology is developing, the temperature sensor is mounted the platform of science and technology.The temperature control system controlled by temperature sensors, and then will be treated as input data to the processor, can be in the digital tube or LCD display.And then by the controller can control the heating or cooling, so as to achieve the purpose of temperature control.
This graduation design STC89C52 microcontroller and temperature sensor DS18B20 to test the environmental temperature, and then by processing, again on the digital tube display temperature values, remote real-time temperature control objectives, we will be using a serial port communication, show the temperature data on the PC VB software, and then we use the bright LED lights to simulate the heating and cooling.In order to guarantee the stability of the single chip microcomputer as the input voltage, the power supply by using power Viper22a chip and 78 l05 three-terminal voltage regulator design a 5 v switching power supply.Of each function module in detail of this graduation design, the analysis and summary, use of 51 MCU and DS18B20 temperature control system, it has a simple hardware circuit, software programming less workload, temperature measurement is very accurate, system stability, less wiring, etc.
Keywords:Chip microcontroller, temperature control, sensors, power
II
目 录
1 绪论 ................................................................ 1
1.1 单片微机的历史 .................................................. 1 1.2简述开关电源的发展 .............................................. 2 1.3温度检测的重要性 ................................................ 2 1.4设计温度控制系统的核心 .......................................... 3 2单片机的简述 .......................................................... 4
2.1单片机的特点与引脚介绍 .......................................... 5 2.2单片机的应用范围 ................................................ 7 2.3单片机的最小系统 ................................................ 8 3电源模块设计 ......................................................... 11
3.1 开关电源的特点 ................................................. 11 3.2 电源芯片VIPer22a简述 .......................................... 12 3.3三端稳压器78L05简述 ........................................... 12 3.4AC220V输入转DC5V输出开关电源原理简述 .......................... 14 4温控系统的硬件设计 ................................................... 15
4.1温度传感器概述 ................................................. 15 4.2DS18B20温度传感器介绍 .......................................... 15 4.3显示模块 ....................................................... 21 4.4温度报警模块 ................................................... 23 4.5串口通信模块 ................................................... 24 5软件设计 ............................................................. 26
5.1系统整体概述 ................................................... 26 5.2温度获取并转换 ................................................. 28 5.3温度的控制 ..................................................... 28 6 单片机与上位机通信 .................................................. 31 结 论 ................................................................ 33 参 考 文 献 ........................................................ 34 附录1电路总原理图 .................................................... 35 附录2 完整C程序代码 ................................................ 36
III
1 绪论
1.1 单片微机的历史
单片微型的计算机简称为单片机,是经常应用的的嵌入式微控制器(Microcontroller Unit),我们也经常用英文字母的缩写MCU来代表单片机,单片机它是一个单片微控制器,而不是完成某一个逻辑功能的芯片,而是把一个计算机系统集成到一个芯片上。单片机由运算器、控制器、存储器、输入输出设备构成,其实就相当于一个微型的计算机(最小系统),不过与计算机相比较,单片机缺少了很多的外围设备等。总的来说:一块芯片变成了一台计算机。但它的体积非常小、质量又轻、最主要是价格非常便宜,在学习、研究开发方面是非常便利的。我们最早把单片机是用在工业控制领域的。
1974年,世界上第一台单片微型计算机F8被美国仙童(Fairchild)公司研制出,该机由两块集成电路芯片组成,结构与别的单片微型计算机不一样,并且指令系统也与众不同,得到了电子仪器领域的欢迎和重用。
可以说单片微型计算机一开始的发展,我们是以Intel公司在一九七六年推出的八位单片机为开始点,其实是主要经历了三个历史阶段。
第1代单片微型计算机(1976-1978)。在1976年开始,以MCS-48系列为代表。 第2代单片微型计算机(1978-1982) 。以Intel公司的MCS-51系列为代表 第3代单片微型计算机(1982-1992) 。它的技术特点就是单片微机的控制功能得到全速发展。以下为综合特点:
(1)非总线型单片微机得到大力发展,而且和以前的总线型单片机形成了两大派系。为了拿下家电控制器这个巨大市场,所以将单片机的并行扩展总线省去了,推出了价格更加便宜的单片微机,并尽最大努力地把一些外围接口封装在片内;
(2)为了能扩展各种外围器件但又不使用并行总线,所以串行扩展总线被推出了。如I2C总线是philips推出的、SPL是Motorola推出的、Microwire/PLUS的串行外围接口是NS公司推出的等等;
(3)控制功能的控制网络总线得到良好发展,以实现串行通信总线难以构成的多主强控制功能的网络系统。就好像汽车电子系统中采用的CAN总线。
1
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库基于单片机和温度传感器的温度控制系统在线全文阅读。
相关推荐: