一种基于DS18B20的温度探测系统外文翻译资料

 2022-11-27 15:10:22

A Design of the Temperature Test System Based

on Grouping DS18B20

【Abstract】 All the DS18B20 sensors, used for the multipoint test temperature, are connected with MCU on one of IO bus, and temperature data are collected by turns. If the system has a large amount of sensors, the time of MCU used in processing the temperature data is obviously prolonged, so the cycle of alternate test gets longer. In this paper, a new method that DS18B20 are rationally grouped is presented, and some measures are taken in software; as a result, the speed of alternate test advances distinctly.

Key Words】 DS18B20 Group, temperature test, time spent on the alternate test.

1. INTRODUCTION

As the simple structure, convenient installment, low loss and wide range of temperature test, DS18B20 temperature test sensors are applied to the fields which need the multipoint temperature test, such as the chemical industry, the grain, the environment supervision and so on. Because of the adoption of one bus in the DS18B20 multipoint temperature test system, all DS18B20 are hung on one bus, and then the temperature conversion value of each test point is read by turns. As the conversion value must be read after reading-pin state for 8 times, and position and store data must be moved, so time spend much in reading one point of the data system by every time. If the temperature test system is large-scaled, the system loss caused by it is rather much, and then the alternate test speed of the system decreases obviously, which influences the efficiency of the multipoint temperature test system seriously. In this paper, DS18B20 are hung on some I/O buses by grouping DS18B20 evenly, and the conversion temperature data is obtained by reading the state of DS18B20, then the system loss decreases and the alternate test speed increases obviously, which wonrsquo;t influence the precision and the reliability of the conversion. A set of multipoint temperature test of artificial environment laboratory is achieved in this paper, which increases the test efficiency of the former system.

2. CHARACTERISTICS OF DS18B20

DS18B20 is the single bus digital temperature sensor from American Dallas Company. DS18B20 is consisted of the 64 figures ROM engraved by laser, the temperature sensitivity component, non-volatile temperature alarms trigger (Device TH and TL).DS18B20 communicates with the microprocessor by the single bus port and the test range of DS18B20 is from -55 centigrade to 125 centigrade, and the incremental value is 0.5 centigrade. The temperature can be changed into figures within 720ms and each DS18B20 has the sole 64 figures serial number.

Fig 1 DS18B20 64bit ROM

The specific content is revealed as Fig 1: There are two 8 figures storages (No.0 and No.1) for storing temperature value in DS18B20. No.0 storage stores complement of the temperature value, and No.1 stores symbols of the temperature value. The user can define non-volatile temperature alarms sets and distinguish the alarms search order and seek the component temperature alarms state outside the scheduled limit. There are two alternative ways of power supply: Signal bus high-level borrow power is adopted, or the 5v power supply externally is adopted directly.

3. APPLICATION THE GROUPING TEST METHOD

This paper illustrates the grouping method with the interface of DS18B20 and 89C52. Assuming the amount of the buses on P1 port is 4 and the temperature test system needs 100 DS18B20 sensors, which can be distributed equally to the 4 I/O lines. If the number of sensors cannot be divided by the number of buses even, the number disparity of sensors on buses is no more than one, which can be handled while reading numbers. The power is supplied externally. Owning to the synchronistic conversion in each DS18B20, the intense current is needed, and the signal bus cannot be used for the power supply, otherwise the system cannot work in order. The schematic circuit is shown as Fig 2 (the DS18B20 signal buses of the same group are hung on some buses of P1 port). When read and write the DS18B20, the strict schedule must be kept. First a reversion pulse is sent to all DS18B20. After the reversion, Skip ROM order is sent to each circuit simultaneously from the I/O port, and the conversion order is sent, then all sensors begin transform. After the conversion, Match Rom order is sent to each circuit simultaneously, and 64 bits serial number is sent. DS18B20 is selected for each group, and Scratch Pad data is read. Finally the data is transformed. The data of serial-read is transformed into the actual temperature value. One alternate test is finished after the DS18B20 temperature data is read completely by the cyclical reading for 25 times.

Fig 2 DS18B20 grouping sketch map

