Smart home

Smart home

share
¥0.00
  • Detail
  • Parameters

The Analysis & Implementation Of  Smart Home Control System

zhenxing wang

Abstract-- Smart home controller have be used in many cases, user can monitor and control the electrical device in home from distance through Internet.In this paper,we introduced the implementation of smart home controller,the system consists of three main subsystems:the embedded controller,signal converter and terminal device. To enable the user manage the controller any where and any time on different terminal, the B/S architecture is selected. As the system consists of many different sensors and actuators, the controller parse the different protocol. To make a new actuator can add to the system,the address learning method is also introduced.


Keywords- smart home; wireless switch;embedded system;arm

Introduction

Smart home system the security stakeout of community, combine home smart control, information and consumed services and so on together, make the home life more comfortable, safer and more effective, provide a “smart life space” to the house owner.The Smart Home Controller is equipped with sensors, actuators and many other technology to assist the resident performing the activities of daily living. users can controller and monitor the device in home from office by computer or on mobile occasion by SMS. For this product to be well accepted by the customer,many factors should consider[1].The first  is  ease of use, the system must have a human interest interface.The second is that the  hybrids of computer device[2]. As the user will access the controller through internet ,the console device is vary. For example,the console device that the user access the controller will be a pc computer running windows or linux,3G mobile phone,GPRS mobile phone or PDA. The mobile phone  will also running different  embedded phone operation system. So the  system should support the user access on any kind of console device. However,it is hard to achieve. The looking style will differ on different screen whether adopt C/S or B/S mode.For example,the same interface will looks different on a 1024*768 resolution LCD screen and a 96*64 mobile phone TFT screen.Even if use java program to solve the cross platform problem,the looking style problem will still exist[3]. In our system two different sets of program that do the same work co-exist in the controller to fit for desktop computer and mobile phone environment.Our  architecture will be introduced in this paper. The third is that the system will communicate with different kinds of  sensors and actuators, the communication protocol are diverse and shoud be converted to a uniform style.In our software architecture, the task was fulfilled by a communication wrapper.The forth problem is the actuator will add or remove from system dynamicly, every terminal device have an address for communication,how a brand new actuator add to system is also important.It is unpractical for the actuator to have a predefined address before they leave the factory. We define an auto address dispatch algorithm to configure the actuator address.

.

Architecture

The smart home control system is illustrated in figure 1.


Figure 1  smart home topology


The smart home controller is the key device,it interact with field input and output devices and communicate with user through internet. The input devices are sensors and the output device are smart socket, smart switch and infrared device. The owner can access the controller by pc through traditional internet or use wap enabled mobile phone and PDA.The security sensor will generate alarm signals to controller and the program in controller will then inform the own by SMS,email,telephone call.The owner can also control the electrical device in home through internet, after the controller receive the control command from user,it send out wireless signal, the smart switch or socket will receive and parse the  command, perform the corresponding action.The video data will compressed to H.264 format and decompress on remote pc which can achieve  high image quality. The controller can also capture a static picture from the designated camera and convert the picture to jpeg format send out via email or MMS by GPRS module.

Figure 2 is software architecture for the controller.The cpu is TI DM6446,it include a dsp and arm processor.The arm processor running linux operation system,all the business logic is running on linux OS,the DSP processor process the video data,compress/decompress the video data and store the data to shared memory,the arm processor can read the data from shared memory and send the video data through network.


Figure 2. software architecture

As C/S mode is inconvenience in many cases,we adopt B/S mode.However,the webpage for PC computer is unfit for moblephone,the javascript will also unable to running on most of cell phone.The WML/WMLscript program is also developed separately to fulfill the requirement of mobile phne.The cgi and javascript,css,html is for PC scheme ,the WM/WMLscript is for mobile phone scheme.figure 3 is the introduction of pc scheme while figure 4 is for mobile phone scheme.



Figure 3   PC scheme

client login webserver through IE, http://192.168.1.2/cgi-bin/start.cgi

cgi read html webpage to buffer  

cgi send webpage to IE on client pc

cgi get parameter from linux shell,embedded database or driver

cgi make necessary conversion on parameter and send to IE

