Zigbee Based Wireless Sensor and Actuator Network for Service Robot Intelligent Space *

Wireless sensor and actuator network is the key technology of service robot intelligent space. This paper is concerned with design and implementation of a ZigBee based wireless sensor and actuator network (hereinafter referred to as ZWSAN), which has been applied in our service robot intelligent space successfully. Firstly, a simplified ZigBee stack applied to ZWSAN is proposed and the primitives of the stack are illustrated after a short overview of ZigBee protocols. Then the implementation of hardware module and software stack is introduced in detail as well as several representative devices integrated into ZWSAN, including environmental sensors for environmental perception, home devices controllers for device control, embedded speech recognition module for speech control, IMU module for abnormal behaviors detection and laser robot control for service robot navigation. An application example is described to demonstrate how the devices in ZWSAN to provide service cooperatively. Finally, we conclude this paper and discuss the future directions.


Introduction
Intelligent space [1] is a space (room, office or public space) integrated with variety of devices for perception, decision-making, execution and control.These devices are networked to share information and provide considerate services.In recent years, service robot intelligent space [2], which is the combination of intelligent space and service robot, was proposed to extend the capability of service robot for perception and decision-making.Moreover, service robot is also an advanced mobile device for initiative information perception and service tasks execution in intelligent space.
In service robot intelligent space, the devices, i.e., various sensors and actuators (including service robot), are connected with each other by network.Recently, the research of wireless sensor and actuator network and related tops has attracted substantial concern [3].For example, Luo and his colleagues described a prototypical configuration for networked robot systems [4].Distributed Intelligent Network Device (DIND) [5] proposed by Hashimoto et al. is one of the earliest works to implement an intelligent space using networked devices.Baeg et al. initiated a smart home environment project for light-weight service robots to provide reliable services through the wireless sensor network [6].Liang et al. proposed a system of wireless Smart-home sensor network based on ZigBee and PSTN (Public Switched Telephone Network) [7].Suh et al. suggested a new intelligent home control system based on a wireless sensor/actuator network, which divided and assigned various home network tasks to appropriate components [8].Yu et al. implemented a ubiquitous robotic space with a sensor network based on ZigBee protocol [9]. Lee et al. designed an automated construction of node software for ubiquitous sensor network in intelligent environment [10].Zhou et al. discussed wireless sensor network based multi-pattern information acquisition and fusion in intelligent space [11].However, service robot usually has not been involved in most of above researches and related literatures.In this paper, we introduce the design and implementation of a ZigBee based wireless sensor and actuator network (hereinafter referred to as ZWSAN), which has been applied in our service robot intelligent space successively.and then introduces a simplified ZigBee stack applied to ZWSAN followed by the implementation of hardware module and software stack.In Section 3, we describe the design and implementation of several representative devices integrated into ZWSAN in detail, as well as an application example to show how devices to provide service cooperatively.Section 4 concludes this paper and discusses the future directions of our research.

ZigBee Based Wireless Sensor and Actuator Network
In general, Bluetooth (over IEEE 802.15.1),UWB (over IEEE 802.15.3),ZigBee (over IEEE 802.15.4), and Wi-Fi (over IEEE 802.11a/b/g) are four protocol standards for short range wireless communications in recent years [12].As compared with other protocol standards, ZigBee is designed to be applied to low data rate, lowcost, low power consumption wireless communications.These characteristics make ZigBee very suitable for the construction of wireless sensor and actuator network.In this section, we firstly overview the ZigBee protocols, and then a simplified ZigBee stack is described according to the requirement of our service robot intelligent space.Furthermore, the implementation of hardware module and software stack is addressed in detail.

