当前位置:文档之家› 河南工程学院 毕业论文 英文翻译模板

河南工程学院 毕业论文 英文翻译模板

学校代码:11517

学 号:201050712216

HENAN INSTITUTE OF ENGINEERING

文献翻译

题 目 电子万年历的设计与实现

学生姓名 姚 俊 霞

专业班级 电气工程及其自动化

学 号 201050712216

系 (部) 电气信息工程系

指导教师(职称) 李 娜(讲师)

完成时间 2012年2月17

基于DS18B20分组方式测温系统设计

LI Ping ZHOU Yucai Xiangjun ZENG YANG Ting-fang

Changsha University of Science and Technology,

Changsha 410077, Hunan, P. R. China.

摘要:当用于多点测温时,所有的DS18B20传感器都连接在单片机的某根总线上,采用轮流采集温度数据的方式。当系统有多个传感器时,单片机用于处理温度数据的时间就会明显延长,从而导致测温系统周期增长。在本文中,采取对DS18B20合理的分组的方法,并在软件上采取一定措施,从而明显的提高交替检测速度。

关键词:DS18B20分组/温度测试/交替检测时间

1 引言

DS18B20温度传感器由于其结构简单、安装方便、低损耗以及测温范围宽而被广泛应用于需要多点测温的地方,像化工,粮食,环境监测等等。由于多点温度测试系统采用的是单总线方式,所有的DS18B20传感器挂在一根总线上,然后轮流读取每一个测试点的温度转换值。由于读取单个传感器的转换值需要读8次管脚状态,并要进行移位存储数据,所以系统读取每一点的数据花费的时间不小,如果测温系统规模较大的话,由此造成的系统损耗也是相当大的。从而导致系统的交替检测速度明显下降,极大的影响了多点测温系统的检测效率。本文中,对DS18B20平均分组并挂到多根I/O线上,通过同时读取DS18B20的状态得到转换的温度数据,从而明显提高交替检测速度并降低系统开销,同时又不影响转换精度及可靠性。本文实现了一套人工环境实验室的多点温度测试,明显提高了原有测试系统的检测效率。

2 DS18B20的特性

DS18B20是由美国Dallas公司设计的单线数字温度传感器.它由64位激光刻印ROM、温敏元件、非易失性温度报警触发器TH和TL器件三个部分组成,其与单

片机的通信采用单线接口,DS18B20的测量范围是-55℃到+125℃,增量值为0.5℃。温度变换为数字可在720ms内完成,每一个DS18B20具有唯一的64位的序列号(图1),DS18B20内部有两个8位存储器RAM用来储存温度值(0号和1号),其中0号存储器存放温度值的补码,1号存储器存储温度值的符号。用户可以定义非易失性的温度告警设置并且区分告警搜索命令,寻求组件温度警报状态以外的预定的限制。有两种供电方式:利用信号线高电平时借电供电,或直接用+5V电源。

图1 DS18B2064为ROM

3 应用分组测试方法

本文以DS18B20与89C52的接口说明分组测试方法,假定P1口上的总线数为4,温度测试系统需要100个DS18B20传感器,可将100个传感器平均分配到4根I/O 线上,如果传感器数量不能被总线数整除,可使连在总线上的传感器数量差别不超过1个,这样读数时就能解决。电源采取外部供电,由于每个DS18B20都是同步转换,所以需要较强电流,不能用信号线供电,否则系统无法正常工作。线路连接如图2示(同组的DS18B20信号线都连接在P1口的一根总线上)。当对

DS18B20进行读写时,必须严格保持时序要求。首先给所有的DS18B20发一个复位脉冲,复位后,从各I/O口发送跳转ROM命令,转换以后,向各路同时发匹配ROM命令,接着发送64位序列号,每组选择一个DS18B20 ,读取Scratch Pad 数据,最后进行数据转换,将串行读取的数据转换成实际值,循环读取25次将所有DSl8820温度数据完全读完,一次交替测试完成,整个流程如图3所示。

图2 DS18B20连线图

图3 DS18B20分组方式温度采集流程

