Vous êtes sur la page 1sur 7

A. Z. Alkar et al.

: IP Based Home Automation System 2201

IP Based Home Automation System


Ali Ziya Alkar Member, IEEE, John Roach, Member, IEEE, Dilek Baysal, Member, IEEE
Abstract — Companies producing consumer products accordingly. Television may be turned on via the internet
have begun working on ways to control their products and channels can be blocked. Heaters may be turned on
over the IP (internet protocol). Multinational electronics prior to arriving home. Settings of the refrigerator may
firms are marking a fair share of their lines using be changed while on vacation to conserve power. The
technologies like the RF ID, a front end to the IP examples are not only limited to home. Drug inventories
networks. The main feature that is achieved by the may be tracked in pharmaceutical warehouses for better
already-existing home automation systems is that, every service. Humidity levels around farm fields may be
piece of equipment integrated is to be controlled by a followed up remotely, via sensors for proper irrigation.
central unit. The proposed solutions based on this idea are
The studies in [1-6][10-13] and [14] are some of the
relatively expensive and difficult to configure per each
examples of internet based automation. However, they
system environment. IP based systems are supposed to be
are not feasible to be implemented as a low cost solution.
simpler to be accessed and easier to manipulate, with the
A low cost Java-Based Home Automation system,
only necessity being, close proximity to a direct internet
without highlighting the low level details of the type of
connection. With this in mind, we designed a low cost
peripherals that can be attached is presented in [7].
hardware/software framework based on a unit what we
However, all these approaches rely on a central unit, and
call the IPAcBox which allows home/industrial
a computer to connect to the outside world.
automation systems to be accessed and controlled through
a direct internet connection right out of the box even in There are also internet based automation examples that
dynamic IP configurations. We have developed the have been published such as [8] where the system was
software and hardware infrastructure necessary for this based on a special dedicated network which is not a
system. This research consists of designing the server and generic solution. Another proposed approach [9] is the
the client side software, the communication protocols and research which is only based on a model and without
addressing some hardware issues, along with a proposal hardware implementations. Most importantly this
to further our studies.1 implementation also relies on a central server which may
Index Terms — Automation, IP, Internet be too expensive and complicated to set up for the end
user. Moreover, these are far from providing a generic
I. INTRODUCTION solution to the problem that is in need today.
Automation has become a de facto standard in our In this paper, we present a low cost secure and flexible
daily lives. The number of home automation systems home automation framework based on the IP and its
installed is estimated to reach around 200 million by prototype implementation aimed at any home appliances
2011. Many firms have begun investing in technologies to be manufactured. In this framework, the
such as the RF ID to meet the increasing demand of communication protocol between the hardware and the
providing real time information to the home automation consumer electronics devices to be used in home
networks. Internet is currently the most efficient way to automation have also been presented. We propose an
control or monitor home appliances. optimized, self adaptive communication protocol. The
designed system will be open to expansions, further
There are several usage scenarios for the internet based
developments, and will enable the control of different
automation systems. For instance while shopping it is
types of devices as long as they are built within the
possible to connect to the refrigerator through the
guidelines of the protocol suggested. The system is
internet and its contents as well as the expiration date of
designed to connect to a designated server for web
the foods, etc. can be accessed through an RF ID
accessibility without the need for any setup on the user
marking system. In this way, it is possible to keep track
side. This feature makes this system uniquely easy to
of what to buy and unnecessary purchases can be
operate and low cost.
avoided. At home, one will be able to designate the hours
during which children may watch TV even while not The ability to remotely update the device firmware,
physically present by remotely arranging the settings being manufacturer independent and the added security
functions are some of the other benefits of this
Ali Ziya Alkar is an Associate Professor at the Electrical & Electronics
Engineering Dept., Hacettepe University, Ankara, Turkey (e-mail:
framework.
alkar@hacettepe.edu.tr). The next section will briefly introduce the units in the
John Roach, Renko Electronics Ltd, Ankara, Turkey (e-
mail:johnroach1985@gmail.com). basis of our framework, Section 3, discusses the
Dilek Baysal is an electronics engineer currently working for Aselsan hardware and the software components of the system,
A.S, Ankara, Turkey (e-mail:dilekbaysal.baysal@gmail.com). Section 4 details the communication protocols. Section 5
is the conclusions.
Contributed Paper
Original manuscript received 08/26/10
Revised manuscript received 09/03/10
Current version published 12/23/10
Electronic version published 12/30/10. 0098 3063/10/$20.00 © 2010 IEEE
2202 IEEE Transactions on Consumer Electronics, Vol. 56, No. 4, November 2010