Overview of ZigBee Protocols
ZigBee is a novel radio frequency (RF) communication standard based on IEEE 802.15.4.It defines two layers, the application layer and network layer, utilizing the IEEE 802.15.4 standard as the communication protocols of medium access control (MAC) layer and physical (PHY) layer [13].ZigBee wireless network consists of one coordinator, several end devices and routers.The coordinator is a special FFD (full function device) responsible for creating and maintaining the whole ZigBee PAN (Personal Area Network).During the network initialization phase, the coordinator scans the available radio channels to find the most suitable channel.Normally, this will be the channel with the least activity.The coordinator can be pre-programmed with the PAN ID (Personal Area Network Identifier) or dynamically scans for existing network PAN IDs in the same frequency and generate a conflict-free PAN ID.After the coordinator's initialization phase, the coordinator waits for the requests from ZigBee devices to join the network.At the same time, the end devices scan available channels to identify the network distinguished by their PAN ID and requests are sent to the coordinator of the network they wish to join.Router is an optional device in ZigBee wireless network when the PAN covers a large area and routing is necessary.All the devices in the ZigBee wireless network are assigned a fixed 64 bit MAC address and a dynamic 16 bit short address is assigned to each device in the whole lifetime of the network.

Simplified ZigBee Stack
A small amount of code data means a small storage capacity of hardware, and further more it means the reduction of the volume, cost and energy consumption.In addition, in our ZWSAN, we focus on the wireless communication of ZigBee wireless network, so that some function that is not common used can be cut and some common function can be simplified after the analysis of ZigBee specification.For example, active scanning mode is selected to speed up the process of entering a network while passive scanning mode is cut, the simple binding is used for end devices binding considering this ZigBee network focuses on sensing and data transmission, and security related codes are cut because we do not pay much attention to information security in service robot intelligent space at present. Figure 1 illustrates the primitives implemented in our ZigBee based wireless sensor and actuator network.

Hardware Module and Software Stack
Up to now, several companies have introduced their own ZigBee protocol compatible hardware platform and corresponding software stack package, such as CC2430 from Texas Instruments (Chipcon), MC13192 from Freescale and EM250 from Ember.Among the above products, the System-on-Chip CC2430 and Z-Stack from Texas Instruments (Chipcon) are widely used in the implementation of ZigBee wireless network.CC2430 is a true System-on-Chip (SoC) solution specifically tailored for IEEE 802.15.4 and ZigBee applications.It combines the excellent performance of the leading CC2420 RF transceiver with an industry-standard enhanced 8051 MCU, and enables ZigBee nodes to be built with very low total bill-of-material costs.Additionally, the low power consumption, i.e., 27 mA in RX mode, 25 mA in TX mode and 0.9 µA in power-down mode, ensures CC2430 to run as long as 3 to 6 months powered by 2 AA batteries [14].
Our ZigBee hardware module consists of CC2430 and very few external components.The PCB layout of hardware module is based on the CC2430 EM reference design recommended by Chipcon.When using an unbalanced antenna such as a monopole, a balun should be used in order to optimize performance.The balun can be implemented using low-cost discrete inductors and capacitors.The recommended balun shown in Figure 2(a), consists of C341, L341, L321 and L331 together with a PCB microstrip transmission line (λ/2-dipole), and will match the RF input/output t 50 Ω.Moreover, an F-o In Z-Stack, the device type is usually determined at compile-time via compile options, for example, the attribute ZDO_COORDINATOR and RTR_NWK.Generally, compiler option attribute NV_RESTORE should be enabled for the final ZigBee wireless network after developing and debugging.This compiler option makes the Z-Stack to save some important network related information in nonvolatile storage in case of the unexpected reset or reboot after power down.Besides, before the application development of Z-Stack, some parameters of ZigBee wireless network should be set, such as network attribute ZDAPP_CONFIG_PAN_ID, MAX_DEPTH, MAX_ROUTERS and MAX_CHILDREN et al.
For convenient extension, we design a general software frame in application layer based on example projects.Few events are responded in current frame.Firstly, when ZDO_STATE_CHANGE event occurs, such as new  Copyright © 2012 SciRes.WSN device join the network, the device sends its extended address to coordinator, so that an extended address table is established for short address explanation, because short address is used in ZigBee wireless network.In addition, some operations indicating current state of devices are triggered, for example, LED's blink, set on or off.AF_INCOMING_MSG_CMD event, indicating new received messages, is the most important event in this frame, but the response operation is very simple, that is any received messages are sent out via serial port for further processing.The response of serial port event HAL_UART_RX_FULL, which is triggered by serial port interrupt, is specific in different devices.For instance, detection module connected ZigBee module sends the data received from serial port to coordinator, and coordinator sends the data from PC transmitted via serial port to devices according to their short addresses after above address explanation.

