基于LabVIEW和单片机的虚拟温度检测系统设计毕业论文

 2021-04-07 11:04

摘 要

随着计算机技术,特别是单片机技术的高速发展,人们开始更加普遍的尝试运用单片机来对温度、湿度等工业控制中常见的参数进行测控,另一方面虚拟仪器已经渐渐地成为测控仪器发展的新方向。通过LabVIEW图形化编程实现对单片机系统采集的数据进行分析处理,就是一种结合二者优势的数据检测方法。

本设计分为上下两个部分,下位机的作用是通过测温传感器DS18B20和STC89C51单片机实现对温度的采集,利用数码管显示温度值,并将采集到的温度数据通过串口通信发送给上位机;上位机LabVIEW的作用是利用VISA节点接收下位机发送的温度数据,通过数值转换以图表的形式直观的输出温度的变化曲线。根据需要还可以实现温度报警以及温度数据的保存。上位机的工作都是通过LabVIEW编程实现的。

由于LabVIEW软件本身具有功能强大的VISA库,能够实现串口通信功能,使得该温度检测系统的设计大大简化,具有很强的灵活性和扩展性。

关键词:51单片机;LabVIEW;接口;DS18B20;温度检测

The review of virtual temperature detection system design

ABSTRACT

With the development of computer technology, especially the rapid development of MCU technology, people began to try to more general use single-chip microcomputer to some parameters of the temperature, humidity and other industrial control in common and, on the other hand, virtual instrument has gradually become the new direction of the development of measurement and control instruments. Through the LabVIEW graphical programming, the data collected by SCM system is analyzed and processed, and it is a data detection method which combines the advantages of the two..

The design is divided into two parts, the lower position machine is the acquisition of temperature through the temperature sensor DS18B20 and MCU STC89C51. The use of digital tube display the temperature value, and the collected temperature data through serial communication to send to the host computer, LabVIEW is the visa node receives the next bit machine to send the temperature data. Through numerical conversion to chart in the form of intuitive output temperature change curve. According to the need to realize temperature alarm and temperature data preservation. The work of the upper computer is realized by LabVIEW programming..

Since LabVIEW software has powerful VISA library, it can realize the serial communication function, and the design of the temperature detection system is greatly simplified, and has strong flexibility and expansibility.

Key words:MCU;LabVIEW;interface;DS18B20;temperature detection

目 录

1 绪论 - 1 -

1.1 课题研究的目的及意义 - 1 -

1.2国内外同类研究的发展概况 - 1 -

1.3 课题研究的内容 - 2 -

2 系统总体方案的设计 - 3 -

3 下位机硬件系统和程序设计 - 5 -

3.1 单片机 - 5 -

3.1.1 单片机概述 - 5 -

3.1.2 STC89C51单片机简介 - 5 -

3.2  DS18B20温度传感器 - 6 -

3.2.1 DS18B20温度传感器简介 - 6 -

3.2.2 DS18B20的工作时序 - 7 -

3.2.3 ROM操作命令 - 9 -

3.3 下位机电路图设计 - 10 -

3.3.1 Proteus仿真软件应用 - 10 -

3.3.2 下位机电路 - 11 -

3.4 单片机程序的编写 - 12 -

3.4.1 Keil编译器软件应用 - 13 -

3.4.2 下位机程序设计 - 13 -

4 上位机LabVIEW的程序设计 - 15 -

4.1 虚拟仪器 - 15 -

4.1.1 虚拟仪器的概念 - 15 -

4.1.2 虚拟仪器的主要特点 - 15 -

4.1.3 虚拟仪器的体系结构 - 16 -

4.1.4 虚拟仪器的硬件构成 - 16 -

4.1.5 虚拟仪器的软件构成 - 17 -

4.2 LabVIEW概述 - 18 -

4.2.1 LabVIEW简介 - 18 -

4.2.2 LabVIEW的发展历程 - 18 -

4.3 VISA简介 - 19 -

4.4 LabVIEW程序设计 - 21 -

4.4.1 主程序 - 21 -

4.4.2 温度采集部分 - 23 -

4.4.3 数值转换部分 - 23 -

4.4.4 显示和报警部分 - 24 -

5 系统的整体调试 - 26 -

5.1 下位机调试 - 26 -

5.2 上位机调试及温度采集 - 27 -

结 论 - 31 -

致 谢 - 32 -

参考文献 - 33 -

附录A - 34 -

1 绪论

1.1 课题研究的目的及意义

温度是用来表示冷热程度的一个物理量,它与我们的生活密切相关,无论是日常生活还是科学研究都离不开温度的检测。当前的测温系统大都采用的是电子仪器,然而传统的电子仪器的功能都是使用软件或硬件的方法进行固化的。这使得它只可以由厂商制造,并且其用途和规格一般都是确定的,用户没有办法转变其结构和用途[1]

随着计算机技术和单片机技术的高速发展,人们开始更加普遍的运用单片机技术来对温度、湿度等工业控制中常见的参数进行测控。计算机的控制功能十分强大,利用计算机的RS-232串口与外部硬件测量系统通信,是很多检测系统经常使用的通信方法。LabVIEW采用图形化的编程语言,具有灵活、简单易用的优势,常常被用在参数的测量与控制、信号分析与处理等方面[2]。数据的采集是仪器开发过程中非常重要的一环,选用STC89C51单片机作为下位机进行数据采集,然后利用串口与上位机LabVIEW进行数据传送。通过这种方式实现的数据采集系统无疑是灵活简单并且易于操作的。这种方案对信号频率不高的的场合提供了很大的便利。

1.2国内外同类研究的发展概况

您需要先支付 80元 才能查看全部内容!立即支付

课题毕业论文、开题报告、任务书、外文翻译、程序设计、图纸设计等资料可联系客服协助查找,优先添加企业微信。