Design and Implementation of a RFID Reader/Router in RFID-WSN Hybrid System

: In order to put Radio Frequency Identiﬁcation (RFID) and Wireless Sensor Network (WSN) in a hybrid system, this paper presents the design and implementation of a RFID reader/router that can obtain information of both RFID tags and WSN sensor nodes and transmit the information through the WSN to the PC server. The RFID reader and WSN router are combined with both hardware and software. In hardware structure, CC2530 is used as micro controller and RF module for ZigBee wireless communication, and MF RC522 is used as reader RF chip. The software deals with both identity and sensing information and controls the routing. Experiment results show that the RFID reader/router achieves long distance identiﬁcation, ﬂexibility, scalability, and low cost. It also provides reliable and secured data transmission and broadens the communication range and application scope of RFID readers.


Introduction
The aim of Internet of Things (IoT) is to integrate the physical and digital worlds seamlessly.The development of IoT also draws a lot of attention to the integration of different interconnecting technologies, such as Radio Frequency Indentification (RFID), Wireless Sensor Networking (WSN) and 5G networks.
RFID is a non-contact automatic identification technology that can provide object level automatic identification.With the rapid development of RFID technology, the application of the systems based on RFID technology is widely used in different fields, such as logistics, civil affairs, transportation, civil aviation, security and identification.RFID is generally composed of three basic components: tags, readers and a PC reader.The tags, active or passive, communicate with readers wirelessly, while the readers communicate with PC reader with cable.
WSN is a collection of nodes that can collect information of the physical world and transmit it as electrical signal.WSN provides a variety of real-time applications including medical, environmental, entertainment, military and security.WSN is generally composed of sensor nodes, routers, a coordinator and a PC server.Each sensor node contains one or more sensors, memory, power source and certain processing chips.The sensor nodes can communicate with routers directly or organize a multi-hop network to communicate with routers.All the information is transmitted to the PC server.
The integration of RFID and WSN can extend the range of applications and also offers added value to the existing applications [1].There is a proliferation of academic research and examples of implementations reported in the literature [2][3][4][5][6][7][8][9][10][11][12][13][14].B Zhang et al. [2] proposed a novel network architecture and analyzed the energy consumption.Bolivar Torres et al. [3] used a Proto Board, a Bridge Board and certain midware to integrate an RFID reader into a WSN to keep track of people.Pablo Garcia Ansola et al. [4] used a WSN based ZigBee network with RFID tags as end nodes to improve the visibility in industrial environments.
The integration of WSN and RFID involves the integration of hardware and software.In order to take advantage of WSN and RFID, the integration has three possible layouts: the integration of RFID tags with sensor nodes as shown in Figure 1a, the mixed integration architecture as shown in Figure 1b [6,7] and the integration of RFID readers with sensor nodes as shown in Figure 1c.For the first integration architecture, the end nodes can be traditional RFID tags, traditional WSN sensor nodes or a novel node that includes identification as well as more information captured by sensors [8].For the third integration, the sensor node is equipped with a reader, which increases the power consumption of sensor nodes and pull down its efficiency [6].For the second layouts, a smart station that incorporates RFID reader and WSN router is used so that RFID tags and sensors can coexist in the same network.The smart station is named as RFID reader/router because it works as a RFID reader as well as a WSN router [6].The reader/router gathers both kinds of information from the end nodes and routes the information finally to the coordinator.The mixed integration uses both RF communication protocol (between RFID tags and RFID reader/router) and the ZigBee protocol (between sensor nodes and reader/router, between reader/routers).This makes the hardware and software design of the reader/router more challenging.In [9], two separate micro-controllers were used respectively for RFID reader and ZigBee router, and that led to the waste of resources and the high cost.In [10], a multi-protocol RFID reader system was implemented with a custom RFID reader board and a ZigBee mote, in addition with certain firmware.This reader can be used to construct an ad-hoc ZigBee network but not for general purpose.The integration of WSN and RFID involves the integration of hardware and software.In order to take advantage of WSN and RFID, the integration has three possible layouts: the integration of RFID tags with sensor nodes as shown in Figure 1a, the mixed integration architecture as shown in Figure 1b [6][7] and the integration of RFID readers with sensor nodes as shown in Figure 1c.For the first integration architecture, the end nodes can be traditional RFID tags, traditional WSN sensor nodes or a novel node that includes identification as well as more information captured by sensors [8].For the third integration, the sensor node is equipped with a reader, which increases the power consumption of sensor nodes and pull down its efficiency [6].For the second layouts, a smart station that incorporates RFID reader and WSN router is used so that RFID tags and sensors can coexist in the same network.The smart station is named as RFID reader/router because it works as a RFID reader as well as a WSN router [6].The reader/router gathers both kinds of information from the end nodes and routes the information finally to the coordinator.The mixed integration uses both RF communication protocol (between RFID tags and RFID reader/router) and the ZigBee protocol (between sensor nodes and reader/router, between reader/routers).This makes the hardware and software design of the reader/router more challenging.In [9], two separate micro-controllers were used respectively for RFID reader and ZigBee router, and that led to the waste of resources and the high cost.In [10], a multi-protocol RFID reader system was implemented with a custom RFID reader board and a ZigBee mote, in addition with certain firmware.This reader can be used to construct an ad-hoc ZigBee network but not for general purpose.The main objective of this research is to develop a portable wireless RFID reader/router for RFID-WSN hybrid system, which has long identification distance, low cost, high flexibility, scalability, and a good interactive interface.The RFID reader/router also offers the hybrid system with the capability of both identification/tracking and capture/transmitting.This design can be used in a wide range of applications.The main objective of this research is to develop a portable wireless RFID reader/router for RFID-WSN hybrid system, which has long identification distance, low cost, high flexibility, scalability, and a good interactive interface.The RFID reader/router also offers the hybrid system with the capability of both identification/tracking and capture/transmitting.This design can be used in a wide range of applications.
The remainder of this paper is organized as follows.Firstly, the System architecture is introduced in Section 2. Hardware design of the RFID reader/router is described in Section 3. Section 4 presents the software design of RFID reader/router.Section 5 provides results of field test in real-world scenarios.Finally, some conclusions of this paper follow in Section 6.

