第一范文网 - 专业文章范例文档资料分享平台

Wireless

来源:用户分享 时间:2025/10/27 17:33:49 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

Wireless Temperature Sensor Network based on DS18B20, CC2420, MCU AT89S52

Fang Xiong

Department of Information Engineering,

Sichuan Tianyi University, Chengdu, 610100, China e-mail: 1106359297@qq.com

Abstract—Wireless sensor network (WSN) has extensive applications including temperature testing. Thus, this paper utilizes three fundamental chips, i.e., DS18B20, CC2420, MCU AT89S52, to design the wireless temperature sensor network (WTSN) via the ZigBee technology. The novel network sequentially transmits the temperature information to the substation, node, computer, thus realizing the wireless

??temperature monitoring. The WTSN holds prominent

Figure 1: Overall network architecture of the new WTSN advantages regarding the high detection precision, the low

power consumption, the high cost performance, and the high

The WTSN consists of several temperature sensors, and reliability. Thus, it could widely apply to the Internet of things

they aim to initially collect environmental temperature. The field to effectively perform the temperature testing.

Keywords-wireless sensor network, wireless temperature

sensor network, temperature sensor DS18B20, wireless chip CC2420, single chip microcomputer AT89S52, technology ZigBee.

temperature information is transferred to ZigBee substations, and finally to the centre node and the further computer.

In fact, the WTSN becomes a star network with a central node and some substation nodes. Next, both the hardware composition and software design of this WTSN will be investigated in detail in Sections 3 and 4, respectively.

III. HARDWARE COMPOSITION

This section introduces the overall hardware structures. First, the temperature probe’s hardware and design are given in Figure 2. The temperature probe system consists of six parts. In contrast to it, the substation has the same hardware composition but different software design. In fact, the probe’ data information is gathered by temperature sensor DS18B20, is transmitted to MCU AT89S52, is displayed by LED, and is sent by wireless chip CC2420. However, the substation’s data information is received by CC2420, is then sent to MCU AT89S52, and is displayed by LED after being unpacked.

I. INTRODUCTION

Wireless sensor network (WSN) extensively integrates the sensor technology, the embedded computer technology, the distributed information processing technology, and the communication technology [1-3]. Thus, WSN synthetically implements the real-time monitoring, perception, and gathering, so widely applies to the equipment monitoring, the warehouse environment monitoring, the vehicle transport, etc. In particular, WSN could be used to the temperature item, and the further wireless temperature sensor network (WTSN) emerges [4,5].

This paper uses three basic chips (DS18B20, CC2420, MCU AT89S52) to design a novel WTSN via the ZigBee technology [6]. The WTSN has merits regarding the high detection precision, low power consumption, high cost performance, and high reliability, thus effectively applying for the practical temperature testing. Next Sections 2-6 give the network architecture, hardware composition, software design, experimental test, and conclusion, respectively.

II.

OVERALL NETWORK ARCHITECTURE

For the new WTSN, this section introduces the overall network architecture. The relevant architecture figure, i.e., Figure 1, is first provided as follows.

Figure. 2: Temperature probe’s hardware and design of the new WTSN

??

??____________________________________

978-1-47????-????????-?? /1??/$31.00 ?201???? IEEE

??

The WTSN mainly adopts the ZigBee protocol. It is a sort of low-power LAN protocols with the IEEE802.15.4 standard. It has the close range, low complexity, low power consumption, and low data rate, thus applying to the automatic and remote control fields. Next, the six hardware parts are studied via six subsections.

294

A.AT89S52

AT89S52 is a kind of low power consumption, high performance CMOS 8-bit microcontroller with 8K Flash memory. It has the deft 8-bit CPU and system-programmable Flash. Moreover, it has a 32-bit I/O port line, the watchdog timer, two data pointer, three 16-bit timer/counter, an interrupt structure with 6-vector and 2-level, a full duplex serial port, and piece inside crystals timely clock circuit. In addition, AT89S52 can reduce to the 0-Hz static logic operation, thus choosing the power saving mode. In the idle mode, CPU stops working to allow the continuative work for the RAM, timer/counter, and serial port. In contrast, in power-fail protection way, the RAM content is saved, the oscillator is frozen, and MCU stops all work, until the next interrupt or hardware reset.