II. IP BASED HOME AUTOMATION The Software Technology:


SYTEM Software modules required by the software server are an
open source PHP server3, an object oriented open source
programming language4, Secure Shell (SSH), a database
Internet language5 and an open port for the chat software server to
communicate with the IPAcBox.
The selected Operating System (O/S) running on the
IPAcBox is an open source operating system6. The choice
Application
Server for an open source operating system on the embedded
User system is based on the fact that it is freeware and open to
modifications if desired. For the server actually there is no
IPAcBox Enabled Hardware
limitation as long as it can run POSIX (Portable Operating
System Interface) based programs on it. POSIX is the name
Fig. 1. General Overview of the system of a family of related standards specified by the IEEE to
define the application programming interface (API), along
The system is outlined in Fig 1. The user can connect to a with shell and utility interfaces for software compatibility
predetermined configured application server which is with variants of the UNIX operating system. For our
located anywhere in the world through the internet by either research purposes, a open source operating system has been
a mobile phone or a laptop/desktop computer. The IP chosen for our system and all the software has been
enabled home network devices (simply named here as the thoroughly tested on this O/S.
appliances) are also connected to the application server, and
stay connected (on status) as long as they are not Principles of operation of the system:
disconnected. IPAcBox connects to the server designated by a real IP
The system is basically formed of the hardware and the address, predetermined at the design stage. In this server, a
software components. These are briefly outlined as follows: database to compare and analyze the information sent via
the IPAcBox will be available, along with PHP and
The Hardware Technology: Phython software to provide a user interface to process the
The hardware technology is based on a microcontroller incoming data. In terms of operation, the system is set up
based interfacing circuitry that communicates with the to work out of the box and needs no further configuration
appliance and the software server. This hardware unit with on the user side. This is a very important feature provided
a microcontroller, special interfacing circuitries and by the unique connection scheme which is also detailed in
network connection is what we name as the IP Access Box this paper. After the physical connection of the hardware to
(IPAcBox). The data packets sent from the appliance are the appliance through the USB interface, the user connects
processed and sent to the network by the IPAcBox. The to the homepage of the software server. The user creates a
communication process between the devices/IPAcBox and profile in the first run of the program (Fig 2).
the IPAcBox/server will be detailed in Section 3.
The circuit board design has been completed following an
open source reference2. Optimizations were performed as
necessary on the initial design. In the heart of the design
there is a 32 bit microprocessor. The system also
accommodates a graphics accelerator. The added processing
power can be used down the line for image and video
transfer as well as video analytics where necessary.
IPAcBox also includes an integrated power manager for
optimized power dissipation. The hardware is interfaced to
the appliance through a high speed USB connection. In
addition, the power is supplied to the IPAcBox through the
USB interface from the device it is connected to, thus
eliminating the need for an extra power connection. The
input/output ports are optimized with respect to the initial
design to lower the design costs, reduce power consumption
Fig. 2. User Creating a Profile
and the design complexities. The maximum design
consumes less than 2 Watts.

3
Apache
4
Python
5
SQL
2 6
The USB-powered board is a low-cost, fanless single board computer Linux
A. Z. Alkar et al.: IP Based Home Automation System 2203

Then the user accesses the designated home page by entering confidentiality and integrity of data over an insecure
the username and password. The name, unique serial number network, such as the Internet.
for the item and the passwords of the products that are needed
In this section, the three communication protocols used in
to be added are entered as shown in Fig 3.
this research will be explained; the protocols for the
IPAcBox and the application server, the IPAcBox and the
appliance and finally the IPAcBox and the user.

III.a. IPAcBox-Application Server Communication Protocol