Basic Structure of the Proposed RFID-WSN Hybrid System
The proposed RFID-WSN hybrid system is supposed to be used in applications ranging from public service and manufacturing environments to logistic organizations, in which employees, patients, products, machinery etc. are to be identified, tracked, or localized.The environment variables of a medium or large space should also be captured and transmitted to the service management control center.So both RFID tags and WSN sensor nodes are used as end nodes to cover the whole industrial or service area.The RFID reader/router is able to obtain both kinds of information from the two kinds of end nodes as well as transmit the information from one to another and finally to the coordinator.
For the communication network, ZigBee is selected for its characteristics of range, auto routing capability, low power consumption and sufficient bandwidth [11].The basic structure of the hybrid system is shown in Figure 2. The RFID reader/routers work as the receiver and transmitter of both identity and sensing information, and self-organize a network to relay the information to the coordinator and then to the service management control center.
The network communication structure of the system is shown in Figure 2, including service management control center, coordinator, RFID reader/routers, sensor nodes and RFID tags.(1) RFID tags record the label card number and data information of the item.(2) Sensor nodes are responsible for collecting the environmental information of the entire area, and then transferring the information to RFID reader/router nodes.(3) RFID reader/routers are responsible for sending information from sensor nodes to coordinator, simultaneously receiving the instruction information sent by coordinator and transferring to sensor nodes.(4) Coordinator is responsible for starting the entire ZigBee system network, sending gathered information through the serial port to the host computer application system, and simultaneously transmitting the control information that derived from the service management control center to RFID reader/routers.(5) Service management control center gathers all the identity and sensing information for further processing, and is responsible for providing human-computer interaction.
Compared with the existing RFID reader that communicates with the host computer through RS232 or Ethernet interface, the RFID reader/routers offer two wireless communication links.The RFID reader part works at 13.56 MHz with passive RFID tags.The router part works at 2.4 GHz with sensor nodes, other RFID reader/routers and the coordinator.
The hybrid system has the following benefits: (1) The communication range for 13.56 MHz passive RFID tags is enlarged; and (2) keeps the simplicity of the sensor node.There is no additional power consumption for sensor nodes; (3) sensor nodes, coordinator and RFID reader/routers can communicate with each other by creating a robust self-organizing networks.