B.DS18B20

DS18B20, launched by DALLAS Semiconductor Company, is a smart temperature sensor. It has several main characteristics. (1) It has a unique way of single wire interface. It needs only a mouth line to connect microprocessors and to realize two’s two-way communication. (2) Any peripheral device is not needed in use. (3) The power supply could be available via the data line, and the relevant voltage has the range: +3.0V~+5.5V. (4) The temperature measurement has the range: ˉ55?~+125?; the inherent resolution regarding temperature measuring is 0.5?. (5) The digital reading pattern with 9~12 bits could be realized by programming. (6) Nonvolatile alarm’s upper and lower thresholds can be set up by users. (7) It supports the networking function with multicast groups. Thus, multiple DS18B20 could be parallel in only three lines to realize the multi-point temperature measurement. Its circuit connection is in Figure 3.

C.PCF8563

PCF8563, launched by PHILIPS Company, is a multi-function clock/calendar chip with low power consumption. Its multiple alarm functions, clock output function, interrupt output functions could complete all kinds of complex timing services. The programmable output frequency is the clock signal with 32.768 kHz/1024Hz/32Hz/1Hz. Setting up PCF8563, could follow the acquisition interval from the user's requirement, and could wake up MCU to gather the temperature and send the signals. Hence, the systematic power consumption is beneficial to be reduced, and a dedicated clock role is implemented by providing the standard time to the system. PCF8563’s circuit connection is in Figure 4.

10k33pF110kU6OSCISCLSDAA0653P3.4P3.5232.768kHzOSCOPCF8563INT7Figure 4: PCF8563 circuit connection Figure 3: DS18B20 circuit connection??

??

D.CC2420

CC2420, launched by Chipcon AS Company, is a standard RF transceiver to satisfy the 2.4 GHz IEEE802.15.4 criterion. In fact, it is the first RF device suitable for ZigBee products, and exhibits the stable performance and low power consumption. CC2420’s selectivity and sensitivity transcend the IEEE802.15.4 standard, thus ensuring short distance communication’s validity and reliability. The CC2420-based wireless communication equipments support the data transfer rate with the highest 250 kbps, thus realizing the rapid networking regarding multipoint to multipoint. The CC2420-based short-range RF transmission system has the low cost, low consumption, and long time power supply for battery. CC2420 is illustrated by Figure 5 as follows.??

295

Figure 5: CC2420 circuit connectionKeyboard Circuit

The user could adjust upper and lower alarm thresholds via the keyboard circuit. This keyboard circuit system sets up five buttons with different functions. (1) The function key exhibits the three states cycle regarding the temperature display, high-temp alarm, low-temp alarm. (2) The ascending key adds 1 to the displayed upper/lower alarm limit. (3) The descending key subtracts 1 to the displayed upper/lower alarm limit. (4) The storage key sets up the new alarm limit. (5) The return key chooses the stored alarm limit as the current alarm threshold by cancelling the current settings, and goes back to show the temperature.

By virtue of only five buttons, we could use the simplest connection approach, i.e., each I/O port corresponds to a button, so the keyboard circuit could be hooked up to MCU’s P2.

E.Display Circuit

The display circuit displays the temperature information monitored. To save costs, it makes the design with six seven-segment digital tubes; hence, 74LS138 chip could be used to select the digital tube display, while 74LS47 display decoder chip could be used to drive the digital tube. The display circuit could be hooked up to MCU P0 interface. Herein, the relevant dispaly circuit is in Figure 6. U319X11812MHz33pFXTAL1XTAL233pF9RSTP0.0/AD0P0.1/AD1P0.2/AD2P0.3/AD3P0.4/AD4P0.5/AD5P0.6/AD6P0.7/AD7P2.0/A8P2.1/A9P2.2/A10P2.3/A11P2.4/A12P2.5/A13P2.6/A14P2.7/A15P3.0/RXDP3.1/TXDP3.2/INT0P3.3/INT1P3.4/T0P3.5/T1P3.6/WRP3.7/RD3938373635343332212223242526272810111213141516177126453ABCDBI/RBORBILT74LS47QAQBQCQDQEQFQG1312111091514U4123ABCY0Y1Y2Y3Y4Y5Y6Y7151413121110971k1k1k1k1k1kQ2PNPQ3PNPQ4PNPQ5PNPQ6PNPQ7PNP293031PSENALEEA10nR61k12345678P1.0/T2P1.1/T2EXP1.2P1.3P1.4P1.5P1.6P1.7AT89S52645E1E2E374LS138Figure 6: Display circuit