the javascript embedded in webpage read the parameter which will displayed on webpage

customer  computer send new parameter to cgi by HTML table’s post method

cgi receives parameters and calls the application,the parameters passed to linux shell by system function.

application calls driver with the parameter from cgi




Figure 4  mobile phone scheme


client login webserver through mobile phone, http://www.myarm.net/start.wml

cgi read wml webpage to buffer  

cgi send wml to IE on mobile phone

cgi get parameter from linux shell,embedded database or driver

cgi make necessary conversion on parameter and send to mobile phone

the WMLscript embedded in wml webpage read the parameter which will displayed on webpage

mobile phone  send new parameter to cgi by WML  post method

cgi receives parameters and calls the application,the parameters passed to linux shell by system function.

application calls driver with the parameter from cgi



the combination of wmlscript and cgi

For PC scheme javascript and cgi is used while for mobile phone wmlscript and cgi is used. As two design methods are very similar,we will only describe mobile phone scheme and use a very simple example:ip setting module. The webpage for ip address inquiry is shown in Figure 5. To keep the style of the result page consistent with previous page, WMLscript is used.

<wml>

<card id="ipsetting" title="ip configuration">

 <p>

   ipaddr:<input name="ipaddr" value="$(ipaddr)"/><br/>

   ---------for line limitation  ,other ip parameter omitted---

 </p>    <p align="center">

    <do type="accept" label="confirm">

    <go href="ipprocess.cgi" method="get">

     <postfield name="ipaddr" value="$(ipaddr)"/>

    ---------for line limitation  ,other ip parameter omitted---

    </go>     </do>

    <do type="accept" label="query">

     <go href="ipprocess.wmls#ip()"/>

     </do>   </p> </card></wml>


Filename:ipprocess.wmls

extern function ip()

{

var result=result();

var ipaddr=String.elementAt(result,0,";");

---------for line limitation  ,other ip parameter omitted---

WMLBrowser.setVar("ipaddr",ipaddr);

WMLBrowser.setVar("netmask",netmask);

WMLBrowser.refresh();

};

function result(){return

"192.168.1.2;255.255.255.0;192.168.1.1;11:22:33:44:55:66;202.120.224.6;202.120.224.104";}

The parameters can be configured are ipaddr,ipmask,gateway,macaddr, dns1,dns2.

The wml page can only show static context,so wmlscript was added to support dynamic function,such as data query.Here we simulate ip value returned from embedded web server and  WMLscript read data from function result and  parse the string by String.elementAt() function.For example, String.elementAt(result,0,”;”) will get ipaddress from string “result”. “result” is a big string that contain the whole ip values from server.the above code can be  tested by mobile phone and the result is show on figure 5.  



   

Figure 5


In stead of set values on WMLscript directly, we further illustrate how cgi can append values to WMLscript file. The revise of WMLscript file consists two steps. The first step is  cgi reads the WMLscript file to the output buffer, the second step is  cgi  appends the following code to the end of buffer and send it out.

printf("%s"," function result(){return\ "" );

printf("%s",outjs);

printf("%s","  }\ "");

the outjs is string generated by string operation in cgi ,the result string is as below:

outjs= 192.168.1.2;255.255.255.0;192.168.1.1;11:22:33:44:55:66;202.120.224.6;202.120.224.104

these strings will be send to mobile phone. On mobile phone, after user click query, the program ipsetting.cgi will be executed by BOA webserver, it reads static webpage, generates the required parameters dynamically and appends them to the end of WMLscript file, the mobile phone receives the page ,parse the code and display it.

.

Protocal convert

In figure 1,the air-condition is controlled by infrared signal.However the controller only send out wireless signal,so how to control the infrared device? In a cottage,there are many rooms will install air-condition,the infrared will not penetrate the wall. In our project we use wireless to infrared convert to cope with this problem. The convert will install in every room that have infrared device. The controller send out control command through ASK wireless signal, the convert have a wireless transever and infrared transever,it receive the command through wireless channel parse the protocol and convert the format,then send the package to infrared style.Each convert will have an unique address,only the designated convert will perform the action.





价格
¥0.00