0% found this document useful (0 votes)
51 views5 pages

A Mobile-Based Home Automation System: M. Van Der Werff, X. Gui, and W.L. Xu Massey University, New Zealand

The document describes a mobile-based home automation system that consists of a mobile phone, cellular modem, and home server. The mobile phone runs a Java application that provides a graphical user interface to send commands to control home appliances via SMS messages through the cellular modem. The home server is built using a microcontroller and circuit board that receives commands from the mobile phone via the cellular modem to control and monitor home appliances. It allows users to remotely control and monitor home devices from anywhere using a Java-enabled mobile phone.

Uploaded by

Nitin Saini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views5 pages

A Mobile-Based Home Automation System: M. Van Der Werff, X. Gui, and W.L. Xu Massey University, New Zealand

The document describes a mobile-based home automation system that consists of a mobile phone, cellular modem, and home server. The mobile phone runs a Java application that provides a graphical user interface to send commands to control home appliances via SMS messages through the cellular modem. The home server is built using a microcontroller and circuit board that receives commands from the mobile phone via the cellular modem to control and monitor home appliances. It allows users to remotely control and monitor home devices from anywhere using a Java-enabled mobile phone.

Uploaded by

Nitin Saini
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

A MOBILE-BASED HOME AUTOMATION SYSTEM

M. Van Der Werff, X. Gui, and W.L. Xu Massey University, New Zealand

ABSTRACT
The rapidly advancing mobile communication technology and the decrease in costs make it possible to incorporate mobile technology into home automation systems. We propose a mobile-based home automation system that consists of a mobile phone with Java capabilities, a cellular modem, and a home server. The home appliances are controlled by the home server, which operates according to the user commands received from the mobile phone via the cellular modem. In our proposed system the home server is built upon an SMS/GPRS (Short Message Service/General Packet Radio Service) mobile cell module and a microcontroller, allowing a user to control and monitor any variables related to the home by using any java capable cell phone. This paper presents the design and implementation of AT modem driver, text based command processing software, and power failure resilient output for a microcontroller to facilitate in sending and receiving data via the cell module, together with the design of java application to enable the cell phone to send commands and receive alerts through the cell module. I. INTRODUCTION The explosive growth in cellular mobile communications in the recent decade is changing the way people live and work. With the rapid development of mobile communication technology, a mobile phone is evolving from a wireless device for voice only communications to a truly portable personal terminal for data communications and networking. Mobile handsets today are essentially handheld computers with integrated mobile radio communication capabilities. The handsets allow users to download and run applications. This opens the door for introducing a vast variety of functionalities to the mobile phone and making the mobile a real intelligent device. The problem this paper looks at is, in general a mobilebased remote control system for controlling and monitoring of machine and devices at any time from anywhere within the coverage of cellular mobile networks. A typical application of such system is home automation. Home automation allows the controlling and monitoring of various home appliances by a single system and brings greater convenience, better security,

as well as higher energy-efficiency to home users. A key to the home automation system is the capability for remote operation. Considerable efforts have been put into the development of remote control systems for home automation. Earlier systems are mainly based on the use of telephone line, such as a phone-based system for home automation using a hardware-based remote controller [1][2], and a personal computer [3]. The above systems make use of the telephone as the remote control input device and have no any friendly user interface. With the proliferation of Internet, various Internet-based remote control architectures for home automation have been proposed [4]-[8]. These systems rely on the Internet as the medium for communication and generally feature friendly graphical user interfaces. The Internet-based approach requires a home server running on an Internet-connected personal computer all the time, which would hardly become popular for ordinary homes. Wireless connectivity is another desired feature in home automation systems as it provides mobility, flexibility, and no additional wiring. A Bluetooth-based wireless home network connecting the controller computer and home appliances has been presented in [9][10]. Unfortunately, due to the short coverage-range of the Bluetooth technology, the wireless connectivity provided by the Bluetooth-based systems is limited within the home environment and does not allow a user to control home appliances truly remotely. The proposed mobile-based home automation system is shown in Fig. 1. The system consists of a Java-enabled mobile phone, a cellular modem, and a controller board incorporating a microcontroller. The mobile phone serves as a remote control through which a user can interact with the home automation system. Userfriendly graphical user interface is provided on the mobile phone through applications developed in Java programming language. The controller board resides at home and works as a home server, which carries out the task of operating and monitoring home appliances. The home server communicates with the remote control via the cellular modem. This paper is organized as follows. Section II describes the development of Java application that transforms the mobile phone into a remote control. Section III presents the hardware implementing the home server. The software for enabling the home server is also given in Section III. Finally, Section IV concludes the paper.

which enables elements to be added in order to create a generic application that has the same elements that can be used on any J2ME cellular phone. Fig. 2 shows a flow diagram indicating the basic software structure of the prototype cellular phone GUI.
Create Form

Add Element Phone type PhoneNumber