IV.SOFTWAREDESIGN

This section focuses on the software design via four relevant subsections.

A.Program Design of Temperature Probe

DS18B20 has a 64-bit ROM to indicate 64 bit serial number. This serial number is determined before delivery, and could be viewed as an address serial number for DS18B20. Thus, each DS18B20 has different serial number. Moreover, DS18B20 includes a scratchpad RAM and an

296

EEPROM. Based on DS18B20’s communication protocol, there are three steps for the CPU to control DS18B20 to finish a temperature conversion. (1) Reset operation is needed for DS18B20 before reading and writing. (2) After the successful reset, send an ROM command. (3) Finally, send RAM command. In summary, only by completing the above steps, can we carry out a predetermined operation on DS18B20.

The temperature probe program includes a main program and an interrupt subprogram; the interrupt subprogram includes timing interrupt subprogram, and an interrupt subprogram of the wireless request of the centre node. The relevant processes are explained by Figure 7 with three sub-figures (i.e., Figure (7a)(7b)(7c)).

Figure 7a: Main program diagram

exists for the SPI bus interface’s address and data transmission. CC2420 chip has 33 16-bit state register; in each register reading/writing cycle, there are 24 bits data for the SI. Concretely, they are 1 bit RAM/register selecting bits (0: register, 1: RAM), 1 bit reading/writing control bits (0: writing, 1: read), 6 bits address selection, and 16 bits data. In the process of data transmission, CSn must always keep at the low level.

MAC command frame is used to send data, and its structure with 18-byte total number is shown in Table 1. Herein, some explanations are provided as follows. (1) Frame head uses 2 bytes (FF, 77). (2) Each DS18B20 has a unique identification code (source ID), so having 4 bytes. (3) Time (including year, month, and date) exhibits a total of 6 bytes, so to transmit the time data obtained by PCF8563. (4) Designing the function code is to realize the interaction of the wireless temperature sensor and the upper CPU. (5) The reserved bytes aim to other applications and settings for the future. (6) Check bytes become the sum of the ahead data bytes.

TABLE I:STRUCTURES OF MACCOMMAND FRAME

Frame header

Identifier code

Time

Temperature

data

Function code

Reserved byte

Checkout

Figure 7b: Subprogram diagram of timer interruption

2 4 6 2 1 2 1 bytes bytes bytesbytes byte bytes byte

Figure 7c: Interrupt subprogram of the wireless request of the centre node

B.Information Modification of Application Layer

Application layer characteristics’ information is stored in the ZigBee.def file. It acts as the application development part, so need modifying in practice.

Define 64-bit MAC address of a node. In particular, the later four bytes are defined by the user, while the first four bytes are the only identifier of the factory. The relevant setting approach is illustrated as follows.

#define I_AM_COORDINATOR

//define current node properties by

coordinator

#define MAX_NEIGHBORS 24

//the max number of child nodes is 24 #define MAX_HEAP_SIZE 2048

//the max content of indirect sending frame

buffer is 2048 bytes

#define CLOCKee_FREQ_16000000 //the CPU clock

frequency is 16 MHZ

#define BAUD_RATE 19200 //the transmission

baud rate is 19200bps C.Data Transfer

CC2420’s work pattern could be set up by 4 line SPI bus (SI, SO, SCLK, CSn); thus, reading/writing cache data and reading/writing status register could be realized. By controlling the FIFO and FIFOP interface state, the transmit/receive buffer is set up. In fact, the MSB priority