Devices of ZigBee Based Wireless Sensor and Actuator Network
There are several devices integrated in ZigBee based wireless sensor and actuator network for sensing, decision-making and control in service robot intelligent space.
In this section, we firstly introduce some representative devices, and then give an example on how devices to provide service cooperatively.

Environmental Sensors
Environment perception is one of the most important issues in service robot intelligent space.Environmental sensors are used to monitor the state of service robot intelligent space, e.g., the environmental temperature.In this section, we address an environmental sensor which gathers temperature, humidity and illumination.The MCU of the sensor node is the system-on-chip CC2430 we introduced in previous section.SHT11 from Sensirion, integrated with capacitive moisture measuring device polymer and gap-type temperature measuring device, is used for temperature and humidity sensing.Photosensitive resistance is applied for illumination sensing.Figure 3(a) shows the sensor node module.

Home Devices Control
There are several home devices in service robot intelligent space and they are integrated into ZWSAN.As an experimental platform, we want to achieve the minimal changes from the home devices.So that, the ZigBee home devices controllers are integrated with the remote controllers of the home devices, such as TVs, air conditioners, electric curtains and electric fans, etc.However, for the home devices without remote controllers, e.g., the lamp, we integrate the ZigBee controller modules with the devices themselves.The rebuilt controllers are shown in Figures 3(b)-(f).

Embedded Speech Recognition Module
Speech is a natural HCI (Human-Computer Interaction) method in intelligent space.We design an embedded speech recognition module which is integrated into ZWSAN.The speech is translated into control commands on the module, and the commands are transmitted to control devices by ZWSAN, e.g., the devices introduced in previous section.The core of the module is STM32F103C8T6, which is a 32-bit processor based on ARM Cortex-M3 core produced by STMicroelectronics.The speech recognition unit LD3320 is used for dialogue management.And the whole module is managed by the real time operating system-μC/OS-II, which is used on this module for multitask scheduling and operating of peripheral devices.Figure 4 shows the embedded speech recognition module.

Abnormal Behaviors Detection Module
In our service robot intelligent space, the abnormal behaviors (now we focus on tumble, which is dangerous for elderly) are detected by IMU (Inertial Measurement Unit) based body posture detection module.And then a message indicating the abnormal behaviors are sent to decision-making system of service robot intelligent space by ZWSAN.Afterwards, service robot intelligent space decides to tell the family or order a service robot to help.If the latter is decided, which is in our case, a laser robot (addressed in next section) is used for robot navigation in the service robot intelligent space.
The detection module consists of two biaxial MEMS gyroscopes (LPR530 and LPY530), one three-axis MEMS accelerometer (MA7260), two biaxial magnetometers (HMC1022) and ARM controller (also STM32F103C8T6), as well as few signal processing circuits, such as highfrequency filtering, signal conditioning, and some interface with other modules (e.g., ZigBee module).The block diagram of detection module is illustrated in

