基于51单片机数字温度计的设计毕业论文 联系客服

发布时间 : 星期日 文章基于51单片机数字温度计的设计毕业论文更新完毕开始阅读f7562e830342a8956bec0975f46527d3240ca6a4

Based On 51 Single-chip Design Of Digital Thermometer

Abstract:This paper designed a system of digital thermometer based on single chip microcomputer, the AT89C51 chip as the control center, DS18B20 temperature sensor for temperature measuring element, LCD1602 to display device, and introduces in detail the design of hard and software design process, including the hardware and the MCU connection process is the core part of the each module design and system software programming process is the key, for each circuit design process is introduced in detail. Among them, the hardware design part includes the minimum system design, temperature sensing circuit and alarm circuit design, temperature control circuit and display circuit design; Software design includes the main program design, the read temperature subroutine design, temperature conversion command subroutine and calculation subroutine design temperature. According to design scheme, designed thermometer can realize temperature acquisition and display function, can measure the temperature is between 0 ~ 100 ℃, the measurement precision of 0.5 ℃, exceed the set upper and lower alarm prompt. Can according to need any set upper and lower, easy to use, simple operation, high precision, high accuracy, small size and low power consumption advantages, has the certain application situations.

Keyords: singal chip microcomputer temperature sensors digital thermometer

II

目 录

摘要 ............................................................................................................................................................ I 目 录 ..................................................................................................................................................... III 第一章 引言 ............................................................................................................................................. 1

1.1 研究的背景和意义 ..................................................................................................................... 1 1.2 电路工作原理............................................................................................................................. 1 1.3 论文结构安排............................................................................................................................. 2 第二章 数字温度计的设计方案 .............................................................................................................. 3

2.1 数字温度计的功能要求 ............................................................................................................. 3 2.2 单片机的选择............................................................................................................................. 3 2.3 温度传感器的选择 ..................................................................................................................... 3

2.3.1 水银温度计 ...................................................................................................................... 3 2.3.2 传统温度敏感元件 .......................................................................................................... 3 2.3.3 数字温度传感器DS18B20 ............................................................................................. 4 2.4 显示器的选择............................................................................................................................. 4

2.4.1 LED显示器 ...................................................................................................................... 4 2.4.2 LCD1602液晶显示屏 ...................................................................................................... 4 2.5 小结 ............................................................................................................................................ 5 第三章 硬件电路的设计.......................................................................................................................... 6

3.1 本论文的总体设计思路 ............................................................................................................. 6 3.2 总体硬件电路的设计 ................................................................................................................. 6 3.3 单片机最小系统设计 ................................................................................................................. 7 3.4 温度传感电路和报警电路设计 ................................................................................................ 8 3.5 温度控制电路设计 ................................................................................................................... 10 3.6 显示电路设计........................................................................................................................... 10

3.6.1 液晶显示屏LCD1602简介 .......................................................................................... 10 3.6.2 LCD与单片机接口的连接 ......................................................................................... 11 3.7 小结 .......................................................................................................................................... 11 第四章 系统软件设计............................................................................................................................ 13

4.1主程序设计 ............................................................................................................................... 13 4.2 读温度子程序........................................................................................................................... 14 4.3 温度转换命令子程序 ............................................................................................................... 15 4.4 计算温度子程序....................................................................................................................... 16

4.4.1功能 ................................................................................................................................ 16 4.4.2 温度处理方法 ................................................................................................................ 17 4.5 小结 .......................................................................................................................................... 17 第五章 仿真及性能分析........................................................................................................................ 18

5.1 仿真软件介绍........................................................................................................................... 18

5.1.1 keil C51软件简介 .......................................................................................................... 18 5.1.2 proteus仿真软件简介 .................................................................................................... 18 5.2 仿真分析 .................................................................................................................................. 18

5.2.1 系统仿真及分析 ............................................................................................................ 18

III

5.2.2 实物调试及分析 ............................................................................................................ 21 5.3 性能分析 .................................................................................................................................. 22 5.4 小结 .......................................................................................................................................... 22 第六章 总结与展望 ............................................................................................................................... 23

6.1总结 ........................................................................................................................................... 23 6.2 展望 .......................................................................................................................................... 23 致谢 ......................................................................................................................................................... 24 参考文献 ................................................................................................................................................. 25

IV

1 玉溪师范学院本科毕业设计(论文)

第一章 引言

1.1 研究的背景和意义

当今时代是一个信息技术不断发展创新的时代,而单片机自问世以来,其性能不断提高和完善,集多种优点于一身,如集成度高、功能强、速度快、体积小、功耗低、应用方便、价格低廉等,因此,它在工业检测、智能仪器仪表、数据采集和处理、家用电器等多种领域的应用日渐广泛,正以快速的步伐取代现有的多片微机应用系统。同时,随着人们生活水平的提高,许多基于单片机技术的电子产品也逐渐深入人心,例如,温度计的应用在日常生活中或科研方面就占据着不可或缺的地位。然而,传统温度计的测温特点已经无法满足现代社会生产或生活方面的需要,温度计若要为现代人提供更好的服务则需要从数字化、智能化方向发展。由美国MAXIM/DALLAS半导体公司生产的单总线数字式温度传感器DS18B20具有性能稳定,灵敏度高,抗干扰能力强,使用方便等优点,能将采集到的温度直接发送给单片机进行处理,不需要进行A/D转换,代替了传统的热敏电阻[1]。

传统温度计主要以热敏电阻为温度传感器,虽然其成本低廉,但需后续信号处理电路,且可靠性和准确性低,实时性差,检测系统存在一定误差,此类温度计已无法满足现代社会的需求。而本论文要求设计的数字温度计与传统温度计相比具有多方面的优势,如测温范围广,准确度高,温度传感器直接向单片机输送信号进行处理,且采用数字显示测量温度值等优势。因此,设计基于单片机的数字温度计必将成为社会必然趋势。 1.2 电路工作原理

系统工作原理:

首先,把整体电路设计划分为主控电路设计、温度采集和报警电路设计、温度控制电路设计以及显示电路设计。

其次,按照系统的设计要求,采用DS18B20器件作为本系统的温度传感器进行温度采集,AT89C51单片机芯片为系统的控制中心,完成数据采集,处理,显示,报警等功能。

最后,设计按键电路模块把设定的温度最高值和最低值存入单片机的数据存储器中,系统运行后,温度传感器把采集到的数据与单片机里存储的数据进行比较完成温度控制。采用LCD1602作为系统的显示部分,实时显示温度值。

采用数字温度传感器具有以下优势:省却了传统温度计测温过程中的许多电路转换,如A/D转换电路等,简化了电路,缩短了系统的工作时间,过多的软件程序降

1