D.Program Design of Substations

Each node has a 16-bit short address and a 64-bit long address. The short and long addresses are used for local and other network communication, respectively. Data transmission adopts the tree method. Concretely, the probe sends data to the substation, the substation node sends data to the centre, and finally, the centre node puts data into the computer. The substation program flow is given in Figure 8.

Figure 8: Substation program flow

297

V.TESTING EXPERIENCE

The WTSN is tested in the outdoor environment with no barrier. Temperature is adjusted via liquid nitrogen; sent data bytes are 54 bytes (432 yards); the bit error rate refers to the division of the error number and total element number (432). The concrete results of temperature test are provided in Table 2.

TABLE II:THE MEASURE RESULTS OF THE WTSN

ActualMeasurement temperature Distance Bit error and temperature of wireless temperature bit error rate

(?)(?)

20 ˉ40.5 ˉ400?0.0%?40 ˉ20.3 ˉ200?0.0%?

0.4 0 60 0?0.0%?19.9 20 100 1?0.2%?40.2 40 120 5?1.2%?59.6 60 140 8?1.9%?79.7 80 160 13?3.0%?100.1 100 180 25?6.0%?120.5 120 200 37?8.6%?

transmission distance. Moreover, it holds the great cost

performancehe, the low power consumption, and the high reliability. Therefore, it is worthy of in-depth applications. In practice, the WTSN could widely apply to the Internet of things field to effectively perform the temperature testing, such as regarding the granary environment, the milk shelf life, and the mine environment, etc.

ACKNOWLEDGEMENTS

This work was supported by National Science Foundation of China (61203285) and Key Project of China Sichuan Provincial Education Department (12ZA138).

REFERENCES

[1]

V. C. Gungor, B. Lu, & G. P. Hancke, “Opportunities and challenges of wireless sensor networks in smart grid,” IEEE Transactions on Industrial Electronics, vol. 57, no. 10, pp. 3557-3564, 2010.

D. Incebacak, K. Bicakci, & B. Tavli, “Evaluating energy cost of route diversity for security in wireless sensor networks.” Computer Standards & Interfaces, vol. 39, pp. 44-57, 2015.

S. Halder & S. D. Bit, “Design of an Archimedes’ spiral based node deployment scheme targeting enhancement of network lifetime in wireless sensor networks,” Journal of Network and Computer Applications, vol. 47, pp. 147-167, 2015.

H. Feng& M. Jiao, “The sound and light alarm system of temperature and smoke detecting based on MCU,” Advances in Communication Technology and Systems, vol. 56, no. 309, 2014.

O. Green, E. S. Nadimi, V. Blanes-Vidal, R. N. J?rgensen, I. M. Storm, & C. G. S?rensen, “Monitoring and modeling temperature variations inside silage stacks using novel wireless sensor networks,” Computers and Electronics in Agriculture, vol. 69, no. 2, pp. 149-157, 2009.

J. P. Amaro, R. Cortes?o, F. J. Ferreira, & J. Landeck, “Device and operation mechanism for non-beacon IEEE802.15.4/Zigbee nodes running on harvested energy,” Ad Hoc Networks, vol. 26, pp. 50-68, 2015.

[2]

According to the relevant testing results, the new WTSN system exhibits the high detection accuracy within the range ˉ50?~120?, holding the stable and reliable work. In fact, reliable transmission can be acquired within about 160 metres (with the low error rate). Thus, the WTSN’s reliable transmission distance could be determined as 100 meters, in view of the practical usage cases.

VI.CONCLUSIONS

In this paper, a sort of WTSN is constructed via temperature sensor DS18B20, wireless chip CC2420, MCU AT89S52, as well as the ZigBee protocol. Thus, the new WTSN could acquire the higher testing precision, in ˉ50?~120? temperature range and within the 100-meters

[3]

[4]

[5]

[6]

298

搜索更多关于: Wireless 的文档
Wireless.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c0zf0x16oic8n6j587kkf_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top