Circuit Design of Radio Frequency (RF) Module
RF communication circuit consists of micro controller and RF chip.Its main function is to communicate with the electronic tags for completing the exchange of the tag information.The core chip of RF module is Philips MF RC522.Electronic tags are M1 cards produced by Philips. Figure 4a shows the RF communication module circuit.As shown in Figure 4a, the RF module transmits carrier energy signal which is 13.56 MHz and modulated by envelope signal to the antenna module through pins TX1 and TX2.The antenna is driven by an Electro Magnetic Compatibility (EMC) filter circuit consisted of L1, L2, C11, and C12, and a matching circuit composed of C5-C10.In the receiving circuit, the DC input voltage of the RX pin is stabilized at the pin VMID by C3 and R2, and its AC input voltage can be adjusted by R3 and C4.As shown in Figure 4a, the RF module transmits carrier energy signal which is 13.56 MHz and modulated by envelope signal to the antenna module through pins TX1 and TX2.The antenna is driven by an Electro Magnetic Compatibility (EMC) filter circuit consisted of L1, L2, C11, and C12, and a matching circuit composed of C5-C10.In the receiving circuit, the DC input voltage of the RX pin is stabilized at the pin VMID by C3 and R2, and its AC input voltage can be adjusted by R3 and C4.

Circuit Design of ZigBee Sensor Nodes
ZigBee sensor node primarily controls the data exchange between RF module and electronic tags.The system uses CC2530 low-power RF chip which is made by TI/Chipcon.It integrates the IEEE 802.15.4/ZigBeeRF transceiver and industrial standard enhanced 8051 Micro Controller Unit (MCU) kernel, the core of the control circuit is shown in Figure 4b.
Data read operation: The mainframe sends the highest bit 1 and pulls IC_CS low at the same time.The 8-bit address of the read data is encoded in the prescribed format, and the data is sent to the MOSI line from high to low after 8 cycles.After receiving a data of reading instruction address, the corresponding data will be sent back to the mainframe by MF RC522.The mainframe will read out the data on MISO after eight cycles and store on a temporary variable, pull IC_CS up at the same time.That indicates the completing of reading operation of one byte.
Data write operation: The mainframe sends the highest bit 0, and pulls IC_CS low at the same time.According to the way of sending address in read data operation, the target address is sent out after eight cycles.Then the written data is sent out through MOSI after another eight cycles.That indicates the completing of the corresponding address update in MF RC522.
The system uses 32 MHz crystal oscillator clock signal as the core controller, and Serial Peripheral Interface (SPI) way of communication is used between the CC2530 and RF module.P1_7 connects SDA end of RF chip MF RC522 that is used as a signal of the control line.P0_1, P1_3 and P0_4 connect respectively the RF chip MF RC522 D5, D6 and D7, registers associated with MF RC522 are controlled to read and write by SPI mode.P0_5 connects reset pin of MF RC522 for resetting the controller.ZigBee sensor node primarily controls the data exchange between RF module and electronic tags.The system uses CC2530 low-power RF chip which is made by TI/Chipcon.It integrates the IEEE 802.15.4/ZigBeeRF transceiver and industrial standard enhanced 8051 Micro Controller Unit (MCU) kernel, the core of the control circuit is shown in Figure 4b.
Data read operation: The mainframe sends the highest bit 1 and pulls IC_CS low at the same time.The 8-bit address of the read data is encoded in the prescribed format, and the data is sent to the MOSI line from high to low after 8 cycles.After receiving a data of reading instruction address, the corresponding data will be sent back to the mainframe by MF RC522.The mainframe will read out the data on MISO after eight cycles and store on a temporary variable, pull IC_CS up at the same time.That indicates the completing of reading operation of one byte.
Data write operation: The mainframe sends the highest bit 0, and pulls IC_CS low at the same time.According to the way of sending address in read data operation, the target address is sent out after eight cycles.Then the written data is sent out through MOSI after another eight cycles.That indicates the completing of the corresponding address update in MF RC522.
The system uses 32 MHz crystal oscillator clock signal as the core controller, and Serial Peripheral Interface (SPI) way of communication is used between the CC2530 and RF module.P1_7 connects SDA end of RF chip MF RC522 that is used as a signal of the control line.P0_1, P1_3 and P0_4 connect respectively the RF chip MF RC522 D5, D6 and D7, registers associated with MF RC522 are controlled to read and write by SPI mode.P0_5 connects reset pin of MF RC522 for resetting the controller.Figure 5 shows I/O interface connection of CC2530 and MF RC522.