Looking at Fig. 5, one could get a more visual description of
how the IPAcBox and application server communicates.
P1: The IPAcBox is powered up. The O/S will initiate the
DHCP protocol and call up P2.
P2: This process tries to connect to a predetermined application
Fig. 3. Adding Appliances to the server
IP address which was determined by the manufacturer at
production. The connection is an SSH connection.
Only if the user prefers to do so, information such as power
consumption, preferred appliance settings and collected
sample data can be shared with the manufacturer. The aim for
this option is to provide the manufacturer with statistical data CSV doc
P1
to be used for usage analysis. Through a user friendly
interface, the user makes any change to the appliances that
are included in his/her network, looks up the information
about the current status of any of the products, and may look
at the history of each product with timestamp information for
P6
statistical purposes. As an example a refrigerator is added and
the operation (ON/OFF/StandBy), can be monitored as well
P2
its sample content on the initial page of this appliance (Fig 4).

IPAcBox Side

Application Server Side

P3 P5
Fig. 4. Managing the appliances

In Fig. 4, it can be seen that the device is turned on and the


inventory can be visualized as well.

III. THE COMMUNICATION PROTOCOL


While designing the communication protocol, the security of P4

information and fast data transmission were kept in mind. To


this extent we have used a native SSH (Secure Shell) protocol
and a communication protocol we are suggesting in this paper. Secure

SSH is a network protocol that allows data to be exchanged Unsecure


using a secure channel between two networked devices. It is
used primarily on UNIX based systems to access shell Database
accounts. The encryption used by SSH provides
Fig. 5. The communication protocol
2204 IEEE Transactions on Consumer Electronics, Vol. 56, No. 4, November 2010

P3: The IPAcBox is connected to the server using SSH In Fig 6, during the transmission an error seems to have
however it still needs to be registered. A small script on the occurred. The file is retransmitted. The reader should note
server gets and checks the connected appliance’s MAC, IP that these two files would only be sent and received through
address and its encryption key. The encryption key and the the SSH which will be encrypted. Each IPAcBox will have
MAC address are unique and embedded within the its own permission set within the server. In other words
IPAcBox. If the encryption key and MAC address are another IPAcBox will not be able to connect to this session
correctly defined, the P3 will allow a direct connection and get/send a file.
from the appliance. If the server is too busy, the script will
If a MAC is registered to a user, then the IPAcBox enters
inform the IPAcBox to connect to another available server.
the chat room that is registered to that user.
P4: The appliance (IPAcBox) has now been authenticated. It
P6: Any “unsecured transaction” would be checked through
is time to check if the IPAcBox software and server IP list are
the comma-separated values7 (CSV) already within the
up to date. If it is not, a randomly named file is created by the
IPAcBox. This CSV document which shall be referred to as
server with a permission only limited to that IPAcBox that it
functions.csv contains what the functions sent by the server
is communicating with. The file name and its link are sent to
actually mean. It is set by the manufacturer and is updated
the IPAcBox. The IPAcBox will check the encryption key
only by the server. An example CSV document can contain
file. If it is verified then the IPAcBox receives the update
the two lines (get and send) shown as in Fig 7.
files automatically through the SSH. After each appliance
reboot, the P3 and P4 process are rerun.
# Sample CSV document
If the IPAcBox firmware and server lists are up to date, - function_name,called_file,options
then a special “communication channel” in the server is - get,ssh_get.py,-file
established which will be used only for “unsecured - send,ssh_send.py,-file
transactions” where the data transfer speed is more
important than “safe transactions”. Fig.7. An example CSV document
The communication between P5 and P6 should be In Fig.7, P6 will call an object oriented open source
considered unsafe at all times. No personal information is programming language script (ssh_get.py) with the option
allowed to be transacted through this protocol. “–file”, indicating that the IPAcBox should get the
The “communication channel” mentioned above can be randomly named file from the server when the server issues
thought as a chat room where only authenticated appliances the “get” command.
are allowed. To this extent an asynchronous multi-threaded Although the process speed is quite fast, it may decrease as
script has been written. users and their appliances increase. To solve the bottleneck
P5: Any “unsecure transactions” will be correctly formatted problem the appliance can be routed to a new server. Since
in this process for P6. The basic formatting standard the framework is modular, the only thing to do is to update
example is shown in Fig 6. the IP list within the IPAcBox once it is successfully
connected to the Application Server.
server@<server.IP>:@<MAC>#are_you_there As one could observe, the whole system is quite dynamic. If
MAC@<IPBOX.IP>:yes_i_am the manufacturer would wish to expand the functions while
server@<server.IP>:@<MAC>#need_update
MAC@<IPBOX.IP>: the appliance is already in the market, the solution would be
sending_update#<random_filename>#md5 to update the functions.csv document and add an extra
server@<server.IP>: script to be used in the IPAcBox. The same dynamic
@<MAC>#error#resend#<random_filename> approach also exists between the IPAcBox and the
MAC@<IPBOX.IP>:
@sending_update#<random_filename>#md5 appliance itself.
server@<server.IP>:
@<MAC>#success#<random_filename> As for data privacy protection, it is made sure that the
manufacturer will only be able to access data made
Fig. 6. The basic communication between P5-P6
available anonymously on the server unless the user
explicitly allows personal data to be transferred to the
In Fig. 6, it is possible to see how the server alerts the server. Otherwise all data is stored within the IPAcBox
IPAcBox to get/send a file from/to the server. The itself. Data is read and called from the IPAcBox through the
<server.IP> is the IP of the server and <MAC> is the MAC internet. Server maintenance cost is low on the server side
address of the IPAcBox which belongs to the user. since no data is to be recorded onto the servers. Although
<IPACBOX.IP> is the IP of the IPAcBox which belongs to this system was tested for Wi-Fi and LAN connections any
the <MAC>. If the IPAcBox is not present, the user is other internet connection will be sufficient as long as the
informed that the IPAcBox (appliance) is not correctly IPAcBox is able to get an IP from a DHCP server.
connected to the internet. Otherwise the server sends a new
command to the designated channel as:
7
A comma-separated values (CSV) file is a simple text format for a
server@<server.IP>:@<MAC>#need_update database table. It is often used to move tabular data between different
MAC@<IPACBOX.IP>:@sending_update#<random_filename>#md5 computer programs that support the format.
A. Z. Alkar et al.: IP Based Home Automation System 2205

III.b. IPAcBox-Appliance Communication Protocol When a new accessory is plugged-in, the IPAcBox checks a
The dynamic relation between the application server and the predetermined folder for the configuration documents via a
IPAcBox has also been implemented within the relation between script. If the vendor id and device id are on the first line of
the appliance and possible accessories that can be connected to the configuration document the script starts using the
the IPAcBox. Primarily appliances and also any accessory such accessory according to given configurations.
as a camera, sensors etc. can be added to the IPAcBox via the HEX codes for data type is for appliances/accessories that give
USB interface using the HID (human interface device) protocol. more than single output. Hence the start of a data stream from
A script is run on the IPAcBox that reads which reads data from an appliance/accessory must start with a certain HEX code.
any connected HID device. Configurations of the HID devices
can be sent by the manufacturer remotely. The system’s work The label for each data is basically the application server
routine is as in Figure 8; friendly data label which will be explained in more detail
while explaining the IPAcBox-User communication protocol.
Each data which is received from the appliance/accessory
(sensors, camera, displays etc.) is labeled with its
appropriate label indicating its origin. The accessory could
also be a sensor node which includes intelligible data.
So far we have covered the communication protocols
User Layer

between the IPAcBox-Application Server and the


IPAcBox-Appliance/accessory. The last protocol is the
IPAcBox-User connection protocol.

III.c. IPAcBox-User Communication Protocol


When a user wishes to connect to the IPAcBox (in other words,
IPAcBox Python Layer

to the appliance which the IPAcBox is connected to), he/she


must first login to the internet site provided by the application
server. The application server runs a PHP server. When the user
logs in, a script on the server checks whether the IPAcBox
registered to the to the user’s chat room. To check this, a simple
command is issued which looks like the following:
server@<server.IP>:@<MAC>#are_you_there
MAC@<IPACBOX.IP>:yes_i_am

It should be noted that each user has a designated folder with


the application server which is created upon user creation.
Every user can only reach the folder that belongs to them.
Application Server

server@<server.IP>:@<MAC>#need_update
MAC@<IPACBOX.IP>:@sending_update#<random_filename>#md5

In the example shown above, the server asks for an update