Add Element Username type Any Fig. 1. Overview of a mobile-based home automation system Add Element Password type Password

II. GRAPHICAL USER INTERFACE FOR MOBILE PHONE A. Java Application The mobile phone is the interface between the user and the home automation system. It has two tasks: 1) providing a user-friendly interface for the user to input control commands and view systems feedback; 2) sending user commands to and receiving systems feedback from the home server. Todays mobile phones have more processing power, color screen, and are capable of running external applications developed by users. These capabilities make mobile phone an ideal platform for providing an excellent user interface. A Java-enabled mobile phone is chosen in our design due to the portability of Java and the fast increasing popularity of Java-enabled mobiles. The portability of Java ensures that applications developed in Java language are portable across different mobiles from different manufacturers. Since Java has a rich library of application program interfaces (API) providing functions such as graphical user interface, sending and receiving SMS messages, and communicating via GPRS, etc., Java applications for mobile phones can be easily developed by using Java development tools commonly known as development environment. In addition, most mobile phone manufactures provide their respective handset emulators for developers to test their applications on before testing on real phones. B. Programming Cellular Phone Programming cellular phones is performed similar to the way one would create an application in windows environment, due to the fact that there are many APIs that can be used for displaying Graphical User Interfaces (GUI), sending SMS messages, and communicating via GPRS over the Internet. This makes programming simple as there are APIs for a lot of functions you may want to implement. One such API that was used within this project was the form API

Add choice Group Options type Multiple

Add Command ExitCommand

Add Command SendCommand

Command ? Exit No Send Exit and free all used resources

Insert username and password to a string

Parse all selected items to a string

Open a SMS connection to the number specified

Send the username and device string

Fig.2. Cellular phone GUI software flowchart

Fig. 3 shows the GUI running the developed Java application which provides a user interface on the mobile phone for user to input commands for turning on or off home appliances. The user inputs are processed by the Java application and then sent to the home server via SMS. The interface allows a user to specify phone number of the cellular modem, user name, password, and the state (on or off) that each home appliance should be set to. When the send button is pressed, all the data is put into a text string and sent via SMS to the cellular modem. On the reverse, feedback from the home server can be sent via the cellular modem to the mobile phone using SMS.

Fig. 4 Atmel butterfly with AVR Mega 169 microprocessor

Fig. 3. Cellular phone emulator running Java application

This is a simplistic application that maybe satisfactory to demonstrate a prototype, but further development is needed to enable all the functions and to enable security with password encryption and other such protection to make this a safe and user friendly application. III. HARDWARE FOR HOME SERVER The task of home server is to process the message received via the cellular modem and carry out the commands given by the user, i.e., either to turn on/off a home appliance or to get state information of a home appliance. The home server is built as a combination of hardware and software and details are described in the following. A. Hardware Design The home server design is based on a microcontroller. The requirements for the microcontroller are: a RS232 serial port, a fair amount of Digital I/O (input/output), and a reasonable speed. In addition a reasonable amount of EEPROM is needed to store the home server software, appliance status, user name, and password, so that they are not lost in the case of power outages. An Atmel microcontroller was chosen for the above reasons as well as its excellent open source compiler, environment and libraries that are available for development with AVRs. The main environment/compiler that we used was winavr (winavr.sourceforge.net). These are a set of tools for AVRs including a C/C++ compiler and environment window. The AVR 169 also can be purchased as a development board code-named Butterfly (see Fig. 4), this has inbuilt components such as a LCD screen, Piezoelectric speaker, thermometer, and RS232 voltage converter.

A circuit board is developed to provide I/O interfaces as well as external memory to the microcontroller. As shown in Fig. 5, the circuit board provides a serial connector for RS232 communication and programming, a plug for communication with cellular modem, an LCD (liquid crystal display) panel for microcontroller output, flash memory for data storage, LED (light emitting diode) indicators of appliance states, and a high current voltage driver for driving external power control devices for home appliances.

(a) House server circuit diagram

(b) House server PCB board Fig. 5 House server

B. Software Design The software runs on the microcontroller and is an integral part of the home server. It handles the communication to and from the cellular modem, the communication to the attached external control devices, the processing of SMS messages, and the sending of responses to commands/errors or alerts. At startup, the software initializes the home server system. The first of these is to setup the device to their last state before power was lost, which is performed by saving any changes in device state on the microcontrollers on-board data flash whenever any change to the data state is made and so the system is made resilient to short term power failure. The cellular modem also needs to be setup to send and receive SMS messages, this is done by sending the AT commands specified to perform this task according to the GT48 AT datasheet [11], to the cellular modem via the RS232 port and waiting for the cellular modems acknowledging reply. After initialization, the program waits for SMS message from cellular modem via RS232. An example SMS message containing user commands is shown in Fig. 6. The home server starts to parse the message once it detects the text +CMT:, following which is the information including: the phone number where the message is sent from and to, the date and time sent, and the length of the text message, user name and password, and user commands. The message length is used to capture the text message in its entirety because there are no end characters defined.

