1、 目 录 摘 要 . 1 引言 . 1 1 器件简介 . 2 1.1 AT89S52 简介 . 2 1.1.1 主要性能 2 1.1.2 引脚说明 3 1.2 DS18B20 简介 5 1.2.1 主要特性 5 1.2.2 DS18B20 的外形和内部结构 . 6 1.2.3 DS18B20 引脚定义 . 7 2 系统设计 . 7 2.1 功能与设计方案 7 2.1.1 功能要求 7 2.1.2 设计方案 . 7 2.1.2.1 方案论证 7 2.1.2.2 总体设计框图 8 2.2 系统硬件设计 8 3 程序设计 10 3.1 下位机程序 . 10 3.1.1 DS18B20 读写模块 10
2、 3.1.2 数码管显示模块 . 11 3.1.3 RS232 串口通讯模块 12 3.2 上位机程序 . 12 3.2.1 串口初始化 . 12 3.2.2 串口触发接收程序 . 13 3.2.3 界面设计和数据分析统计程序 . 13 结束语 14 附录 15 致谢 29 作者简介 . 错误错误! !未定义书签。未定义书签。 声明 . 错误错误! !未定义书签。未定义书签。 1 基于 51 单片机的温度数据采集系统 摘 要温度是一种被广泛应用于生产和生活的重要的物理量。在许多应用领域,研制适当 和高效的测温系统是十分必要的。本文结合实际使用经验,设计了一个基于 51 单片机和 DS18B20
3、 温 度传感器的近距离温度数据采集系统。该系统主要包括:温度传感器、单片机与 PC RS232 串行接口 通讯、VB 程序、模数转换等部分。在本文设计的中,为了实现人机对话和及时了解系统的运行状况, 特给本系统增加了告警功能。该系统可应用于仓库测温、楼宇空调控制和生产过程监控等领域。 关键词温度测量;DS18B20;单片机;Visual Basic; The temperature data acquisition system based 51 MCU Abstract:Temperature is an important physical quantity that widely use
4、d in production and living. In many applications, its very necessary to develop appropriate and efficient temperature measuring system. Combining with the actual using experience, this article introduces a short distance temperature data acquisition system which designs based on 51MCU and DS18B20. This system mainly includes temperature sensor, MCU, PC RS232 Serial interface, VB programming, and DAC. In this design, in order to realize the man-machine dialogue and prompt understanding the