现在来分析单总线方式和分组方式测试系统耗时,图4、图5、图6分别为DSl8B20的复位时序、单片机写一位和读一位的时序。DS18B20的复位时间为495us一1020us,写一位时间为60us一120us,读一位时间为60us以上,读写相临一位时间间隔为1us。因为A/D转换时间为97.35ms(9位精度),如果按最短时间计算,整个交替检测时间分别为:

(1)单总线

495us+2*(8*60+7)us+97.35ms+495us+100*(64*60+63+8*60+7+9*60+8)us=552.53 4ms (3-1)

(2)分组模式

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

因为数制转换和存储时间占整个交替检测时间很小,以及无法确定晶振频

率,这里就不计算数制转换和存储时间。因此,分组模式所用时间明显少于单总线模式。

图4 DS18B20时间序列

图5 DS18B20写时序

图6 DS18B20读时序

4 设计实例

沥青运输车是用于原料场和路面之间的主要输送设备,。由于沥青转运车在高寒地区作业或运送距离过长时不可避免的产生温降,这会影响路面的摊铺质

量,所以必须根据外壳的散热情况采取具体的保温措施。本文设计了一套用于沥青运输车外壳温度分布的无线温度测试系统基于DS18B20分组方式,总共120个点。温度测试系统采用主从方式,下位机负责采集数据,存储数据,设置传感器,无线传输等。上位机采用PC机,主要负责接收下位机发送过来的温度数据,并进行显示,存储等数据管理工作以及简单的人机交互。

4.1 系统硬件

考虑到主控芯片需存储多点的温度值并进行数值转换,需要较多内部RAM,因此采用ATMEL公司89C52单片机,其带有256字节RAM和8KB E2PROM程序存储器。因为要对DS18B20的序列号进行区分和编码,所以增加了液晶模块和键盘模块,无线数传部分则选用收发一体式无线模块PTR2000,该模块可以有两个业余频段选择(433.9MHd434.33MHz),波特率可调(最高可达20Kbit/s),可以直接接收单片机串I:I收据。系统硬件结构具体如下图所示,DSl8820采用电源供电方式,共分8组分别挂在P1 El(P1.0-P1.7),无线模块则直接挂在串口上,硬件看门狗采用MAX813芯片.当系统加电时,89C52的复位信号由MAX813的复位管脚输出,复位脉冲的值为200 ms。程序正常运行时,必须在小于1.6s的时间间隔内向MAX813的WDI管脚发送一个脉冲信号,以清除芯片内部看门狗定时器。若超过1.6s该管脚都没收到脉冲信号,则使89C52复位。考虑到系统须存取120个DSl8820的序列号。所以扩展了一片8K带掉电保护功能的数据存取器DSl225。

图7 系统硬件框图

4.2 系统软件功能和流程

温度测试系统软件部分,负责完成对DSl8820的编号、数据采集及转换、无线通讯及键盘管理等,为了调试程序方便,提高可靠性,采用了模块化设计,主

要有键盘处理模块、无线通讯模块、温度采集和处理模块、显示模块等,软件流程具体如图8所示。加电源复位后,89C52首先自检,当自检结束后调用各子程序模块。主程序负责键盘管理、系统初始化及各功能模块的调用。系统中留有口线以实现DSl8820的编程任务。利用键盘和显示配合读取120点DS18B20的序列号,之后编号存入DS1225Y中,一开始无线模块设置为接收状态,以接收采集数据启动命令,转换时,无无线模块设置为休眠状态,在进行温度数据上传时模块设置为发送状态,将温度数据和DS18B20的系统编号发送给上位机。

图8 系统软件流程图

采集和转换部分启动DS18B20转换,分组方式读取温度数据,存储数据等等。以下程序为采集,转换模块的主要内容:

void Get_ Temperature(void)