turns the device number specified on or off depending on the command. Also another command devget=? gets all the current status of the devices. This is a very simplistic set of commands that would work for a small set of devices but needs further development to control a large number of devices in a variety of different ways. C. Software Programming The house server software was programmed following the flowchart shown in Fig. 7. It consists of 4 major procedures for setting up the cellular modem, verifying the username and password, searching for the device command in the database, and processing device numbers and updating their states.

Initialize UART
Set UART baud rate Initialize printf Initialize LCD Initialize Output to last state before being deactivated Wait for modem to be connected or turned on Reset old SMS stored messages Initialize SMS Wait for line of data to be sent from modem No Search line for +CMT indicating a text message has been sent

+CMT:"+6421415480","04/08/27,08:36:34+48",145 ,4,0,0,"+6421600670",145,14 u=mjv p=password1 Dev=(1:0,2:1)


Fig. 6. Example SMS text message

Error

Yes Parse the cellular number the Message was sent from

Error

No Error Parse the size of the message following No Error Convert the string of message size to a number Get the text message size Invalid Verify user name and password Verified Process command CmdSet Verified Invalid

Then the home server processes the user name and password contained in the text message. This is implemented by parsing the user name and password into variables. The user name variable is then compared to the user names stored in the database. When a match is found, the stored password associated with the user name in the database is compared with the received password. If the user name or password does not match, an error message is sent back to the mobile phone. When both the user name and password are correct, the commands contained in the message are compared to those in the database. The commands are validated and processed if a match is found, otherwise an error message is returned. For this system to be able to control devices there need to be a standard of commands to be sent to perform the corresponding commands. One of these commands is devSet(device_No:on/off,other_dev) this command

DevGet gets states of devices Return text invalid command Return invalid username or password

Fig. 7 House server programming flowchart

IV. CONCLUSION The design and implementation of a novel mobilebased home automation system is presented. The design consists of a mobile phone with Java applications, a cellular modem, and a microcontroller. The home appliances are controlled by the microcontroller, which operates according to the user commands received from the mobile phone via the modem. Such a design transforms a mobile phone into a portable remote controller for home automation. It is noted that the proposed system is not restricted to home automation, it can be applied directly to remote control of many industrial devices. ACKNOWLEDGMENT

[4]

A. R. Al-Ali and M. AL-Rousan, Java-based home automation system, IEEE Trans. Consumer Electron., vol. 50, no. 2, pp. 498-504. May 2004. N. S. Liang, L. C. Fu, and C. L. Wu, An integrated, flexible, and Internet-based control architecture for home automation system in the Internet era, Proceedings of ICRA02, IEEE International Conference on Robotics and Automation, vol. 2, pp. 1101-1106, 2002. R. J. C. Nunes and J. C. M. Delgado, An Internet application for home automation, MELECON 2000, 10th Mediterranean Electrotechnical Conference, vol. 1, pp. 298-301, 2000. P. M. Corcoran, F. Papai and A. Zoldi, User interface technologies for home appliances and networks, IEEE Trans. Consumer Electron., vol. 44, No. 3, pp. 679-685, Aug. 1998. P. M. Corcoran and J. Desbonnet, Browser-style interfaces to a home automation network, IEEE Trans. Consumer Electron., vol. 43, no. 4, pp. 1063-1069, Nov. 1997. N. Sriskanthan, F. Tan, and A. Karande, Bluetooth based home automation systems, Journal of Microprocessors and Microsystems, vol. 26, pp. 281-289, 2002.

[5]

[6]

[7] It is acknowledged that free cell phone, cell modem and sim card were provided by Vodafone, New Zealand. Mr. Steve Summer of Vodafone provided many valuable advices. Thanks also go to Mr. Ken Mercer of the Institute of Information Sciences and Technology, Massey University for advice in the circuit designs. REFERENCES [1] E. M. C. Wong, A phone-based remote controller for home and office automation, IEEE Trans. Consumer Electron., vol. 40, no. 1, pp. 2834, Feb. 1994. I. Coskun and H. Ardam, A remote controller for home and office appliances by telephone, IEEE Trans. Consumer Electron., vol. 44, no. 4, pp. 1291-1297. Nov. 1998. B. Koyuncu, PC remote control of appliances by using telephone lines, IEEE Trans. Consumer Electron., vol. 41, no. 1, pp. 201-209, Feb. 1995.

[8]

[9]

[2]

[10] H. Kanma, N. Wakabayashi, R. Kanazawa, and H. Ito, Home appliance control system over Bluetooth with a cellular phone, ICCE 2003, IEEE International Conference on Consumer Electron., pp. 380-381, 2003. [11] Technical Data for the Sony-Ericsson GT48, http://www.sonyerisson.com

[3]

You might also like