from the IPAckBox. Once “sending_update” code reaches
the chat room (i.e. the server) a small script calls in a
“check-up” script that checks if the randomly named file
has arrived is “ok”. This is done by using the md5 code sent
by the IPAcBox and the one that the check-up script
calculated. If there is problem the server sends:
Fig.8. Appliance/Accessory addition to the IPAcBox
server@<server.IP>:@<MAC>#error#resend#<random_filename>
The communication between the externaly device and the MAC@<IPACBOX.IP>:sending_update#<random_filename>#md5
IPAcBox must be done according to a configuration file.
As one can see, the file is resent under the same name. If
The format of the configuration file is shown in Figure 9.
the file is sent correctly i.e. if the md5 matches the file’s
md5 hash which is checked by the server’s “check-up”
Line script, the server sends an acknowledgement to the
Number IPAcBox with the following command8:
HID Configurations
01 server@<server.IP>:<MAC>#success#<random_filename>
(End point, device vendor id., etc.)
indicating that the data is correctly sent.
02 HEX codes for data type
Label for each data
03
(May be omitted if data is not to be labelled ) 8
MD5 (Message-Digest algorithm 5) is a widely used cryptographic hash
function with a 128-bit hash value. Specified in RFC 1321 used to check
Fig.9 The format of the configuration file the integrity of files.
2206 IEEE Transactions on Consumer Electronics, Vol. 56, No. 4, November 2010

