Você está na página 1de 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

have begun working on ways to control their products over the IP (internet protocol). Multinational electronics firms are marking a fair share of their lines using technologies like the RF ID, a front end to the IP networks. The main feature that is achieved by the already-existing home automation systems is that, every piece of equipment integrated is to be controlled by a central unit. The proposed solutions based on this idea are relatively expensive and difficult to configure per each system environment. IP based systems are supposed to be simpler to be accessed and easier to manipulate, with the only necessity being, close proximity to a direct internet connection. With this in mind, we designed a low cost hardware/software framework based on a unit what we call the IPAcBox which allows home/industrial automation systems to be accessed and controlled through a direct internet connection right out of the box even in dynamic IP configurations. We have developed the software and hardware infrastructure necessary for this system. This research consists of designing the server and the client side software, the communication protocols and addressing some hardware issues, along with a proposal to further our studies.1
Index Terms Automation, IP, Internet

accordingly. Television may be turned on via the internet and channels can be blocked. Heaters may be turned on prior to arriving home. Settings of the refrigerator may be changed while on vacation to conserve power. The examples are not only limited to home. Drug inventories may be tracked in pharmaceutical warehouses for better service. Humidity levels around farm fields may be followed up remotely, via sensors for proper irrigation. The studies in [1-6][10-13] and [14] are some of the examples of internet based automation. However, they are not feasible to be implemented as a low cost solution. A low cost Java-Based Home Automation system, without highlighting the low level details of the type of peripherals that can be attached is presented in [7]. However, all these approaches rely on a central unit, and a computer to connect to the outside world. There are also internet based automation examples that have been published such as [8] where the system was based on a special dedicated network which is not a generic solution. Another proposed approach [9] is the research which is only based on a model and without hardware implementations. Most importantly this implementation also relies on a central server which may be too expensive and complicated to set up for the end user. Moreover, these are far from providing a generic solution to the problem that is in need today. In this paper, we present a low cost secure and flexible home automation framework based on the IP and its prototype implementation aimed at any home appliances to be manufactured. In this framework, the communication protocol between the hardware and the consumer electronics devices to be used in home automation have also been presented. We propose an optimized, self adaptive communication protocol. The designed system will be open to expansions, further developments, and will enable the control of different types of devices as long as they are built within the guidelines of the protocol suggested. The system is designed to connect to a designated server for web accessibility without the need for any setup on the user side. This feature makes this system uniquely easy to operate and low cost. The ability to remotely update the device firmware, being manufacturer independent and the added security functions are some of the other benefits of this framework. The next section will briefly introduce the units in the basis of our framework, Section 3, discusses the hardware and the software components of the system, Section 4 details the communication protocols. Section 5 is the conclusions.

I. INTRODUCTION
Automation has become a de facto standard in our daily lives. The number of home automation systems installed is estimated to reach around 200 million by 2011. Many firms have begun investing in technologies such as the RF ID to meet the increasing demand of providing real time information to the home automation networks. Internet is currently the most efficient way to control or monitor home appliances. There are several usage scenarios for the internet based automation systems. For instance while shopping it is possible to connect to the refrigerator through the internet and its contents as well as the expiration date of the foods, etc. can be accessed through an RF ID marking system. In this way, it is possible to keep track of what to buy and unnecessary purchases can be avoided. At home, one will be able to designate the hours during which children may watch TV even while not physically present by remotely arranging the settings
Ali Ziya Alkar is an Associate Professor at the Electrical & Electronics Engineering Dept., Hacettepe University, Ankara, Turkey (e-mail: alkar@hacettepe.edu.tr). John Roach, Renko Electronics Ltd, Ankara, Turkey (email:johnroach1985@gmail.com). Dilek Baysal is an electronics engineer currently working for Aselsan A.S, Ankara, Turkey (e-mail:dilekbaysal.baysal@gmail.com).

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 SYTEM


Internet

The Software Technology: 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 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 for an open source operating system on the embedded system is based on the fact that it is freeware and open to modifications if desired. For the server actually there is no limitation as long as it can run POSIX (Portable Operating System Interface) based programs on it. POSIX is the name of a family of related standards specified by the IEEE to define the application programming interface (API), along with shell and utility interfaces for software compatibility with variants of the UNIX operating system. For our research purposes, a open source operating system has been chosen for our system and all the software has been thoroughly tested on this O/S. Principles of operation of the system: IPAcBox connects to the server designated by a real IP address, predetermined at the design stage. In this server, a database to compare and analyze the information sent via the IPAcBox will be available, along with PHP and Phython software to provide a user interface to process the incoming data. In terms of operation, the system is set up to work out of the box and needs no further configuration on the user side. This is a very important feature provided by the unique connection scheme which is also detailed in this paper. After the physical connection of the hardware to the appliance through the USB interface, the user connects to the homepage of the software server. The user creates a profile in the first run of the program (Fig 2).