Laser Robot Control
The laser robot is a pan-tilt with a laser source installed on the ceiling.Firstly, the navigation path of the service robot is planned by service robot intelligent space and then the control data according to the path after coordinate conversion is transmitted to laser robot by ZWSAN to scan floor.Meanwhile, the service robot obtains irradiated laser spots by sensors (e.g., camera) on the robot and follows the laser spots.The laser robot navigated mobile robot moves along the planned path by repeatedly finding and following laser spots [16].This navigation method reduces the sensors for navigation carried on service robot.
The laser robot consists of pan-tilt and laser installed at the end effect, which is shown in Figure 6(a).{X 0 , Y 0 , Z 0 } is the base coordinate system, {X 1 , Y 1 , Z 1 } and {X 2 , Y 2 , Z 2 } are the joint coordinate system, respectively.{X E , Y E , Z E } is the laser coordinate system installed on the pan-tilt.Further, we can get the Jacobian matrix representing the joint speed and the spot velocity as, where, J represents the Jacobian matrix, E Z is the Z coordinate in coordinate system {X E , Y E , Z E }.The input of the system is the velocity of spot in base coordinate, and the control law is selected as,

Application Example
The increase of elderly population makes the development of health monitoring system attract widespread concerns.Human behaviors understanding, especially the abnormal behaviors detecting and understanding, is one of the most important issues in the health monitoring system, because some abnormal behaviors are closely related to human's healthy problem.Nowadays, the study of human behaviors understanding has achieve series of important results, however, most of related work is computer vision techniques based statistics on activities of daily living, which is extremely labor-intensive, timeconsuming and costly [17,18].Furthermore, only monitoring function but no help function is provided and implemented in these works.In our service robot intelligent space, we use previ- ously mentioned IMU to detect abnormal behaviors (e.g., tumble, which is especially dangerous for elderly), and the corresponding alarm messages are sent to decisionmaking system of service robot intelligent space by ZWSAN.Usually, service robot intelligent space commands a service robot to provide necessary help.So that, path planning is implemented by service robot intelligent space according to the position of elderly and service robot.Then the laser robot is used to navigate the service robot to target location (addressed in previous section in detail).The data of detection, location, robot command and path planning for navigation are all transmitted through ZWSAN.

Conclusions and Future Work
In this paper, we introduce the design and implementation of ZigBee based wireless sensor and actuator network for service robot intelligent space, which has been implemented in our service robot intelligent space successfully.A simplified ZigBee stack applied for ZWSAN is presented, and the implementation of hardware module and software stack is described in detail, as well as several representative devices integrated into ZWSAN.
The application example demonstrates that the ZWSAN greatly enhance services for human and service robot and improve the capability for perception, execution and control of service robot intelligent space.an important aspect in the research of service robot intelligent space.

Figure 1 .
Figure 1.Primitives of simplified ZigBee stack.antenna is a complement for some short distance and small package cases.An external 32 MHz crystal, XTAL1, with two loading capacitors (C191 and C211) is used for the 32 MHz crystal oscillator.And XTAL2, as an optional 32.768 kHz crystal, is also implemented on board.The reference design provided by Chipcon is very compact and Figure 2(b) shows our ZigBee hardware module.Z-Stack is TI's ZigBee compliant protocol stack for the growing IEEE 802.15.4 products and platforms.Z-Stack is compliant with the ZigBee 2007 (ZigBee and ZigBee PRO) specification, supporting ZigBee and ZigBee PRO feature sets on the CC2430 SoC.Z-Stack consists of application layer, network layer, security layer, MAC layer and physical layer.This backward compatible stack and its on-air-download feature make it easy to upgrade existing devices.Z-Stack is easy for developers to use and what the developers have to do is programming in appli-

Fig- ures 5
(a) and (b) shows the real detection module.When some abnormal event occurs, now we focus on fall detection, alarm signal is sent to ZigBee module via serial port and then the alarm messages are transmitted to coordinator.

Figure 6 (
b) illustrates the D-H kinematic parameters of laser robot.

Figure 6 .
Figure 6.(a) Structure of laser robot; (b) D-H model of laser robot.

Figure 7
illustrates how this system works.

Figure 7 .
Figure 7. Abnormal behaviors detection and help system.