A script which started when the user logs in starts reading REFERENCES
this file. As each data has a label, the label is cross
referenced to a configuration file within the server sent by [1] Renato Jorge Caleira Nunes, ”A Web-Based Approach to the
the manufacturer previously. Unlike the user data which Specification and Programming of Home Automation Systems”,
will be erased once user logs off; the appliance IEEE MELECON 2004, pp.693, May 12-15, 2004, Dubrovnik,
Croatia.
configuration data is held within a SQL database to ensure [2] Guangming Song, Zhigang Wei, Weijuan Zhang and Aiguo Song,
fast access to frequently used data. ”Design of a Networked Monitoring System for Home Automation”,
IEEE, pp.933, July 2007.
The data is than displayed to the user according to the [3] K. Tan, T. Lee and C. Yee Soh, “Internet-Based Monitoring of
specifications for the appliance given by the manufacturer. Distributed Control Systems-An Undergraduate Experiment,” IEEE
The data labels which were sent by the IPAcBox ensure that Transactions on Education, Vol. 45, No. 2, May 2002.
each data will be placed in a proper format. [4] Chi Chung Ko, Ben M. Chen, Shaoyan Hu, Vikram Ramakrishnan,
Chang Dong Cheng, Yuan Zhuang, and Jianping Chen, “A Web-
The page that displays the data is refreshed at certain time Based Virtual Laboratory on a Frequency Modulation Experiment,”
IEEE Transactions on Systems, Man, and Cybernetics-Part C:
intervals unless the user explicitly refreshes before. The Application and Reviews, Vol. 31, No. 3, pp. 295-303, August 2001.
whole process is repeated upon a refresh. [5] N. Swamy, O. Kuljaca and F. Lewis, “Internet-Based Educational
Control Systems Lab Using Net-meeting, ”IEEE Transaction on
Education, Vol. 45, No. 2, pp. 145-151, May 2002.
IV. CONCLUSIONS [6] P. Lin and H. Broberg, “Internet Based Monitoring and Control for
In this paper we introduced a low cost, dynamic solution to HVAC Applications,” IEEE Industry Applications Magazine, pp.
49-54, January 2002.
the home automation using the internet. The novel approach [7] A. R. Al-Ali and M. AL-Rousan, “Java-Based Home Automation
in this paper discusses the migration of the control and System”, IEEE Transactions on Consumer Electronics, Vol. 50, No.
monitoring of home/work appliances directly to the internet 2, May 2004.
through special hardware and protocols. [8] Neng-Shiang Liang, Li-Chen Fu and Chao-Lin Wu; “An Integrated,
Flexible, and Internet-Based Control Architecture for Home
The proposed IP based system offers several novel benefits, Automation System in the Internet Era,” Proceedings ICRA 2002,
IEEE International Conference on Robotics and Automation, Vol. 2,
if compared to other home automation designs. IPAcBox's pp. 1101 –1106, 2002.
capability of connecting to a server directly over the [9] J. C. Nunes and J. C. M. Delgado, “An Internet Application for
internet is advantageous with respect to other systems. The Home Automation,” Electrotechnical Conference, MELECON 10th
system proposed is low cost and utilizes a database that is Mediterranean, Vol. 1, pp. 298 -301, 2000.
[10] J.L. Ryan, “Home Automation”, Electronics and Communication
universal to all products of all manufacturers. The plug and Engineering Journal, pp.185, July/August 1989.
play characteristics, along with the security features [11] Guangming Song, Yaoxin Zhou, Weijuan Zhang and Aiguo Song,
embedded in hardware and software makes the system both “A Multi-interface Gateway Architecture for Home Automation
easy to use and secure as well. With these in mind, Networks”, IEEE Transactions on Consumer Electronics, Vol. 54,
No. 3, pp.1110, August 2008.
numerous projects can be developed, thus leading to further [12] Hyung Seok Kim, Joo-Han Song and Seok Lee, “Energy-Efficient
technological advancements. Traffic Scheduling in IEEE 802.15.4 for Home Automation
Networks”, IEEE Transactions on Consumer Electronics, Vol. 53,
Appliance manufacturers will be able to use this framework No. 2, pp.369, May 2007.
with only a few interface changes, with minimal additional [13] Peter Bergstrom, Kevin Driscoll and John Kimball, “Making Home
expenditure, through the usage of the hardware and the data Automation Communications Secure”, IEEE Computer, pp.50,
transmission protocols that are proposed, in a plug and play October 2001.
[14] Intark Han, Hong-Shik Park, Youn-Kwae Jeong and Kwang-Roh
fashion. Normally systems such as these may require Park, “An Integrated Home Server for Communication, Broadcast
difficult interventions, configurations on the consumer site, Reception, and Home Automation”. IEEE Transactions on Consumer
which are proven to be costly and time consuming. With the Electronics, Vol. 52, No. 1, pp.104, Feb 2006.
system proposed, the appliance manufacturer may provide
the interfacing hardware either seamlessly embedding into
the appliance or as a separate device attached to the
appliance.
IPAcBox can be accessed remotely, to evaluate the status of
BIOGRAPHIES
the product and submit firmware updates into the appliance Ali Ziya Alkar received his B.S. degree in 1988 at
if necessary by the manufacturer. The appliances that are Electrical & Electronics Engineering Department,
connected to the internet via the IPAcBox may allow the Hacettepe University, Ankara, Turkey. He completed
his M.S. study in 1991 at the Electrical & Computer
manufacturer to collect information for statistical purposes. Engineering Department of the University of
This property can be customized according to the Colorado at Boulder, Colorado, U.S.A. In 1995 he
manufacturers’ requests with the consent of the consumers received his Ph.D. from the same university. His main
due to privacy concerns. interests are computer architecture and design, and
application of security algorithms to VLSI and
Since the appliances are indirectly connected into each embedded systems. Supervised and completed several
other through the server, it may be possible for them to government funded research projects. He is an Associate Professor at the
Dept. of Electrical and Electronics Engineering, Hacettepe University. He
communicate with each other, receiving other appliances’ is a member of the IEEE.
status and decide autonomously accordingly. This is
currently our topic of our study.
A. Z. Alkar et al.: IP Based Home Automation System 2207

John ùefik Roach is currently working for Renko Dilek Baysal received her B.S. degree in 2010 at
Electronics Ltd. in Ankara, Turkey. John is a Electrical & Electronics Engineering Department,
Certified Application Developer (APTECH), Hacettepe University, Ankara, Turkey. She is
Certified Information Systems Manager (APTECH), currently working for Aselsan A.S. She is mainly
Open Software Developer. His specialties are but working on boundary scan testing, implementation
not limited to Java, An object oriented open source of embedded systems. She is a member of the IEEE
programming language, C#, C, JSP, ASP.Net, PHP,
HTML/CSS/JavaScript, XML, Assembly, SQL,
Microsoft SQL Server, Network Systems, RHL,
Debian,UNIX, and Windows. Reliability tests for hardware and basic circuit
design. His main interests are embedded software designs and computer
networks. He is a member of the IEEE.

Vous aimerez peut-être aussi