Circuit Design of ZigBee Coordinator
The role of ZigBee coordinator is sending ZigBee terminal nodes' information to the host computer through the serial port, and at the same time, sending control instructions from the host computer to the terminal nodes through wireless network.Because TTL level is adopted in CC2530 and EIA level in host computer communication, level translation is needed for effective data communications.MAX232 chip is used to achieve the translation between the two electrical levels.The circuit of ZigBee coordinator is shown in Figure 4b.It is consistent with the terminal node circuits and is set as the coordinator in the Z-stack protocol stack only.

Main System Flow Chart
Throughout the system, ZigBee coordinator forms entire ZigBee communication network, and waits for router nodes and sensor nodes to join it.During network operation RFID reader collects related node information, then sends it to the host computer through ZigBee network, and finally stores related information into the database.The main system flow chart is shown in Figure 6.

Circuit Design of ZigBee Coordinator
The role of ZigBee coordinator is sending ZigBee terminal nodes' information to the host computer through the serial port, and at the same time, sending control instructions from the host computer to the terminal nodes through wireless network.Because TTL level is adopted in CC2530 and EIA level in host computer communication, level translation is needed for effective data communications.MAX232 chip is used to achieve the translation between the two electrical levels.The circuit of ZigBee coordinator is shown in Figure 4b.It is consistent with the terminal node circuits and is set as the coordinator in the Z-stack protocol stack only.

Main System Flow Chart
Throughout the system, ZigBee coordinator forms entire ZigBee communication network, and waits for router nodes and sensor nodes to join it.During network operation RFID reader collects related node information, then sends it to the host computer through ZigBee network, and finally stores related information into the database.The main system flow chart is shown in Figure 6.In RFID reader/router, RF chip MF RC522 communicates with electronic tags following the communication protocol of ISO/IEC14443A.Through SPI (Serial Peripheral Interface), CC2530 controls communication between MF RC522 and type matched cards within the range of the antenna.It then reads information in card and deals with the information accordingly to make it compliant with the ZigBee protocol packets [15,16].It sends the packets to the coordinator in ZigBee network following IEEE 802.15.4.The coordinator connects with the host computer via the UART interface, and ultimately sends the data to host computer for processing.Similarly, the host computer can send control commands to operate the electronic tag, such as modification of the information.

Design of Communication Protocol for RFID Reader System
In the whole system, ZigBee terminal node controls MF RC522 RF card collection of data, and then transmits to other wireless or wired network through the ZigBee protocol transmission.The system communication protocol frame is shown in Figure 7.In the RFID reader system, the communication protocol between RF chip of MF RC522 and electronic tags follows ISO/IEC 14443A.The master chip controls the communication between MF In RFID reader/router, RF chip MF RC522 communicates with electronic tags following the communication protocol of ISO/IEC14443A.Through SPI (Serial Peripheral Interface), CC2530 controls communication between MF RC522 and type matched cards within the range of the antenna.It then reads information in card and deals with the information accordingly to make it compliant with the ZigBee protocol packets [15,16].It sends the packets to the coordinator in ZigBee network following IEEE 802.15.4.The coordinator connects with the host computer via the UART interface, and ultimately sends the data to host computer for processing.Similarly, the host computer can send control commands to operate the electronic tag, such as modification of the information.

Design of Communication Protocol for RFID Reader System
In the whole system, ZigBee terminal node controls MF RC522 RF card collection of data, and then transmits to other wireless or wired network through the ZigBee protocol transmission.The system communication protocol frame is shown in Figure 7.In RFID reader/router, RF chip MF RC522 communicates with electronic tags following the communication protocol of ISO/IEC14443A.Through SPI (Serial Peripheral Interface), CC2530 controls communication between MF RC522 and type matched cards within the range of the antenna.It then reads information in card and deals with the information accordingly to make it compliant with the ZigBee protocol packets [15,16].It sends the packets to the coordinator in ZigBee network following IEEE 802.15.4.The coordinator connects with the host computer via the UART interface, and ultimately sends the data to host computer for processing.Similarly, the host computer can send control commands to operate the electronic tag, such as modification of the information.

Design of Communication Protocol for RFID Reader System
In the whole system, ZigBee terminal node controls MF RC522 RF card collection of data, and then transmits to other wireless or wired network through the ZigBee protocol transmission.The system communication protocol frame is shown in Figure 7.In the RFID reader system, the communication protocol between RF chip of MF RC522 and electronic tags follows ISO/IEC 14443A.The master chip controls the communication between MF In the RFID reader system, the communication protocol between RF chip of MF RC522 and electronic tags follows ISO/IEC 14443A.The master chip controls the communication between MF RC522 and electronic tag whose type is consistent with the range type of the antenna through the SPI interface.It reads the electronic tag information and processes the information to packets according to ZigBee protocol [16].It then sends the data packet to the ZigBee coordinator.The communication protocol between them is IEEE 802.15.4.Coordinator connects with the host computer through the UART and eventually transmits data to the host computer for processing.It can also modify the electronic tags information through the host computer sending control instructions.RC522 and electronic tag whose type is consistent with the range type of the antenna through the SPI interface.It reads the electronic tag information and processes the information to packets according to ZigBee protocol [16].It then sends the data packet to the ZigBee coordinator.The communication protocol between them is IEEE 802.15.4.Coordinator connects with the host computer through the UART and eventually transmits data to the host computer for processing.It can also modify the electronic tags information through the host computer sending control instructions.

Design of RFID Reader Software System
On the VS2008 platform, the host computer reader software based on serial communication is developed.The serial communication control MSCOMM in Microsoft Foundation Classes (MFC) is used to set the serial number, baud rate, parity bit and stop bit of serial.The application software can realize the function of reading the electronic tag number, reading the data block of the specified sector, and modifying the data block of the specified sector.The flow chart of the communication function between RFID reader and host computer is demonstrated in Figure 8.The host computer application software sends control instructions to the ZigBee coordinator through the host computer serial port, and the coordinator transmits the control instructions to ZigBee router nodes.Router nodes core controller CC2530 determines inside procedures according to the control commands, and then controls registers in RF chip MF RC522, and sends out the corresponding coded instructions through an antenna.Electronic tags within the range of reader perform operations according to the commands, and then return the appropriate data to the reader.ZigBee router nodes parse out the data returned from the electronic tag and send the electronic tag information to the ZigBee coordinator.Then the coordinator transmits information through UART serial port to the host computer software and the data is displayed on the software interface.Its basic program flow is shown in Figure 9.The host computer application software sends control instructions to the ZigBee coordinator through the host computer serial port, and the coordinator transmits the control instructions to ZigBee router nodes.Router nodes core controller CC2530 determines inside procedures according to the control commands, and then controls registers in RF chip MF RC522, and sends out the corresponding coded instructions through an antenna.Electronic tags within the range of reader perform operations according to the commands, and then return the appropriate data to the reader.ZigBee router nodes parse out the data returned from the electronic tag and send the electronic tag information to the ZigBee coordinator.Then the coordinator transmits information through UART serial port to the host computer software and the data is displayed on the software interface.Its basic program flow is shown in Figure 9.The process of writing tags from the host computer is explained through an example, in which the user modifies the data block 00 in sector 01.In the "Modify the specified data block", the "Sector number" is "01", the "The data block number" is "00" and the "Modify the data" is "01888888882510199990000251110088".Then the "Modify the data" button is clicked, and the data is encoded as "19A2FFFFFFFFFFFF0401888888882510199990000251110088" by the host computer system.Every two numbers takes up one byte, and "19" represents 25 bytes sending to the reader, "A2" indicates the data writing instruction to be executed, "FFFFFFFFFFFF" is the initial cryptographic of data block, "04" represents the fourth block of data block.The host computer software encodes the control instructions string encoding into binary format data that will be send to the ZigBee coordinator through the serial port of host computer and ZigBee terminal node through     The process of writing tags from the host computer is explained through an example, in which the user modifies the data block 00 in sector 01.In the "Modify the specified data block", the "Sector number" is "01", the "The data block number" is "00" and the "Modify the data" is "01888888882510199990000251110088".Then the "Modify the data" button is clicked, and the data is encoded as "19A2FFFFFFFFFFFF0401888888882510199990000251110088" by the host computer system.Every two numbers takes up one byte, and "19" represents 25 bytes sending to the reader, "A2" indicates the data writing instruction to be executed, "FFFFFFFFFFFF" is the initial cryptographic of data block, "04" represents the fourth block of data block.The host computer software encodes the control instructions string encoding into binary format data that will be send to the ZigBee coordinator through the serial port of host computer and ZigBee terminal node through The process of writing tags from the host computer is explained through an example, in which the user modifies the data block 00 in sector 01.In the "Modify the specified data block", the "Sector number" is "01", the "The data block number" is "00" and the "Modify the data" is "01888888882510199990000251110088".Then the "Modify the data" button is clicked, and the data is encoded as "19A2FFFFFFFFFFFF0401888888882510199990000251110088" by the host computer system.Every two numbers takes up one byte, and "19" represents 25 bytes sending to the reader, "A2" indicates the data writing instruction to be executed, "FFFFFFFFFFFF" is the initial cryptographic of data block, "04" represents the fourth block of data block.The host computer software encodes the control instructions string encoding into binary format data that will be send to the ZigBee coordinator through the serial port of host computer and ZigBee terminal node through the coordinator.Terminal node controls RF chip MF RC522 and stores the data in the corresponding data block of electronic tags.In order to verify whether the data is correct or not, the data written into is read out by clicking "Read the specified data block" to check.As shown in above Figure 7, the "Sector number" is "01" and the "The data block number" is "00".Then the "Read the data" button is clicked and the data just written is shown in "Read the data" box.

Communication System Hardware
Hardware of communication systems of integrated ZigBee and RFID technology includes ZigBee coordinator, RFID reader/router, ZigBee sensor node, and RFID tags, as shown in Figure 11.
Because of the low power consumption of the ZigBee technology, all modules in Figure 11 are powered by dry battery.The ZigBee coordinator transmits data with host computer by USB.RFID reader/routers are responsible for collection of information and forwarding instruction of RFID reader.ZigBee sensor nodes are responsible for controlling the RF module to read, write and modify the relevant data in electronic tag.
Future Internet 2018, 10, x FOR PEER REVIEW 10 of 12 the coordinator.Terminal node controls RF chip MF RC522 and stores the data in the corresponding data block of electronic tags.In order to verify whether the data is correct or not, the data written into is read out by clicking "Read the specified data block" to check.As shown in above Figure 7, the "Sector number" is "01" and the "The data block number" is "00".Then the "Read the data" button is clicked and the data just written is shown in "Read the data" box.

Communication System Hardware
Hardware of communication systems of integrated ZigBee and RFID technology includes ZigBee coordinator, RFID reader/router, ZigBee sensor node, and RFID tags, as shown in Figure 11.
Because of the low power consumption of the ZigBee technology, all modules in Figure 11 are powered by dry battery.The ZigBee coordinator transmits data with host computer by USB.RFID reader/routers are responsible for collection of information and forwarding instruction of RFID reader.ZigBee sensor nodes are responsible for controlling the RF module to read, write and modify the relevant data in electronic tag.

Performance Testing of Communication System
The reliability of a communication system consisting of a coordinator, router node (RFID reader/router), a ZigBee sensor node and three electronic tags was tested.The test was carried out under the environment that ambient temperature is 28 °C and ZigBee node emission power is 4.5 dBm.
The test is conducted in two cases: (1) outdoor test: open field without obstacles (2) indoor test: router nodes are placed in the laboratory, and coordinators are placed in corridor outside the laboratory.The shape of the corridor is rectangle with right corner.The corridor locates on the second floor of a building.The thickness of the concrete wall of the corridor is 26cm.The host computer sends instructions of reading (or writing) tag to the reader, then the corresponding router performs command of reading (or writing) to operate the electronic tag.The packet loss rate can be calculated after counting the times of router fail to execute the instructions of coordinator correctly or the times of information error after executing the instructions.During the test, the distance between the coordinator and the router nodes changes constantly to verify the impact of different test distances on the reading (or writing) results during the test.The maximum distance of the tag reading is 10 cm.
The test results are shown in Table 1.In outdoor test, when the transmission distance between the coordinator and router (RFID reader/router) is in the range of 80-100 m the maximum packet loss rate is 3%; when the test distance is 80 m or less, the packet loss rate is 0. In indoor test, when the transmission distance is 30-50 m and the maximum packet loss rate is 3%.When the test distance is 30 m or less, the packet loss rate is 0. The test results show that the system can achieve stable data

Performance Testing of Communication System
The reliability of a communication system consisting of a coordinator, router node (RFID reader/router), a ZigBee sensor node and three electronic tags was tested.The test was carried out under the environment that ambient temperature is 28 • C and ZigBee node emission power is 4.5 dBm.
The test is conducted in two cases: (1) outdoor test: open field without obstacles (2) indoor test: router nodes are placed in the laboratory, and coordinators are placed in corridor outside the laboratory.The shape of the corridor is rectangle with right corner.The corridor locates on the second floor of a building.The thickness of the concrete wall of the corridor is 26cm.The host computer sends instructions of reading (or writing) tag to the reader, then the corresponding router performs command of reading (or writing) to operate the electronic tag.The packet loss rate can be calculated after counting the times of router fail to execute the instructions of coordinator correctly or the times of information error after executing the instructions.During the test, the distance between the coordinator and the router nodes changes constantly to verify the impact of different test distances on the reading (or writing) results during the test.The maximum distance of the tag reading is 10 cm.
The test results are shown in Table 1.In outdoor test, when the transmission distance between the coordinator and router (RFID reader/router) is in the range of 80-100 m the maximum packet loss rate is 3%; when the test distance is 80 m or less, the packet loss rate is 0. In indoor test, when the transmission distance is 30-50 m and the maximum packet loss rate is 3%.When the test distance is 30 m or less, the packet loss rate is 0. The test results show that the system can achieve stable data transmission.I also prove that the wireless communication between the ZigBee coordinator and the ZigBee router increases the transmission distance of the reader system.