Application Server

User IPAcBox Enabled Hardware

Fig. 1. General Overview of the system

The system is outlined in Fig 1. The user can connect to a predetermined configured application server which is located anywhere in the world through the internet by either a mobile phone or a laptop/desktop computer. The IP enabled home network devices (simply named here as the appliances) are also connected to the application server, and stay connected (on status) as long as they are not disconnected. The system is basically formed of the hardware and the software components. These are briefly outlined as follows: The Hardware Technology: The hardware technology is based on a microcontroller based interfacing circuitry that communicates with the appliance and the software server. This hardware unit with a microcontroller, special interfacing circuitries and network connection is what we name as the IP Access Box (IPAcBox). The data packets sent from the appliance are processed and sent to the network by the IPAcBox. The communication process between the devices/IPAcBox and 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 and the design complexities. The maximum design consumes less than 2 Watts.

Fig. 2. User Creating a Profile

3 4 5 2

The USB-powered board is a low-cost, fanless single board computer

Apache Python SQL 6 Linux

A. Z. Alkar et al.: IP Based Home Automation System

2203

Then the user accesses the designated home page by entering the username and password. The name, unique serial number for the item and the passwords of the products that are needed to be added are entered as shown in Fig 3.

confidentiality and integrity of data over an insecure network, such as the Internet. In this section, the three communication protocols used in 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.

Fig. 3. Adding Appliances to the server

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 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 statistical purposes. As an example a refrigerator is added and the operation (ON/OFF/StandBy), can be monitored as well its sample content on the initial page of this appliance (Fig 4).

P2: This process tries to connect to a predetermined application IP address which was determined by the manufacturer at production. The connection is an SSH connection.

P1

CSV doc

P6 P2

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 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. SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. It is used primarily on UNIX based systems to access shell accounts. The encryption used by SSH provides
P4

Secure Unsecure

Database

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 however it still needs to be registered. A small script on the server gets and checks the connected appliances MAC, IP address and its encryption key. The encryption key and the MAC address are unique and embedded within the IPAcBox. If the encryption key and MAC address are correctly defined, the P3 will allow a direct connection from the appliance. If the server is too busy, the script will inform the IPAcBox to connect to another available server. P4: The appliance (IPAcBox) has now been authenticated. It is time to check if the IPAcBox software and server IP list are up to date. If it is not, a randomly named file is created by the server with a permission only limited to that IPAcBox that it is communicating with. The file name and its link are sent to the IPAcBox. The IPAcBox will check the encryption key file. If it is verified then the IPAcBox receives the update files automatically through the SSH. After each appliance reboot, the P3 and P4 process are rerun. If the IPAcBox firmware and server lists are up to date, then a special communication channel in the server is established which will be used only for unsecured transactions where the data transfer speed is more important than safe transactions. The communication between P5 and P6 should be considered unsafe at all times. No personal information is allowed to be transacted through this protocol. The communication channel mentioned above can be thought as a chat room where only authenticated appliances are allowed. To this extent an asynchronous multi-threaded script has been written. P5: Any unsecure transactions will be correctly formatted in this process for P6. The basic formatting standard example is shown in Fig 6.
server@<server.IP>:@<MAC>#are_you_there MAC@<IPBOX.IP>:yes_i_am server@<server.IP>:@<MAC>#need_update MAC@<IPBOX.IP>: sending_update#<random_filename>#md5 server@<server.IP>: @<MAC>#error#resend#<random_filename> MAC@<IPBOX.IP>: @sending_update#<random_filename>#md5 server@<server.IP>: @<MAC>#success#<random_filename> Fig. 6. The basic communication between P5-P6

In Fig 6, during the transmission an error seems to have occurred. The file is retransmitted. The reader should note that these two files would only be sent and received through the SSH which will be encrypted. Each IPAcBox will have its own permission set within the server. In other words another IPAcBox will not be able to connect to this session and get/send a file. If a MAC is registered to a user, then the IPAcBox enters the chat room that is registered to that user. P6: Any unsecured transaction would be checked through the comma-separated values7 (CSV) already within the IPAcBox. This CSV document which shall be referred to as functions.csv contains what the functions sent by the server actually mean. It is set by the manufacturer and is updated only by the server. An example CSV document can contain the two lines (get and send) shown as in Fig 7. # Sample CSV document function_name,called_file,options get,ssh_get.py,-file send,ssh_send.py,-file
Fig.7. An example CSV document