Now the time-consuming in the test system of the single bus and the grouping analyses method is illustrated respectively. The reversion time sequence and the time sequence of writing and reading one bit for the microprocessor are revealed in figures 4-6. The figure show: The reversion period of DS18B20 is 495us-1020us; the writing period of one bit is 60us-120us; the reading period of one bit is above 60us; the span of writing or reading the next bit is 1us. As the A/D conversion time is 97.35ms (9 precisions), if it is counted by the shortest way, the total time-consuming of alternate test is calculated respectively as follows:

(1) Single bus

495us 2*(8*60 7)us 97.35ms 495us 100*(64*60

63 8*60 7 9*60 8)us=552.534ms

(2) Grouping mode

495us 2*(8*60 7)us 97.35ms 20(64*60 63 8*60 7 9*60 8)us=189.804ms

As the small proportion of the numeration system conversion and the storage time in the whole period, the unknown crystal-oscillator frequency, the numeration system c

剩余内容已隐藏,支付完成后下载完整资料


一种基于DS18B20的温度探测系统

摘要:所有用于多点温度测试的DS18B20传感器,与IO总线和MCU连接,轮流收集温度数据,如果系统有大量的传感器,MCU用在处理温度数据的时间就会明显延长,因此交替测试周期变得更长。在本文中,一种DS18B20可以合理组合的新方法产生了,并且在软件方面也有一些新措施。因此,交替测试试验发展迅速。

关键词:DS18B20;温度测试;交替测试时间

  1. 引言

DS18B20温度传感器是一种结构简单、安装方便、损耗低、测温范围广的传感器,适用于化工、粮食、环境监理等多点温度测试领域。由于DS18B20多点温度测试系统采用一路总线,所有DS18B20都挂在一个总线上,每个测试点的温度转换值依次读取,并且必须移动位置和存储数据,所以每次读取数据系统的一个时间点花费大量时间。如果温度测试系统规模大,造成的系统损耗较大,则系统的交替测试速度明显下降,严重影响多点温度测试系统的工作效率。本文通过对DS18B20进行统一分组,将DS18B20挂在一些I/O总线上,通过读取DS18B20的状态获得温度数据,从而减少了系统损耗,交替测试速度明显提高,不会影响转换的精度和可靠性。实现了一套人工环境实验室多点温度测试,提高了测试系统的测试效率。

二、DS18B20的特点

DS18B20是美国达拉斯公司的单总线数字温度传感器。DS18B20由激光刻的64个数字ROM、温度敏感元件、非易失性温度报警器(器件TH和TL)组成,DS18B20与单片机通过总线端口通信,DS18B20的测试范围从55摄氏度到125摄氏度,增量值为0.5摄氏度,每个DS18B20具有唯一的64位序列号。图1揭示的具体内容为两个数字储量(0号和1号),用于存储DS18B20的温度值。0号存储存储器温度值,补充一号存储器温度值的符号。用户可以定义温度报警台和区分报警搜索命令,并寻求组件预定温度额度以外的报警状态。有两个电源的替代方法为高级别借用信号总线的电源或直接采用 5V外部电源。

图1 DS18B20的64位ROM

三、应用程序的分组试验方法

本文阐述了分组法以及DS18B20与单片机的硬件接口方法。假设P1端口上的总线数量为4,温度测试系统需要100个DS18B20传感器,它们可以均匀地分配到4个I/O线路上。如果传感器的数目不能按总线数目划分,则总线上温度传感器的数目相差不超过一个,方便在读取数字时处理。电源由外部供应,因为每个DS18B20的同步转换需要强烈的电流,不能用信号线电源,否则系统无法正常工作。原理电路如图2所示(同一组的DS18B20信号总线挂在P1端口的一些总线上)。读写DS18B20时,必须保持严格的进度。首先,将反转脉冲发送给所有DS18B20,在反转后,跳过ROM命令同时从I/O端口发送到每个电路,并发送转换顺序,然后所有传感器开始转换,转换后,匹配ROM顺序发送到每个电路,并发送64位序列号,每个组选择DS18B20,读取便笺数据,最后对数据进行转换,串行数据转换为实际温度值。通过循环读取25次DS18B20温度数据,完成一次交替测试。

图2 DS18B20的分组示意图

这里分别介绍了单总线测试系统的耗时以及分组分析方法。微处理器的读写时序为DS18B20的逆转期495us-1020us;1位写作时间是60us-120us;1位读取时间为60us以上;书写或阅读下一位的时间跨度是微秒。A/D转换时间97.35ms(精度为9),如果它是由耗时最短的交替测试方法计算,总耗时分别计算如下:单总线:

