Design and Implementation of a ZigBee

Design and Implementation of a ZigBee
Hung-Cheng CHEN, Long-Yi CHANG
National Chin-Yi University of Technology
Design and Implementation of a ZigBee-Based Wireless
Automatic Meter Reading System
Abstract. ZigBee is a new global standard for wireless communications with the characteristics of low-cost, low power consumption, and low data
rate. It has a good market in wireless meter reading. The design and implementation of a ZigBee-based wireless automatic meter reading system
are proposed in this paper. The experimental results show that the design can meet the basic needs of automatic meter reading with flexibility and
expansibility. It can act as a platform of wireless monitor system and supplies a new hardware design approach for wireless ZigBee networks.
Streszczenie. Zaproponowano wykorzystanie sieci bezprzewodowej ZigBee do automatycznego odczytu stanów liczników. (Projekt i
zastosowanie scieci ZigBee do automatycznego odczytu stanów liczników)
Keywords: ZigBee, Wireless communications, Automatic meter reading system
Słowa kluczowe: ZigBee, liczniki energii
Introduction
With the rapid development of automation and
measuring techniques, automatic recording of the data in
the meter reading instrument has gradually become the
target of people whose working, living, and home conditions
are of increasingly high level of intelligence. Meanwhile,
utilities also hope that the development of new technologies
to solve the problems they encountered in the practical
work about cumbersome meter reading and no reliable
protection of accuracy and real time; and enable both userfriendly and improving public sector efficiency and
management level. Existing wire-line meter reading system
has a large number of risks. Wires are more complex,
detrimental to adjustment and maintenance of the system.
The long-term indoor and outdoor installation easily leads to
aging, resulting in a risk of short circuit and breakage. For
these reasons, it has become the industry very unresolved
problem to design a remote meter reading system, with
long-term reliance and convenient installation &
maintenance, which not only read data automatically but
also monitor operation status.
With the development of wireless communication
technology, in recent years there comes requirement for low
cost equipment of wireless networking technology, called
ZigBee. It is a short range, low-complexity, low cost, low
power consumption, low data rate two-way wireless
communication technology with high network capacity, short
time delay, safety and reliance. Its main application areas
include industrial controls, consumer electronics, car
automation, agricultural automation, and medical equipment
control. The core of this technology is established by IEEE
802.15.4 Working Group, and the ZigBee Alliance founded
in 2002 is responsible for high-level applications,
interoperability testing, and marketing. Till now, the ZigBee
Alliance has reached over 150 members of famous
companies in the world including IBM, Ember, Mitsubishi,
Motorola, and Philips, etc [1]. Many semiconductor
companies are targeting the ZigBee market. Since the
standards were launched not long ago, chips in line with
protocol have Been available of multi- chip solution and
single-chip solution. It can be expected that ZigBee will
have comprehensive applications in the field of automation.
The main methods of metering at home and abroad are:
manual meter reading, IC Card prepaid meter, wire-line and
wireless meter reading system. Manual meter reading has
Been for decades, but with the implementation of one home
one meter, drawbacks of this method of reading are more
and more, like difficult entrance to home, low efficiency of
fee settlement, etc. Along with the development electronic
technology, IC card prepaid meter, which uses pay-before-
64
use, favors to management sector. Since it does not need
meter reading on site, partially solve the problem of manual
meter reading because of no need to be on site. But some
problems exist in the actual operation process: IC card
meter is easily damaged due to its direct contact with user
and no real-time monitoring. It also fails to avoid theft,
damage, and fault of meter. Wire-line metering control
system has the advantage of IC card, and at the same time
can take full advantage of telephone network, power line
network, a cable TV network, and RS-485 bus net, etc. It
enables real-time metering, real-time monitoring, and realtime control, and can also detect equipment damage, illegal
use, etc. But there are some issues: piping, cable wiring, so
it needs to design in advance. In addition, it also has
problems of long construction period, high installation cost
and maintenance cost, expansion of the system upgrade
and compatibility with other network.
ZigBee wireless meter reading refers to the use of shortrange wireless communication technology and computer
network technologies to read and process metering data
automatically. Wireless automatic meter reading technology
can not only save human resources, but more importantly
may improve the accuracy and real time of the meter,
enabling management sector to access to data messages
timely and accurately. No cable wiring can save human and
material resources, so investment is considerably
economical. Wireless communication links can be quickly
built, engineering cycle significantly shortened, and has
better scalability compared to a wire-line system [2,3]. If a
fault occurs, only check wireless data module for causes
quickly, and then restore the system back to normal
operation[1].
ZigBee Wireless Sensor Networks
ZigBee technology is a bidierectional wireless
communication technology of short distance, low
complexity, low cost, low power consumption, and low data
rate, mainly used in automatic control. It mainly works on
2.4GHz ISM band with 20~250kbit/s data rate, 100m~1.5km
maximum transmission range, and a typical 100m distance
[4]. The technical features include:
(1) Security: ZigBee provides data integrity check and
authentication, and uses AES-128 security algorithm.
Each application has the flexibility to determine its
safety properties.
(2) Reliability: It uses collision avoidance mechanism, and
at the same time it reserves a dedicated time slot to
require a fixed bandwidth of the communication
service, avoid the competition and conflicts when data
is sent. MAC layer uses a full confirmation of data
PRZEGLĄD ELEKTROTECHNICZNY (Electrical Review), ISSN 0033-2097, R. 88 NR 1b/2012
transfer mechanisms, and each packet of data sent
must wait to receive confirmation.
(3) Low cost: the initial cost of module estimates about
US$6, and soon will fall between US$1.5 and US$2.5,
and ZigBee Protocol is free of royalties.
(4) Power saving: as the duty cycle is very short,
transmitting and receiving information has lower power
consumption, and using the hibernation mode, ZigBee
technology ensures that two N size batteries can
support from 6 months to 2 years. Of course, different
applications have power different power consumptions.
(5) High network capacity: a ZigBee network can
accommodate a maximum of 65536 devices.
(6) Short delays: enhanced communication delays for
delay-sensitive applications. Communication delay and
sleep wake up time delay are very short. Typical device
search delay is 30ms, typical sleep wake up time delay
is 15ms, and active channel access delay is 15ms.
Main applications of ZigBee are within short range and
data transfer rate among the various electronic equipments
is not high. The typical transfer data types are periodical
data (such as sensor data), intermittent data (such as
lighting control), and repetitive low latency data (such as a
mouse).
Because Bluetooth, Wi-Fi, and ZigBee all belong to
802.15 protocols, technical characteristics have many
similarities. Characteristics comparison is shown in Table 1.
Since transmission distance of Bluetooth and Wi-Fi is less
than 100m, it is a huge obstacle in the larger network. Thus
it is difficult to form wireless communication network, while
the maximum transmission range of ZigBee is 100m
~1.5km, which is ideal for the establishment of the network.
Secondly, it can only accommodate up to 8 nodes in a
Bluetooth network, but a typical network needs more
devices nodes, and ZigBee can accommodate 65536
nodes. Finally, module costs of Bluetooth and Wi-Fi are
relatively high. In addition, the power consumption of
Bluetooth and Wi-Fi compared to ZigBee is much higher,
because ZigBee is low cost and very low power
consumption. Although transmission data rate of Bluetooth
and Wi-Fi is higher than that of ZigBee. But the 250kbit/s
data rate of ZigBee is enough for use in automatic meter
reading network, thus the ZigBee technology is selected.
Table 1. Performance comparison of ZigBee, Bluetooth, and Wi-Fi
Performance
ZigBee
Bluetooth
Wi-Fi
Working
frequency
2.4GHz、
868/915MHz
System resource
4Kbyte~32Kbyte 250Kbyte
1Mbyte
Comm. range
0.1~1.5km
0.1km
0.1km
Data rate
250 Kbps
1Mbps
11Mbps
Max. network
nodes
65536
8
32
Wake-up time
30ms
10s
3s
Encryption
128 bits AES
128 bits
SSID
Low power
consumption
Support
No support No support
2.4GHz
2.4GHz
communicate among nodes in the network via different
routes. Network not only has good scalability, but also
makes data transmission more reliable. Multiple subnets
can be connected at the same time to form a large,
geographically dispersed network, making cross-zone
metering and control be easily achieved.
Star topology diagram
Cluster topology diagram
Mesh topology diagram
Fig.1. Typical ZigBee network architecture
System Structure
The wireless automatic meter reading system described
in this article can send data from a number of digital watt
meters to the collector through RS-485 communication
protocol, and transfer the data to ZigBee/GPRS Gateways
through ZigBee Wireless communication network, then
back to PC or the database in RS-232 communication
format via GPRS as shown in Fig. 2. The wireless
communication network in the middle uses JN5121 ZigBee
modules produced by Jennic Company in combination with
G-4500 GPRS remote communication devices developed
by ICP DAS, forming a wireless communication network.
RS485 BUS
RS485 BUS
ZigBee Router
(FFD Node1)
ZigBee Router
(FFD Node2)
GPRS
ZigBee
Network
(Tree,
Mesh,
Star)
Zigbee/GPRS
Gateway
(FFD Node0)
Router
RS485 BUS
ZigBee Router
(FFD NodeM)
PC
Database
Test System
Fig.2. System structure of wireless automatic meter reading system
Typical Topology of Wireless Meter Reading System in
ZigBee Network
ZigBee network supports star, cluster tree, and mesh
network architectures as shown in Fig. 1 [1]. ZigBee
network has self-organizing and self-healing capabilities,
and supports complex network topology, making message
Complete ZigBee protocols consist of the high-level
application specification, application aggregation layer,
network layer, data link layer and physical layer, as in Fig.
3. Protocols above network layer are defined by ZigBee
Alliance, and IEEE 802.15.4 is responsible for the physical
layer and link layer standards [5-10].
PRZEGLĄD ELEKTROTECHNICZNY (Electrical Review), ISSN 0033-2097, R. 88 NR 1b/2012
65
Application layer interface
Security
32-/64-/128Ecryption
ZigBee
Alliance
Network layer
MAC
IEEE
802.15.4
(PHY)
868MHz/915MHz/2.4GHz
Fig.3. ZigBee protocol stack
The physical layer defines the access between wireless
physical channels and MAC sub-layer, and provides
physical layer data service and physical layer management
service. Main functions of a physical layer data service are:
wake/sleep of RF transceiver devices, energy tests on the
current channel, link quality instruction, carrier sense
multiple access with collision avoidance (CSMA-CA) for
assessment of spatial channel, channel selection, data
transmission and reception.
IEEE 802.15.4 defines two physical layer standards for
choices, but both are based on direct sequence spread
spectrum technology, namely 2.4GHz Physical layer and
868/915MH physical layer. They use the same physical
layer data packet format, but differ by working frequency,
modulation, spread spectrum code length and transfer rate.
2.4GHz Band is ISM Band for the global unification
without the application, help ZigBee equipment with
promotion and reduction of production costs. 2.4GHz
physical layer can deliver transfer rate of 250kb/s through
the use of higher-order modulation technology, help to
achieve higher throughput, less communication delays and
shorter duty cycles and thus more power saving.
915MHz is ISM band in the United States, and 868MHz
is ISM band in Europe. The two bands were introduced to
avoid 2.4GHz mutual interference of various wireless
communication equipments in the vicinity. The transfer rate
is 20kb/s in 868MHz band, in 916MHz band with a rate of
40kb/s. Because the wireless signal propagation loss on
these two bands is smaller, so the requirement for receiver
sensitivity can be decreased, so that effective
communication distance can be farther and fewer devices
can be used to cover a given area.
electric meter. Fig. 4 is the hardware block diagram of
external terminal node.
In order to communicate with meters, there is a chip for
conversion of voltage level because the electric meter
communication interface is RS-485. This article will use
MAX3485 chip, making it compatible with voltage level of
JN5121 [11-17].
Metering System Software Design
ZigBee end device reads energy measurement
information in multifunction electric meter by UART, and
transmits them to the network coordinator via Zigbee
wireless network, thus it can realize the wireless meter
reading of the network coordinator. Meanwhile, the network
coordinator can transfer clock-correcting command to
multifunction electric meter through ZigBee end device to
calibrate the system clock and power parameters.
Therefore, the end device must be able to communicate
with the multifunction electric meter in order to read data
and the coordinator in order to send data. The coordinator
also has to know which end node that sends the data so the
data can be read accurately. Each of ZigBee modules has a
unique 64-bit permanent address, so the addressing won’t
be much difficult. Fig. 5 shows the program flowchart of end
device.
VCC DC
MAX3485
SPI
UARTO
Flash
Antenna
JN5121
A/D
RS232
Fig.5. Program flowchart of ZigBee end device
Crystal
Fig.4. Hardware block diagram of external terminal module
External terminal node module is mainly used for
upgrade and improvement of existing electric meter
network. The electric meter has RS-485 bus interface. Main
tasks of the module are to access, read, and write the
66
A TI's ZigBee2006 protocol stack, Z-Stack, is
transplanted in CC2430. Z-Stack protocol stack contains an
operating system abstraction layer (OSAL) that performs
scheduling task in Z-Stack [11]. Therefore, the
understanding of OSAL mechanism is a prerequisite of
Zigbee product development. OSAL is a mechanism for
task allocation of resources, thus to form a simple multi-
PRZEGLĄD ELEKTROTECHNICZNY (Electrical Review), ISSN 0033-2097, R. 88 NR 1b/2012
tasking operating system. Fig. 6 shows the OSAL workflow.
Before entering the main loop of the operating system,
system initialization is particularly significant in the
preparations. The operating system initialization needs to
perform a function osal_init_system(). This function can
initialize memory allocation system, message queue, timer
for OSAL, power management system, tasks system, and
task list. The start function of the operating system,
osal_start_system(), is in the end of the main function. This
function is the main cycle of the task system and it visits all
the task events and calls the appropriate event. If there is
no event which includs all of the tasks, this function allows
the processor to enter sleep mode and then has no return
value. Start function find whether the task events happened
in accordance with the priority of the missions. It indicates
the occurred task event through the implementation of
osalNextActiveTask()
function,
and
performs
the
corresponding task processing function.
on the interface. The automatic meter reading system
considerably reduces both the difficulty of meter reading
and human resources. Moreover, it also significantly
improved the accuracy and instantaneity of data collection
due to the use of digitalized management.
Experiment Results
This article is to verify the feasibility of wireless
automatic meter reading system based on ZigBee by
implementing a wireless automatic meter device as shown
in Fig. 8. A multifunctional digital electric meter, cement
load, ZigBee modules, and on/off switches are installed on
top of a wood board of 30x30 (cm).
Start
Initialize Operation System
Add Task to Task List
Fig.8. Wireless automatic meter device
Serial Polling & Timer Counting
Enter Sleep Mode
Y
Activated Task
N
Arrive Sleep
Time
N
Y
The electric meter measures electrical parameters and
transfers measured data to ZigBee Concentrator via RS485 to RS-232 communication ports and to ZigBee/GPRS
Gateway via wireless communications network, then to a
terminal node via GPRS and back to PC in RS-232
communication format to complete the automatically
wireless meter system, as shown in Fig. 9.
Call Task Processing Function
Add Follow-up Event to Task
Prohibit from Sleep Mode
Fig.6. Flowchart of operating system abstraction layer
Fig.9. Wireless automatic meter reading system
Fig.7. Monitoring and management interface of wireless automatic
meter reading system
The monitoring and management interface of the
wireless automatic meter reading system in this research is
shown in Fig. 7. It is coded with the Visual Basic Program
language developed by Microsoft. As a data receiver, it
receives multifunction electric meter data including voltage,
current, active power, power factor, and watt-hours. The
communication port number on which the coordinator
connects and the baud rate of the protocal can also be set
Four wireless automatic metering end devices are
installed in Management Hall, Kuo-Xiu Building, Library and
Information Hall, and Chin-Yun Hall of National Chin-Yi
University of Technology, respectively. An coordinator and
a GPRS devices are placed in Engineering Hall, with
distance of approximate 300M, 260M, 110M, and 150M
respectively, as shown in Fig. 10.
This study tested the network setup time of wireless
automatic meter reading system. The average result of 100
tests is within 4 seconds. Network-wide circular meter
reading time from single point of view is 5 seconds on
average; single point meter reading average success rate is
above 98%; single point meter re-reading success rate is
100%, within the interval of 30 seconds. On the remote
on/off control, a single on and off control is within 3
seconds, and its success rate is 100%. And other wireless
communication interference to meter and control has no
significant impact, as shown in Table 2.
PRZEGLĄD ELEKTROTECHNICZNY (Electrical Review), ISSN 0033-2097, R. 88 NR 1b/2012
67
messages. Moreover, no cabling is required with relatively
economical investment. For the proposed wireless
automatic meter reading system, wireless communication
links can be quickly built, engineering period significantly
shortened, and it has better scalability compared to a wired
system. If a fault occurs, simply checking wireless data
module can quickly find it out and restore the system in
normal operation.
Acknowledgements The research was supported by the
National Science Council of the Republic of China, under
Grant No. NSC 98-2622-E-167-010-CC3, and the Ministry
of Education, Taiwan, R.O.C., under grant 100E-70-025 of
Industry-Academic Cooperation Project.
Fig.10. Installation location for wireless automatic meter reading
system
Table 2. Tested results of critical performance index
Test
Test Conditions
Results
Network setup
<4 Sec.
time
Remote
ON/OFF
control
Effects of
other wireless
communication
interference to
meter and
control
[2]
Circular
meter
reading 100
times
[3]
100%
Time
interval 30
Sec.
[5]
ON control time
<3 Sec.
Continuous
control 10
times
Success rate of
single time ON
100%
Average time
of single point
meter reading
Results of
network-wide
circular meter
reading
Remarks
REFERENCES
[1]
Success rate of
single point
meter reading
Success rate of
single point
meter rereading
OFF control
time
Success rate of
single time
OFF
IEEE
802.11b/g
<5 Sec.
[4]
>98%
<3 Sec.
Time
interval 30
Sec.
[6]
[7]
[8]
[9]
[10]
100%
[11]
-*
[12]
Bluetooth
-*
GSM/GPRS
-*
[13]
[14]
*: No obvious effect
[15]
Conclusion
The successful development of the wireless automatic
meter reading system described in this article is based on
the high performance, extremely low power consumption,
high level of integration, and low price of ZigBee technology.
The technology has strong market competitiveness. ZigBee
wireless meter reading system uses short-range wireless
communication and computer network technologies to read
and process metering data automatically. Wireless
automatic meter reading technology can not only save
human resources, but also improve the accuracy and
instantaneity of the meter reading. It enables management
sector to timely and accurately access power consumption
[16]
68
[17]
Safaric S., Malaric K., ZigBee Wireless Standard, Proc. of the
48th International Symposium ELMAR-2006, Zadar Croatia, 1
(2006), 259-262
Primicanta, A.H., Nayan, M.Y., Awan, M., ZigBee-GSM based
Automatic Meter Reading system, 2010 International
Conference on Intelligent and Advanced Systems (ICIAS),
Kuala Lumpur, Malaysia, 1 (2010), 1-5
Tatsiopoulos, C., Ktena, A., A Smart ZIGBEE Based Wireless
Sensor Meter System, 16th International Conference on
Systems, Signals and Image Processing (IWSSIP), Chalkida,
Greece, 1 (2009), 1-4
Lee J.D., Nam K.Y., Jeong S.H., Choi S.B., Ryoo H.S., Kim
D.K., Development of ZigBee Based Street Light Control
System, Proc. of the Power System Conference and
Exposition, Atlanta GA, 3 (2006), 2236-2240
IEEE
802.15
WPAN
Task
Group
1
(TG1),
http://www.ieee802.org/15/pub/TG1.html
IEEE
802.15
WPAN
Task
Group
2
(TG2),
http://www.ieee802.org/15/pub/TG2.html
IEEE
802.15
WPAN
Task
Group
3
(TG3),
http://www.ieee802.org/15/pub/TG3.html
IEEE
802.15
WPAN
Task
Group
4
(TG4),
http://www.ieee802.org/15/pub/TG4.html
ZigBee Alliance, http://www.ZigBee.org/.
Chen Z., Lin C., Wen H., Yin H., An Analytical Model for
Evaluating IEEE 802.15.4 CSMA/CA Protocol in Low-Rate
Wireless Application, Proc. of the 21st International
Conference on Advanced Information Networking and
Applications Workshops, 2 (2007), 899-904
JENNIC JN5121 Hardware Peripheral API Reference Manual,
Revision 0.7, (2005)
JENNIC JN5121-EK000 Board Hardware API Reference
Manual, Revision 0.4, (2005)
JENNIC JEK01 Demonstration Application Code description,
Revision 0.5, (2005)
JENNIC 802.15.4 MAC Software Reference Manual, Revision
0.7, (2005)
JENNIC JN5121-EK000 Demonstration Application User
Guide, Revision 0.4, (2005)
JENNIC Software Developers KIT Installation Guide, Revision
0.2, (2005)
JENNIC Debugging with DDD, Revision 3.3.9, (2004)
Authors:
Ph.D. Hung-Cheng Chen, National Chin-Yi University of
Technology, Department of Electrical Engineering. Taiping Dist.,
Taichung 411, Taiwan. E-mail: hcchen@ncut.edu.tw.
Master Long-Yi Chang, National Chin-Yi University of Technology,
Department of Electrical Engineering. Taiping Dist., Taichung 411,
Taiwan. E-mail: lychang@ncut.edu.tw.
PRZEGLĄD ELEKTROTECHNICZNY (Electrical Review), ISSN 0033-2097, R. 88 NR 1b/2012
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising