Communications and Network, 2013, 5, 16-20
doi:10.4236/cn.2013.51B005 Published Online February 2013 (http://www.scirp.org/journal/cn)
Implementation of Wireless Gateway for Smart Home
Yepeng Ni1, Fang Miao2, Jian bo Liu2, Jianping Chai2
1Computer and Network Center, Communication University of China, Beijing, China
2Information Engineering School, Communication University of China, Beijing, China
Email: nyp_2010@cuc.edu.cn, jp_chai@cuc.edu.cn
Received 2012
ABSTRACT
In recent years, the ZigBee network has been rapid develop in smart home. In order to solve the interconnection prob-
lem between the ZigBee network and the internet in the smart home, a wireless home gateway based on embedded is
designed and implemented in this paper. The gateway is made up of the main controller S3C2440, the ZigBee module
JN5148 and the Wi-Fi module VT6656. It is capable of converting Wi-Fi protocol data or ZigBee protocol data, and
transmitting them to each other. The paper describes the design and implementation process of the gateway hardware
and software, introduces the Wi-Fi protocol data and the ZigBee protocol data conversion method, and solve the bottle-
neck caused by the two protocol different transmission rates. Then the performance of the gateway is tested, and the
results indicate that the performance is stable, and the Wi-Fi–ZigBee gateway is completely meeting the needs of the
smart home.
Keywords: ZigBee; Wi-Fi; Smart Home; S3C2440; JN5148; VT6656
1. Introduction
In recent years, with the rapid development of the com-
puter technology, the communication technology and the
network technology, the smart home is becoming the
future direction and more and more people thirst for
smarter and more comfortable life. Smart home can not
only to provide healthy, safe and comfortable living en-
vironment, and users can also remote monitoring their
home state and control Household appliances. In the
smart home system, using wireless network technology
can provide greater flexibility, mobility, and more in line
with the commun ication features of the home netwo rk. In
the past, people used to adopt the Bluetooth technology
to build the home network. It has many advantages, and
it also has many defects especially for home automation,
For example, it is too complicated, large-power consum-
ing and it has a short distance of communication, a high
price and too small-scale network. However, if we use
ZigBee [1] technology, it will be able to solve the prob-
lem and ensure the security and reliability of data com-
munication.
ZigBee is a low-rate, low-power, low-cost wireless
networking protocol that is targeted toward automation
and remote control applications and is designed to pro-
vide connectivity for equipment that will operate for as
long as several years [2]. The ZigBee home networks
make possible networks such as the following Figure 1.
Smart home wireless network can be achieved using
ZigBee alone. To enable the expansion of conventional
wireless control networks, however, we must maintain
compatibility with curren t Wi-Fi protocol. Wi-Fi [3] as a
wireless networking technology, the most important ad-
vantage is that does not require wiring and not subject to
the constraints of wiring. Wi-Fi technology makes smart
home networks connected to the Internet more conven-
ient. Wi-Fi is used for two primary purposes. Firstly, it is
used to provide access to the home automation system
from Wi-Fi enabled devices, as an alternative to the Zig-
bee based local controller. This approach was taken be-
cause homes increasingly have Wi-Fi networks and
Wi-Fi enabled devices such as PDA’s and mobile phones.
Secondly, it is used to provide remotely monitor and
control through accessing internet. In this way, users can
remotely monitor and control their home devices using a
device connected to the internet. The conceptual design
of home automation infrastructure is as shown in Figure
2. In this paper, a novel, low-cost, and lightweight Wi-
Fi–ZigBee wireless gateway is introduced. It contains
two functions. The one is this system uses ZigBee tech-
nology to transmit the data collected from the node net-
work to the embedded gateway, and then communicates
with the monitoring PC by Wi-Fi network through the
gateway. For another, it is uses Wi-Fi module to send
*This work is supported by Program for National Science & Technol-
ogy Pillar Plan (No. 2011BAH16B03) and by Natural Scienceby The
Communication University of China ( No. XNG1143).
Copyright © 2013 SciRes. CN
Y. P. NI ET AL. 17
commands from monitoring PC to ZigBee network, and
then control home device. The combination of ZigBee
and Wi-Fi has a very important significance in the wire-
less gateway system. Figure 2 displays the gateway op-
eration model.
This paper is organized as follows: Section 2 discusses
the gateway hardware design scheme, including a review
of the module used. Section 3 describes the implementa-
tion of the gateway software. Section 4 provides a dis-
cussion of t he system evaluation an d S ec tion 5 provides a
conclusion.
2. Hardware Design Scheme
The hardware platform of wireless gateway is made up of
four parts: the controller module, storage module, ZigBee
module and Wi-Fi module. The structure is demonstrated
in Figure 3.
2.1. Controller Module
The controller is the core of the embedded home gateway,
it uses Zigbee module to configure the Zigbee terminal
node and receive the node’s data, using Wi-Fi protocol to
Figure 1. ZigBee home networks.
Figure 2. Home automation infrastructure overview.
Figure 3. Hardware structure diagram.
make connection between gateway and the Internet via
Wi-Fi module. Taking into consideration the main func-
tion of the core processor and the characteristics of other
processors within the system, we choose the S3C2440
chip of ARM920T kernel as the core processor. This core
board is characterized by modest expense, low power
consumption, high efficiency, plentiful external interface
and a read-write speed of 400 MHZ, all of which makes
it suitable for network communication and device control
[4].
2.2. ZigBee Networking Module
We use Zigbee technology to make intelligent home ap-
pliance equipment composition star network in smart
home system. The star network consists of a coordinator,
routers and several end devices. The coordinator is re-
sponsible for starting and controlling th e ZigBee network.
The coordinator [5] stores information about the network,
which includes acting as the Trust Center and being the
repository for security keys. The routers extend network
area coverage, dynamically route around obstacles, and
provide backup routes in case of network congestion or
device failure. They can connect to the coordinator and
other routers, and also support child devices. The end
devices can transmit or receive a message, but cannot
perform any routing operations. They must be connected
to either the coordinator or a router, and do not support
child devices. The end devices include home appliances,
door lock sensor, gas and smoke sensor, and CCTV etc.
We use the JN5148 as the ZigBee module [6]. The
JN5148 is a Jennic cor poration prod uct, it is a ultra low
power, high performance surface mount module targeted
at ZigBee PRO networking applications, enabling users
to realize products with minimum time to market and at
the lowest cost. The modules provide a comprehensive
solution with large memory, high CPU and radio per-
formance and all RF components included. The module
is connected to S3C2440 via the UART. Amount the
three universal asynchronous serial interfaces, the
UART0 is a RS232 interface, UART1 and UART2 is
Copyright © 2013 SciRes. CN
Y. P. NI ET AL.
18
TTL interfaces. We used UART0 to connect, set the ap-
propriate baud rate for data transmission. The communi-
cation interface circuit shown in Figure 4 just connected
the TXD0 and RXD0 can be realized data transmission
between the two modules.
2.3. Wi-Fi Module
The wireless gateway adopts VT6656 [7] module to re-
alize the WLAN capabilities. The VT6656 is a VIA
Technologies product. It is an embedded Wi-Fi (802.11
b/g) applicable module. It integrates some network pro-
tocols such as Wi-Fi, TCP/IP, UDP, and DHCP, reduce
the difficulty of the de sign, and impr ov e the ability o f the
host controller to deal with other data. The module pro-
vides an USB interface to connect with host controller. It
enables high-speed 54Mbps wireless connections to sat-
isfy the increasing bandwidth needs of home WLAN
users, supports AP and Ad-Hoc, RF channel automatic
choice and WEP encryption, which is suitable for small
system with standard Wi-Fi access.
2.4. Memory Module
JN5148 chip in ZigBee module uses 2.4G band [8], its
maximum transmission rate can reach 250 Kb/s, but
VT6656 chip can reach 54 Mb/s in that, so during the
real-time data transmission, the transmission rate of
ZigBee may become the transmission bottleneck of the
whole gateway system. Therefore, the system has to
connect external memory as the data buffer, to resolve
the bottleneck caused by the different transmission rates.
Since the processor also has to run Linux operating sys-
tem and application procedure, it connects external
64MB SRAM, 256Mbyte DDR and 512Mbyte NAND
Flash.
3. Software Design Scheme
The software platform uses an open source Linux oper-
ating system, easy to complete the relevant application
development on its basis. The software is mainly related
to the tailoring of the operating system and compiling of
the driver and coding of the application program.
3.1. The Software Architecture of Wireless Ga-
teway
Since this subject studies a typical embedded system, our
team, based on a common method of dividing embedded
systems, divides the system software into the parts as
shown in Figure 5.
The device driver layer realized ZigBee module driver
and Wi-Fi module driver. The OS layer transplanted the
Linux, as the wireless home gateway connects the Wi-Fi
module by USB interface and ZigBee module by UART
Figure 4. JN5148 interface circuit.
Figure 5. Software structure diagram.
interface, therefore, it is necessary to retain the support of
USB and UART, and the supp ort of the wireless networ k,
include Wi-Fi protocol stack and ZigBee protocol stack.
The application layer realized main program and inter-
rupt program, which is the primary in our software work.
3.2. Main Program Design
For the wireless gateway, the main work is converted
data between two network protocols. Once the wireless
gateway has been initialized, an idle state is entered into
until input is received. Data can originate from both the
Wi-Fi network for input to the ZigBee network, or con-
versely from the ZigBee network for output to the Wi-Fi
network. Data from the Wi-Fi network normally takes
the form of commands from users. The data from the
ZigBee network normally takes the form of monitoring
values which display on pc.
For sending data from ZigBee to the Wi-Fi, the gate-
way go through the following processing steps: the Zig-
Bee device receive the data, then remove the physical
layer ZigBee packet, then remove the MAC layer Zig-
Bee packet, then add the Wi-Fi MAC layer header, then
add the Wi-Fi physical layer header, then processing or
delivery. For sending data from Wi-Fi to ZigBee, the
gateway process is just reverse. Wi-Fi–ZigBee commu-
nication model is shown in Figure 6.
The flow chart of the main program is shown in Fig-
ure 7. After the system power on, the application initial-
ized. Then the system test the network, if the network is
accessible, the gateway will start to monitor home net-
work. If the gateway captures input data, the system will
enter interrupt.
Copyright © 2013 SciRes. CN
Y. P. NI ET AL. 19
Figure 6. Wi-Fi–ZigBee communication model.
Figure 7. Flow chart of main program.
3.3. Interrupt Program Design
The interrupt program design is described in Figure 8.
After enter interrupt, the gateway will detect the data
type first. If it is ZigBee data, the gateway will process
data in accordance with the ZigBee protocol. The ZigBee
data will be display on PC and send to Wi-Fi module if
we need. If it isn’t ZigBee data, the gateway will detect it
whether a Wi-Fi data. If it is Wi-Fi data, the gateway will
process data in accordance with the Wi-Fi protocol. The
data will be translated to control command and transmit
to ZigBee module. If it is unknown data, the gateway
will discard it and directly return to the monitoring net-
work status.
4. Performance Evaluation
In this section, performance evaluation and its result are
discussed. The comparison between Wi-Fi–ZigBee gate-
way and Wi-Fi–Bluetooth gateway which uses the same
wireless communication technology, as shown in Table
1. The Wi-Fi–Bluetooth gateway is instability, bad anti-
interference and high cost. The Wi-Fi–ZigBee gateway is
high stability, good anti-interference, goo d flexibility and
low cost.
The following is the performance test results of the
two gateways in the smart home environment. Both gate-
way packet loss rate (PLR) and response time changes
with increasing distance are respectively shown in Fig-
ure 9. The experimental results show that: compared
with the Wi-Fi–Bluetooth gateway, Wi-Fi–ZigBee gate-
way has obvious advantages. With increasing transmis-
sion distance (less than 60 meter) the PLR is maintained
at about 3%, and the response time fluctuations within
1ms (millisecond), completely able to meet the commu-
nication needs of the home environ ment.
Figure 8. Flow chart of Interrupt program.
Figure 9. PLR and Response time curve chart.
Table 1. The comparison between two wireless gateway.
Gateway Network
stability Anti-interference FlexibilityCost
Wi-Fi–Bluetooth
gateway Low Bad Bad High
Wi-Fi–ZigBee
gateway High Good Good Low
Copyright © 2013 SciRes. CN
Y. P. NI ET AL.
Copyright © 2013 SciRes. CN
20
5. Conclusions
This paper takes S3C2440 microprocessor as the basic,
and takes Wi-Fi and ZigBee wireless communication
module as the core device to design and implement the
wireless home gateway. The gateway realizes the com-
plementary advantage of short-distance transmission of
ZigBee and remote data transmission of Wi-Fi. It is ca-
pable of converting Wi-Fi protocol data or ZigBee pro-
tocol data, and transmitting them to each other. From the
result of performance test we can see that the perform-
ance and stability of wireless gateway suits the usual
target of smart home application.
6. Acknowledgements
This work is supported by Program for National Science
& Technology Pillar Plan (No. 2011BAH16B03) and by
Natural Science by The Communication University of
China (No. XNG1245).
REFERENCES
[1] Ipv6 over IEEE 802.15.4(6LoWPAN),
http://6lowpan.net/
[2] S. C. Ergen, “ZigBee/IEEE 802.15.4 Summary,” U.C.
Berkeley, September 10, 2004.
[3] A. M. Khidir and O. J. Thomas, “Access Mechanisms in
Wi-Fi Networks State of Art, Flaws and Proposed Solu-
tions,” ICT: Int. Conf. Telecommun. Doha, Qatar: IEEE
Computer Society, 2010, pp. 280-287.
[4] S3C2440A 32-Bit CMOS Microcontroller User's Manual
Rev1. http://www. Samsungsemi.com, 2004.
[5] T. Shon and Y. Park, “A Hybrid Adaptive Security
Framework for IEEE 802.15.4-based Wireless Sensor
Networks,” KSII Transactions on Internet and Informa-
tion Systems, Vol. 3, No. 6, 2009.
[6] Jennic Corporation, Preliminary Date Sheet-JN5139-1v3
[EB/OL][2010-01-11].http://www.jennic.com
[7] VIA Technologies, VT6656 datasheet,
http://www.via.com.tw/en/products/networking/wireless/
vt6656/
[8] H. Y. Tung, K. F. Tsang and K. L. Lam, “ZigBee Sensor
Network for Advanced Metering Infrastructure,” Interna-
tional Conference on Consumer Electronic (ICCE), 2010,
pp. 95-96.