{ uchar i,j , temp_ lsb, temp_ msb;

for(i=0;i<8;i++)

{skip_rom(i);//跳过序列号检验

write_bytes(0x44 );}

//各路同时开始温度转换

for(j=0;j<100;j++)

//延时0.1s,等待转换结束

{delay(1000);}

For(j=0;j<15;j++)

{ match_ rom(j); read_ scratchpads (j); }

for(j=0;j<120;j++)

{temp_lsb = temp_pad[j][0] ;

//温度值的数据转换

temp_msb = temp_pad[j][1] ;

temp_lsb >>= 4 ; temp_msb <<= 4 ;

temp_lsb |=temp_msb; temp_msb = (temp_lsb/10) ;

temp_msb <<=4 ; temp_lsb %= 10 ;

temp_lsb |=temp_msb; temperature_ vel[j] =

temp_lsb;}}

5 结论

本文作者创新点:

1) 通过分析基于单总线方式和分组方式的多点温度测试系统的交替检测时间的差别,得出分组方式能明显提高交替检测速度;

2) 设计了一套基于DS18B20分组方式的无线多点温度测试系统,这套系统已经用于一家大型机械公司的沥青运输车的技术改造中,并取得良好的效果。

参考文献

[1] ShenJin,SongJingLing. An All-digital Temperature Measuring System Used in Grain

Barns.Transaction of the chese society for Agricultural Machinery,2001,(2):89 91.

[2] LiMinHui,Jung Deqiong. A Device of Temperature Measuremen Made up of DS1820 and

AT89C205. Journal of Sichan Normal University 1997,(5):93-96

[3] Qi ZhiCai,Gai Shuang. Embedded Control System of the CentralAir conditioner

Room,InstrumentTechnique and Sensor 2002,(5):25-26.

[4] ZhangPeiren,ZhouYanping. A Large-Scale Temperature Alarm System Based on 1 Wire Bus

and CAN bus, Control&Automation 2003,(2):25-26

(英文原文)

A Design of the Temperature Test System

Based on Grouping DS18B20

LI Ping ZHOU Yucai Xiangjun ZENG YANG Ting-fang

Changsha University of Science and Technology,

Changsha 410077, Hunan, P. R. China.

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.

I. 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 won’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.

Ⅱ. 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. 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.

Fig 1 DS18B20 64bit ROM

Ⅲ. 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 sensorson 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. The whole flow chart is shown as Fig 3.

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.53 4ms

(2) Grouping mode

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

Fig 3 the diagram of collecting temperature by grouped DS18B20

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

conversion and storage time is not counted. Accordingly, the alternate test time which grouping mode consumes is much shorter than single bus mode obviously

Fig 4 DS18B20 reversion time sequenceFig 4 DS18B20 reversion time sequence

IV. EXAMPLE OF THE DESIGN

The asphalt transportation vehicle is the main transportation equipment between the material field and road surface. The unavoidable temperature decreasing because of the asphalt transportation vehicle’s long working and transportation distance

influences the paving quality of the road surface, the specific measures must be taken according to the heat release of the shell. This paper designed a set of wireless temperature using DS18B20 grouping mode test system for testing the temperature of the asphalt transportation vehicle shell, and the total points is 120. Temperature test system software adopts the modular design. The hypogenous machine collects data, stores data, sets up DS18B20, and sends the wireless module and so on. The epigenous machine adopts PC machines, mainly receives the temperature data from the hypogenous machine. The epigenous machine displays, stores and manages data. The simple communication between people and machines is performed by the epigenous machine. This paper will not illustrate the simple procedure of the epigenous machine in detail. The following is the illustration of parts of hypogenous machine. including the components of system hardware , software functions and process.

A. System hardware

Considering the multipoint temperature number of the temporary storage and the considerable internal RAM during the value conversion, the chief controlling chip adopts ATMEL 89C52 Single-Chip Microcomputer with 256 bytes RAM and 8KB

E2PROM procedure storage. As the distinguishable code of DS18S20 is read and numbered, the liquid crystal module (Ao Kela Chinese integrated module of

OCMJ Jin Peng Company) and the keyboard module are added. The wireless digital transmission adopts the wireless module PTR2000 in the whole reception-sending form, which may has two amateur bands to choose and the regulative Baud