Figure 1 .
Figure 1.The integration structure of Radio Frequency Identification (RFID) and Wireless Sensor Network (WSN) (a) Integration of RFID tags with sensor nodes; (b) Integration of RFID readers with sensor nodes; (c) Mixed integration.

Figure 1 .
Figure 1.The integration structure of Radio Frequency Identification (RFID) and Wireless Sensor Network (WSN) (a) Integration of RFID tags with sensor nodes; (b) Integration of RFID readers with sensor nodes; (c) Mixed integration.

Figure 2 .
Figure 2. Communication structure of the proposed hybrid system.

Figure 3 .
Figure 3. Block diagram of the RFID reader/router.

Figure 2 .
Figure 2. Communication structure of the proposed hybrid system.

3 .Figure 2 .
Figure 2. Communication structure of the proposed hybrid system.

Figure 3 .
Figure 3. Block diagram of the RFID reader/router.

3. 2 .
Hardware Design of Wireless RFID Reader/Router 3.2.1.Circuit Design of Radio Frequency (RF) Module RF communication circuit consists of micro controller and RF chip.Its main function is to communicate with the electronic tags for completing the exchange of the tag information.The core chip of RF module is Philips MF RC522.Electronic tags are M1 cards produced by Philips. Figure 4a shows the RF communication module circuit.

Figure 3 .
Figure 3. Block diagram of the RFID reader/router.

3. 2 .Figure 4 .
Figure 4. Schematic of the RFID reader/router (a) RFID reader system communication module and (b) ZigBee core control circuit.

Figure 4 .
Figure 4. Schematic of the RFID reader/router (a) RFID reader system communication module and (b) ZigBee core control circuit.

Figure 5
shows I/O interface connection of CC2530 and MF RC522.

Future
Internet 2018, 10, x FOR PEER REVIEW 6 of 12

Figure 5 .
Figure 5.The I/O port circuit between CC2530 and MF RC522.

Figure 5 .
Figure 5.The I/O port circuit between CC2530 and MF RC522.

Figure 6 .
Figure 6.System main program flow chart.

4. 3 .
Design of RFID Reader Software System On the VS2008 platform, the host computer reader software based on serial communication is developed.The serial communication control MSCOMM in Microsoft Foundation Classes (MFC) is used to set the serial number, baud rate, parity bit and stop bit of serial.The application software can realize the function of reading the electronic tag number, reading the data block of the specified sector, and modifying the data block of the specified sector.The flow chart of the communication function between RFID reader and host computer is demonstrated in Figure 8. Future Internet 2018, 10, x FOR PEER REVIEW 8 of 12

Figure 8 .
Figure 8.The flow chart of the communication function between RFID reader and host computer.

Figure 8 .
Figure 8.The flow chart of the communication function between RFID reader and host computer.

Figure 9 .
Figure 9.The communication flow chart of RFID reader and host computer.

4. 4 .
Application Software Design of Host Computer A reader software for host computer based on serial communication is developed on Visual Studio 2008 development platform.With this application software, data in specified block of the tags and sensors are read or modified.The application software for host computer is shown in Figure 10.

Figure 9 .
Figure 9.The communication flow chart of RFID reader and host computer.

4. 4 .
Application Software Design of Host Computer A reader software for host computer based on serial communication is developed on Visual Studio 2008 development platform.With this application software, data in specified block of the tags and sensors are read or modified.The application software for host computer is shown in Figure 10.

Figure 9 .
Figure 9.The communication flow chart of RFID reader and host computer.

4. 4 .
Application Software Design of Host Computer A reader software for host computer based on serial communication is developed on Visual Studio 2008 development platform.With this application software, data in specified block of the tags and sensors are read or modified.The application software for host computer is shown in Figure 10.

Figure 11 .
Figure 11.Hardware for integrated RFID and wireless sensor networks.

Figure 11 .
Figure 11.Hardware for integrated RFID and wireless sensor networks.

Table 1 .
The test results of transmission distance between the ZigBee sensor node and the RFID reader/router node.