In Fig.7, P6 will call an object oriented open source programming language script (ssh_get.py) with the option file, indicating that the IPAcBox should get the randomly named file from the server when the server issues the get command. Although the process speed is quite fast, it may decrease as users and their appliances increase. To solve the bottleneck problem the appliance can be routed to a new server. Since the framework is modular, the only thing to do is to update the IP list within the IPAcBox once it is successfully connected to the Application Server. As one could observe, the whole system is quite dynamic. If the manufacturer would wish to expand the functions while the appliance is already in the market, the solution would be to update the functions.csv document and add an extra script to be used in the IPAcBox. The same dynamic approach also exists between the IPAcBox and the appliance itself. As for data privacy protection, it is made sure that the manufacturer will only be able to access data made available anonymously on the server unless the user explicitly allows personal data to be transferred to the server. Otherwise all data is stored within the IPAcBox itself. Data is read and called from the IPAcBox through the internet. Server maintenance cost is low on the server side since no data is to be recorded onto the servers. Although this system was tested for Wi-Fi and LAN connections any other internet connection will be sufficient as long as the IPAcBox is able to get an IP from a DHCP server.
7 A comma-separated values (CSV) file is a simple text format for a database table. It is often used to move tabular data between different computer programs that support the format.

In Fig. 6, it is possible to see how the server alerts the IPAcBox to get/send a file from/to the server. The <server.IP> is the IP of the server and <MAC> is the MAC address of the IPAcBox which belongs to the user. <IPACBOX.IP> is the IP of the IPAcBox which belongs to the <MAC>. If the IPAcBox is not present, the user is informed that the IPAcBox (appliance) is not correctly connected to the internet. Otherwise the server sends a new command to the designated channel as:
server@<server.IP>:@<MAC>#need_update
MAC@<IPACBOX.IP>:@sending_update#<random_filename>#md5

A. Z. Alkar et al.: IP Based Home Automation System

2205

III.b. IPAcBox-Appliance Communication Protocol The dynamic relation between the application server and the IPAcBox has also been implemented within the relation between the appliance and possible accessories that can be connected to the IPAcBox. Primarily appliances and also any accessory such as a camera, sensors etc. can be added to the IPAcBox via the USB interface using the HID (human interface device) protocol. A script is run on the IPAcBox that reads which reads data from any connected HID device. Configurations of the HID devices can be sent by the manufacturer remotely. The systems work routine is as in Figure 8;

When a new accessory is plugged-in, the IPAcBox checks a predetermined folder for the configuration documents via a script. If the vendor id and device id are on the first line of the configuration document the script starts using the accessory according to given configurations. HEX codes for data type is for appliances/accessories that give more than single output. Hence the start of a data stream from an appliance/accessory must start with a certain HEX code. The label for each data is basically the application server 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.

User Layer

So far we have covered the communication protocols 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, 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 users 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

IPAcBox Python Layer

Application Server

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.
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>
MAC@<IPACBOX.IP>:sending_update#<random_filename>#md5

The communication between the externaly device and the IPAcBox must be done according to a configuration file. The format of the configuration file is shown in Figure 9. Line Number 01 02 03 HID Configurations (End point, device vendor id., etc.) HEX codes for data type Label for each data (May be omitted if data is not to be labelled )
Fig.9 The format of the configuration file

As one can see, the file is resent under the same name. If the file is sent correctly i.e. if the md5 matches the files md5 hash which is checked by the servers check-up script, the server sends an acknowledgement to the IPAcBox with the following command8:
server@<server.IP>:<MAC>#success#<random_filename>

indicating that the data is correctly sent.


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 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 this file. As each data has a label, the label is cross referenced to a configuration file within the server sent by the manufacturer previously. Unlike the user data which will be erased once user logs off; the appliance configuration data is held within a SQL database to ensure fast access to frequently used data. The data is than displayed to the user according to the specifications for the appliance given by the manufacturer. The data labels which were sent by the IPAcBox ensure that each data will be placed in a proper format. The page that displays the data is refreshed at certain time intervals unless the user explicitly refreshes before. The whole process is repeated upon a refresh.