Rate ( the max is 20Kbit/s), and the Single-Chip Microcomputer serial port data can be received directly. The system hardware structure is shown as Fig 7: DS18B20, with the power supply, divided into 8 groups hung on P1 port

(P1.0-P1.7). The wireless module is hung on serial port directly and the hardware watchdog adopts the MAX813 chip. When the power is added to the system, the

89C52 reversion signal is transmitted from the MAX813 reversion pin, and the value of the reversion pulse is 200ms. When the procedure is in order, a pulse signal must

be sent to MAX813 WDI pin in no more than the interval of 1.6s to clear away the watch-dog timer. If the interval is more than 1.6s, the pin does not receive the pulse signal, and then the 89C52 must be reversed. As 120 DS18B20 serial numbers must be stored in the system, the data storage DS1225 (8K) against the power failure is developed.

B. System software function and process

The software part of the temperature test system numbers DS18B20, collects and transforms data, performs the wireless communication, manages keyboard and so on. For the convenience of the procedure debugging and the reliability, the module design is adopted, mainly including the keyboard processing module, the wireless communication module, the module of temperature collection and processing, the display module and so on. The software flow chart is shown as Fig 8 After the reversion of add power 89C52 self-checks first, then allocates each branch procedure module. The chief procedure manages the keyboard, initializes the system and transfers each functional module. The haul line is kept to perform DS18B20 edit mission. 120 points serial number of DS18B20 is read by the keyboard and display coordination and numbered into DS1225Y. First the wireless module is set up as the reception state to receive the collection parameters and start the order (The transmission content is sent by pack ; the same content is sent for three times ; two out of three logic is performed according to the bit).

The wireless module is set up as the sleep state during the conversion and the transforming state during the temperature data transmission. Packing sends the temperature data and the DS18B20 numbers in the system to epigenous machine. The parts of collection and conversion start the DS18B20 conversion, read the temperature data by grouping methods, store data and so on. The following procedure is the main content of collecting and conversion modules:

void Get_ Temperature(void)

{ uchar i,j , temp_ lsb, temp_ msb;

for(i=0;i<8;i++)

{skip_rom(i);//skip over the serial numbers to check

write_bytes(0x44 );}

//transform the temperature in each circuit at the same time

for(j=0;j<100;j++)

// prolong the time for 0.1s; wait for the end of conversion

{delay(1000);}

For(j=0;j<15;j++)

{ match_ rom(j); read_ scratchpads (j); }

//each temperature value is read in 8 buses

for(j=0;j<120;j++)

{temp_lsb = temp_pad[j][0] ;

//the data conversion of the temperature value

temp_msb = temp_pad[j][1] ;

temp_lsb >>= 4 ; temp_msb <<= 4 ;

temp_lsb |=temp_msb; temp_msb = (temp_lsb/10) ;

temp_msb <<=4 ; temp_lsb %= 10 ;

temp_lsb |=temp_msb; temperature_ vel[j] =

temp_lsb;}}

V. CONCLUSION

Authors create the following new ideas

1)Alternate test time difference of the multipoint temperature test system in the grouping method and the single bus method is analyzed, then the alternate test speed can be increased greatly by grouping method.

2)A set of wireless multipoint temperature test system is designed by DS18B20 grouping method. This system is applied to the technology reform of the asphalt transportation vehicle in some domestic large-scale engineering mechanical company and the good result of the application is achieved.

REFERENCES

[1] ShenJin,SongJingLing. An All-digital Temperature Measuring System Used in Grain

Barns.Transaction of the chese society for Agricultural Machinery,2001,(2):89 91.

[2] LiMinHui,Jung Deqiong. A Device of Temperature Measuremen Made up of DS1820 and

AT89C205. Journal of Sichan Normal University 1997,(5):93-96

[3] Qi ZhiCai,Gai Shuang. Embedded Control System of the CentralAir conditioner

Room,InstrumentTechnique and Sensor 2002,(5):25-26.

[4] ZhangPeiren,ZhouYanping. A Large-Scale Temperature Alarm System Based on 1 Wire Bus

and CAN bus, Control&Automation 2003,(2):25-26

相关主题
文本预览
相关文档 最新文档