495us 2*(8*60 7)us 97.35ms 495us 100*(64*60 63 8*60 7 9*60 8)us=552.534ms

分组模式:

495us 2*(8*60 7)us 97.35ms 20(64*60 63 8*60 7 9*60 8)us=189.804ms

数制转换和存储的时间占整个时期的比例小,未知的晶体振荡器的频率、数制转换和存储的时间不计算在内。因此,分组模式消耗的交替测试时间明显比单总线模式短。

  1. 设计示例

沥青运输车是物料场与路面建设之间的主要运输设备。由于沥青运输车辆的长期工作和运输距离不可避免地降低了温度,影响了路面的摊铺质量,必须根据路面的散热情况采取具体措施。本文设计了一套利用DS18B20分组方式测试沥青运输车壳温度的无线测温系统,其总点数为120。温度测试系统软件采用模块化设计。下位机采集数据、存储数据、设置传感器,发送无线模块等。上位机采用PC机,主要接收来自下位机的温度数据,上位机显示、存储和管理数据。人与机器之间的简单通信是通过上位机进行。本文不详细阐述上位机的简单流程,以下是对下位机部分的说明。

1、系统硬件

考虑到要存储多点的温度值以及数值转换过程中需要相当大的内部RAM,主控制芯片采用ATMEL 89C52单片机,256字节RAM和8KB E2PROM程序存储计算机。由于要读取DS18S20区分代码并且编号,需要液晶模块(奥克拉中国集成模块OCMJ金鹏公司)和键盘模块。无线数字传输采用无线module375接收和发送,其中有两可选择业余频段和可调节波特率(最大是20kbit/s),它可以直接接收单片机串行口的数据。DS18B20分为8组(P1口挂p1.0-p1.7),无线模块采用MAX813芯片直接挂在串口。当系统上电后,逆向信号从MAX813引脚发送,回复脉冲值为200ms。在这过程中,间隔不超过1.6s的脉冲信号必须送到MAX813 WDI引脚来清除看门狗定时器。如果间隔超过1.6s未接收脉冲信号,单片机必须翻转,由于系统中必须存储120个DS18B20序列号,因此开发了针对电源故障的数据存储DS1225(8K)。

  1. 系统软件功能和实现过程

温度测试系统的软件部分负责采集和转换数据,进行无线通信,管理键盘等。为方便程序调试和保障程序运行的可靠性,采用模块化设计,主要包括键盘处理模块、无线通信模块、温度采集与处理模块、显示模块等。主程序管理键盘,初始化系统,并传送各个功能模块。传输线保持执行DS18B20编辑任务。120个DS18B20的序列号由键盘读取,并且编号为DS1225Y。无线模块设置为接收状态接收采集到的参数和启动顺序(传输内容发送的包;相同的内容发送三次;三个逻辑是根据比特执行),无线模块在温度数据传输过程的转换中设置为睡眠状态,打包发送温度数据和DS18B20的序列号到上位机系统,采集转换部分启动DS18B20转换,通过分组方法读取温度数据,存储数据等。

  1. 结论创建以下新思路
  2. 分析了分组法和单总线法多点温度测试系统的交替测试时差,采用分组法可大大提高交替测试速度。

2、利用DS18B20分组方法设计了一套无线多点温度测试系统。该系统已应用于国内某大型工程机械公司沥青运输车辆的技术改造,取得了良好的应用效果。

参考文献

[1] 沈静,宋金玲.粮仓全数字测温系统.中国农业机械学会学报.2001(2):89-91

[2] 李敏辉,金邓琼.一种由DS18B20和AT89C51组成的温度测量装置.四川师范大学学报.1997(5):93-96

[3] 齐志才,ˈ盖双.中央空调机房嵌入式控制系统.仪器技术与传感器.2002(5):25-26

[4] 张培仁,周艳萍.基于CAN总线的控制与自动化的大型温度报警系统.2003(2):25-26

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[22139],资料为PDF文档或Word文档,PDF文档可免费转换为Word

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

发小红书推广免费获取该资料资格。点击链接进入获取推广文案即可: Ai一键组稿 | 降AI率 | 降重复率 | 论文一键排版