REFERENCES
[1] Renato Jorge Caleira Nunes, A Web-Based Approach to the Specification and Programming of Home Automation Systems, IEEE MELECON 2004, pp.693, May 12-15, 2004, Dubrovnik, Croatia. Guangming Song, Zhigang Wei, Weijuan Zhang and Aiguo Song, Design of a Networked Monitoring System for Home Automation, IEEE, pp.933, July 2007. K. Tan, T. Lee and C. Yee Soh, Internet-Based Monitoring of Distributed Control Systems-An Undergraduate Experiment, IEEE Transactions on Education, Vol. 45, No. 2, May 2002. Chi Chung Ko, Ben M. Chen, Shaoyan Hu, Vikram Ramakrishnan, Chang Dong Cheng, Yuan Zhuang, and Jianping Chen, A WebBased Virtual Laboratory on a Frequency Modulation Experiment, IEEE Transactions on Systems, Man, and Cybernetics-Part C: Application and Reviews, Vol. 31, No. 3, pp. 295-303, August 2001. 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. P. Lin and H. Broberg, Internet Based Monitoring and Control for HVAC Applications, IEEE Industry Applications Magazine, pp. 49-54, January 2002. A. R. Al-Ali and M. AL-Rousan, Java-Based Home Automation System, IEEE Transactions on Consumer Electronics, Vol. 50, No. 2, May 2004. Neng-Shiang Liang, Li-Chen Fu and Chao-Lin Wu; An Integrated, Flexible, and Internet-Based Control Architecture for Home Automation System in the Internet Era, Proceedings ICRA 2002, IEEE International Conference on Robotics and Automation, Vol. 2, pp. 1101 1106, 2002. J. C. Nunes and J. C. M. Delgado, An Internet Application for Home Automation, Electrotechnical Conference, MELECON 10th Mediterranean, Vol. 1, pp. 298 -301, 2000. J.L. Ryan, Home Automation, Electronics and Communication Engineering Journal, pp.185, July/August 1989. Guangming Song, Yaoxin Zhou, Weijuan Zhang and Aiguo Song, A Multi-interface Gateway Architecture for Home Automation Networks, IEEE Transactions on Consumer Electronics, Vol. 54, No. 3, pp.1110, August 2008. Hyung Seok Kim, Joo-Han Song and Seok Lee, Energy-Efficient Traffic Scheduling in IEEE 802.15.4 for Home Automation Networks, IEEE Transactions on Consumer Electronics, Vol. 53, No. 2, pp.369, May 2007. Peter Bergstrom, Kevin Driscoll and John Kimball, Making Home Automation Communications Secure, IEEE Computer, pp.50, October 2001. Intark Han, Hong-Shik Park, Youn-Kwae Jeong and Kwang-Roh Park, An Integrated Home Server for Communication, Broadcast Reception, and Home Automation. IEEE Transactions on Consumer Electronics, Vol. 52, No. 1, pp.104, Feb 2006.

[2]

[3]

[4]

[5]

IV. CONCLUSIONS
In this paper we introduced a low cost, dynamic solution to the home automation using the internet. The novel approach in this paper discusses the migration of the control and monitoring of home/work appliances directly to the internet through special hardware and protocols. The proposed IP based system offers several novel benefits, if compared to other home automation designs. IPAcBox's capability of connecting to a server directly over the internet is advantageous with respect to other systems. The system proposed is low cost and utilizes a database that is universal to all products of all manufacturers. The plug and play characteristics, along with the security features embedded in hardware and software makes the system both easy to use and secure as well. With these in mind, numerous projects can be developed, thus leading to further technological advancements. Appliance manufacturers will be able to use this framework with only a few interface changes, with minimal additional expenditure, through the usage of the hardware and the data transmission protocols that are proposed, in a plug and play fashion. Normally systems such as these may require difficult interventions, configurations on the consumer site, which are proven to be costly and time consuming. With the 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 the product and submit firmware updates into the appliance if necessary by the manufacturer. The appliances that are connected to the internet via the IPAcBox may allow the manufacturer to collect information for statistical purposes. This property can be customized according to the manufacturers requests with the consent of the consumers due to privacy concerns. Since the appliances are indirectly connected into each other through the server, it may be possible for them to communicate with each other, receiving other appliances status and decide autonomously accordingly. This is currently our topic of our study.

[6]

[7]

[8]

[9]

[10] [11]

[12]

[13]

[14]

BIOGRAPHIES
Ali Ziya Alkar received his B.S. degree in 1988 at Electrical & Electronics Engineering Department, Hacettepe University, Ankara, Turkey. He completed his M.S. study in 1991 at the Electrical & Computer Engineering Department of the University of Colorado at Boulder, Colorado, U.S.A. In 1995 he received his Ph.D. from the same university. His main interests are computer architecture and design, and application of security algorithms to VLSI and embedded systems. Supervised and completed several government funded research projects. He is an Associate Professor at the Dept. of Electrical and Electronics Engineering, Hacettepe University. He is a member of the IEEE.

A. Z. Alkar et al.: IP Based Home Automation System John efik Roach is currently working for Renko Electronics Ltd. in Ankara, Turkey. John is a Certified Application Developer (APTECH), Certified Information Systems Manager (APTECH), Open Software Developer. His specialties are but not limited to Java, An object oriented open source 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.

2207 Dilek Baysal received her B.S. degree in 2010 at Electrical & Electronics Engineering Department, Hacettepe University, Ankara, Turkey. She is currently working for Aselsan A.S. She is mainly working on boundary scan testing, implementation of embedded systems. She is a member of the IEEE

Você também pode gostar