[IEEE 2011 34th International Conference on Telecommunications and Signal Processing (TSP) -...

5
Agent Based System for Home Automation, Monitoring and Security Daniela Bordencea, Honoriu Valean, Silviu Folea, and Ancuta Dobircau Abstract—Collecting data from sensors, for various applica- tions and scenarios, is becoming a norm. Each sensor is connected to an Access Point (AP), which forwards the data to a host computer. When an AP fails, it causes all sensors connected to it to be offline for a while. In this paper, an adaptive and fault- tolerant system that continues to function in presence of AP failures and sensor joins (churn) is proposed . As a case study, it is showed how the system can be used to automate a building. The APs have associated software agents that use Paxos protocol to allocate the sensors to APs under churn. Virtual redundancy is implemented via Paxos, thus when an AP fails, its role will be taken by another AP. Hence, it is achieved high reliability by using software agents with wireless sensors, and employing the Paxos protocol, without any component redundancy and with low implementation cost. Keywords—Software agents, Paxos, Tag4M, virtual redun- dancy. I. I NTRODUCTION T ECHNOLOGY is an important part of our everyday lives, making its presence felt at the office, during commuting and even at the premises of our homes. Building automation is a technological field whose popularity is increasing with a rapid pace due to its foreseen potential. It can improve the security while minimizing the overall consumed energy. A building automation system is a distributed control mechanism that is designed to monitor, record and control environmental parameters using dedicated software agents that are exchang- ing specialized information over wireless infrastructures. Automation of a building consists of monitoring and con- trolling various environmental parameters (e.g. temperature, air quality). In a building, the temperature can be changed according with outdoors temperature, air quality can be mea- sured (concentration of methane gas in the air and also the air dust density), lighting can be turned on, off or may be reduced based on time of the day. These parameters can be detected and managed using a Tag4M [1] (in this paper we will Manuscript received May 17, 2011. This paper was supported by the project PRODOC (Project of Doctoral Studies Development in Advanced Technologies), POSDRU/6/1.5/S/5 ID 7676, project co-funded from European Social Fund through Sectoral Operational Programme for Human Resources Development 2007-2013. D. Bordencea is PhD student at the Faculty of Automation and Com- puter Science, Technical University of Cluj-Napoca, Cluj, Romania (phone: 0040751036923 e-mail: [email protected]). H. Valean is Professor at the Faculty of Automation and Computer Science, Technical University of Cluj-Napoca, Cluj, Romania (e-mail: hono- [email protected]). IEEE member, no. 41585149. S. Folea is Associate Professor at the Faculty of Automation and Com- puter Science, Technical University of Cluj-Napoca Cluj, Romania (e-mail: [email protected]). IEEE member, no. 90371862. A. Dobrcau is PhD student at the Faculty of Automation and Computer Science, Technical University of Cluj-Napoca, Cluj, Romania (e-mail: an- [email protected]). refer to it as ”tag”) wireless device with embedded sensors for ambient temperature, humidity, atmospheric pressure, ambient light, methane gas and air dust. Tag4M is a device that can be connected with other sensors and perform wireless measure- ments. The advantages of the proposed system are related to its ultra low power Wi-Fi capability, which makes it suitable for sensing applications where battery power management is critical. This paper is structured as follows. Section 2 provides the background concepts used in this article. Section 3 presents the software and hardware architecture of the system. The experiments with sensors are presented in section 4. Section 5 shows the result for negotiation between agents in order to reallocate the tags connected to an AP that fails and the allocation of a tag when it joins the system. Section 6 submits the concluding remarks for this article. II. BACKGROUND The automation systems should provide high reliability. This means that, in the presence of failure, the system should recover without human intervention. In the same line of thought it is presented here a solution based on Tag4M. Tag4M WiFi tags send measurement data to an AP, which routes the data over the Internet to a server IP address (default 207.192.71.200) where the Tag4M Web Page Instrument is running. In the presence of an AP failure, all sensors connected to it will turn offline for a period of time. In wireless net- works, two endpoints communicate better if they are located sufficiently close to each other in order to avoid the effects of Radio Frequency (RF) interference or signal loss. In order to re-allocate the failed AP tags to the closest AP from the system, agreement between the agents is used. In distributed systems, a practical solution for solving agreements in the presence of failure is consensus and an elegant solution for reaching consensus is realized by using Paxos. The motivation of using the Paxos algorithm is that it ensures that a single value that was proposed is being chosen, so that the tag is allocated to a single AP. If there are no tags that need to connect to an AP, then none of the tags should be allocated. On the other hand, if a certain tag is associated to an AP, then all the agents should be informed about this. Some other technologies that can be used are X10, Blue- tooth and Zigbee. Bluetooth is an open wireless technology standard used for exchanging data between fixed and mobile devices over short distances. X10 is a standard for communi- cation among electronic devices used for home automation, but it has an important drawback: it is very slow. ZigBee is the latest and most advanced wireless technology being 978-1-4577-1411-5/11/$26.00 ©2011 IEEE TSP 2011 165

Transcript of [IEEE 2011 34th International Conference on Telecommunications and Signal Processing (TSP) -...

Agent Based System for Home Automation,Monitoring and Security

Daniela Bordencea, Honoriu Valean, Silviu Folea, and Ancuta Dobircau

Abstract—Collecting data from sensors, for various applica-tions and scenarios, is becoming a norm. Each sensor is connectedto an Access Point (AP), which forwards the data to a hostcomputer. When an AP fails, it causes all sensors connected toit to be offline for a while. In this paper, an adaptive and fault-tolerant system that continues to function in presence of APfailures and sensor joins (churn) is proposed . As a case study,it is showed how the system can be used to automate a building.

The APs have associated software agents that use Paxosprotocol to allocate the sensors to APs under churn. Virtualredundancy is implemented via Paxos, thus when an AP fails,its role will be taken by another AP. Hence, it is achievedhigh reliability by using software agents with wireless sensors,and employing the Paxos protocol, without any componentredundancy and with low implementation cost.

Keywords—Software agents, Paxos, Tag4M, virtual redun-dancy.

I. INTRODUCTION

TECHNOLOGY is an important part of our everyday lives,making its presence felt at the office, during commuting

and even at the premises of our homes. Building automationis a technological field whose popularity is increasing with arapid pace due to its foreseen potential. It can improve thesecurity while minimizing the overall consumed energy. Abuilding automation system is a distributed control mechanismthat is designed to monitor, record and control environmentalparameters using dedicated software agents that are exchang-ing specialized information over wireless infrastructures.

Automation of a building consists of monitoring and con-trolling various environmental parameters (e.g. temperature,air quality). In a building, the temperature can be changedaccording with outdoors temperature, air quality can be mea-sured (concentration of methane gas in the air and also theair dust density), lighting can be turned on, off or may bereduced based on time of the day. These parameters can bedetected and managed using a Tag4M [1] (in this paper we will

Manuscript received May 17, 2011. This paper was supported by theproject PRODOC (Project of Doctoral Studies Development in AdvancedTechnologies), POSDRU/6/1.5/S/5 ID 7676, project co-funded from EuropeanSocial Fund through Sectoral Operational Programme for Human ResourcesDevelopment 2007-2013.

D. Bordencea is PhD student at the Faculty of Automation and Com-puter Science, Technical University of Cluj-Napoca, Cluj, Romania (phone:0040751036923 e-mail: [email protected]).

H. Valean is Professor at the Faculty of Automation and ComputerScience, Technical University of Cluj-Napoca, Cluj, Romania (e-mail: [email protected]). IEEE member, no. 41585149.

S. Folea is Associate Professor at the Faculty of Automation and Com-puter Science, Technical University of Cluj-Napoca Cluj, Romania (e-mail:[email protected]). IEEE member, no. 90371862.

A. Dobrcau is PhD student at the Faculty of Automation and ComputerScience, Technical University of Cluj-Napoca, Cluj, Romania (e-mail: [email protected]).

refer to it as ”tag”) wireless device with embedded sensors forambient temperature, humidity, atmospheric pressure, ambientlight, methane gas and air dust. Tag4M is a device that can beconnected with other sensors and perform wireless measure-ments. The advantages of the proposed system are related toits ultra low power Wi-Fi capability, which makes it suitablefor sensing applications where battery power management iscritical.

This paper is structured as follows. Section 2 provides thebackground concepts used in this article. Section 3 presentsthe software and hardware architecture of the system. Theexperiments with sensors are presented in section 4. Section5 shows the result for negotiation between agents in orderto reallocate the tags connected to an AP that fails and theallocation of a tag when it joins the system. Section 6 submitsthe concluding remarks for this article.

II. BACKGROUND

The automation systems should provide high reliability. Thismeans that, in the presence of failure, the system shouldrecover without human intervention. In the same line ofthought it is presented here a solution based on Tag4M.

Tag4M WiFi tags send measurement data to an AP, whichroutes the data over the Internet to a server IP address (default207.192.71.200) where the Tag4M Web Page Instrument isrunning. In the presence of an AP failure, all sensors connectedto it will turn offline for a period of time. In wireless net-works, two endpoints communicate better if they are locatedsufficiently close to each other in order to avoid the effectsof Radio Frequency (RF) interference or signal loss. In orderto re-allocate the failed AP tags to the closest AP from thesystem, agreement between the agents is used. In distributedsystems, a practical solution for solving agreements in thepresence of failure is consensus and an elegant solution forreaching consensus is realized by using Paxos.

The motivation of using the Paxos algorithm is that itensures that a single value that was proposed is being chosen,so that the tag is allocated to a single AP. If there are no tagsthat need to connect to an AP, then none of the tags shouldbe allocated. On the other hand, if a certain tag is associatedto an AP, then all the agents should be informed about this.

Some other technologies that can be used are X10, Blue-tooth and Zigbee. Bluetooth is an open wireless technologystandard used for exchanging data between fixed and mobiledevices over short distances. X10 is a standard for communi-cation among electronic devices used for home automation,but it has an important drawback: it is very slow. ZigBeeis the latest and most advanced wireless technology being

978-1-4577-1411-5/11/$26.00 ©2011 IEEE TSP 2011165

Fig. 1. System architecture

Fig. 2. The join of a tag to the system

built into millions of home automation and smart energydevices worldwide. The technology is often referred to as”The Internet of Things”, because lights, thermostats, alarms,fridges, doors, appliances and utility meters are being ZigBeeenabled. ZigBee is a low-cost, low-power, wireless meshnetworking standard which provides high reliability and moreextensive range. The main disadvantages of ZigBee includeshort range, low complexity and low data speed. [2]

Tag4M, in comparison with these technologies, does notrequire infrastructure, it has a relatively low cost, it allowsnetworks with large number of nodes and provides com-munication security with relatively little interference withother networks. Besides, ZigBee uses the 2.4 GHz band forcommunication between devices. In buildings with Wi-Fi, bothnetworks can fail due to interferences because 2.4 GHz bandis commonly used by both networks.

III. SYSTEM ARCHITECTURE

The overall system architecture is presented in Fig. 1. Thetags, connected to the APs, transfer the sensors information,over the Wi-Fi technology, to a server. A multi-agent societydedicated for receiving tag information while managing theconnection between different tags and APs, is implementedon the server. The agents will use the Paxos [3] protocol inorder to allocate the tags to APs in failure or join cases.

A. Resilience to churn

1) Tag4M joins: The first step performed by a tag when itjoins the system is to scan for available networks. When anAP receives a connection request from a tag, it will respondby sending the data required to use the network. Moreover, thetag also sends the Received Signal Strength Indication (RSSI)to all available agents. In this way, Paxos protocol is called

Fig. 3. The failure of an Access Point

Fig. 4. Wi-Fi Data Acquisition System from Tag4M Comp.

by agents for agreement on the sensor connection with theclosest AP. The closest AP will be chosen keeping track ofthe RSSI parameter. This means that the RSSI that is nearest0 will correspond to this AP. (see Fig. 2)

2) AP fails: In the case of an AP failure, its status willbe changed to un-available. Using failure detector algorithm(see [4]), the configuration agents that are alive will detect thefailure of the AP. Likewise, the tags of the failed AP will tryto connect to other APs (see Fig. 3). For reallocation of failedAP tags, the agents will call again Paxos. If the tags can starta new association with the APs they were assigned, the job isdone. Otherwise, a new instance of the Paxos algorithm willrun and a new leader will be chosen.

There are another two cases (when a tag fails or a new APjoins the system) that are not treated because are out of thescope of this paper.

B. Wi-Fi DAQ System

The Wi-Fi DAQ system and sensors extension, presented inFig. 4, is a Wi-Fi RFID (Radio-frequency identification) activetag with measurement capabilities [5]. By attaching sensorsto its I/O terminal blocks, in the same way as for any dataacquisition device, the user can build wireless proof-of-conceptsensor solutions for a wide range of applications.

The advantages of the system are: reduced size (4.7 cm x7.0 cm), the capability to run on battery power, portabilityand low acquisition costs. Even though the batteries mustdeliver a current up to 1A, the duration of the pulse is veryshort, approximately 1-2 ms, due to high transmission rate.It also offers the highest computational power and the largestbandwidth for transmissions [6]. Overall, it is a complete Wi-Fi networking solution, incorporating a 32-bit CPU (Central

166

Fig. 5. Wi-Fi Data Acquisition Hardware Architecture

Processing Unit), a memory unit, an operating system andUDP (User Datagram Protocol) transport protocol or TCP/IPstack. Other included hardware components are: an analoguesensor interface, a power management unit, a hardware cryp-tographic accelerator and a real time clock [7]. WEP (WiredEquivalent Privacy) and WPA (Wi-Fi Protected Access) witha 4Mbit/s throughput sustained TCP/IP are the Wi-Fi DAQsystem security suites. The hardware architecture of the Wi-Fidata acquisition system is presented in Fig. 5.

IV. SENSORS EXPERIMENTS

A building can be monitored using temperature, humidity,light, pressure, methane and magnetic sensors. The windowsand the doors are monitored using magnetic (reed) and tiltsensor (used mainly for security specific applications). Thelight intensity is controlled using a Touch Panel Computerwhich sends commands to Tag4M’s devices through Wi-Filinks. The temperature and humidity parameters are controlledautomatically using a PID controller, implemented on theTag4M device. The spatial localization of the tags could bedone using the RSSI information.

In the application presented herein, the tag monitories: thetemperature, using the TC1046VNB sensor that is connectedto tag line AI2 [8]; the humidity, using the HIH-5030/5031sensor that is connected to tag line AI0 [9]; the light, usingthe LX1792 sensor that is connected to the AI0 line of the tag[10]; the pressure, using the MP3H6115A6U sensor connectedto tag line AI1 [11]; the concentration of methane, using theMQ-4 sensor connected to tag line AI2 [12] and the air dust,using the GP2Y1010AU0F sensor connected to the 0-10V lineof the tag [13].

A. Temperature and Humidity Sensor

The Temperature and Humidity Sensors extension presentedin Figures 6 and 7 are being used to measure ambienttemperature and humidity in the tag vicinity. The results ofoutdoors temperature and humidity over 30 days are presented,observing their changes according with alternation of day andnight.

The TC1046 is a temperature sensor with linear output(the output voltage is directly proportional to the measuredtemperature). It can accurately measure temperature from -40C to +125C. The output voltage range for these devices istypically 174mV at -40C and 1205mV at +125C. A 6.25mV/C

Fig. 6. Temperature Sensor and Signal

Fig. 7. Humidity Sensor and Signal

Fig. 8. Light Sensor and Signal

voltage slope allows for the wide temperature range [8]. TheHIH-5030 is an analog sensor (voltage) which means it isfaster [9]. Generally speaking, the tag performs faster readingswhen sensor output is current or voltage. The I2C interfacebetween the sensor and the tag, for instance, is relatively slow,and a reading can be done at every 3 seconds.

B. Light and Pressure Sensor

Figure 8 presents the alternation of day and night and thevoltage generated by a photocell and it is used to measure

167

Fig. 9. Pressure Sensor and Signal

Fig. 10. Methane Gas Sensor

ambient light in the tag vicinity. The result of placing aphotocell outside of a building is the modulation of interiorlights, because the photocell can sense darkness and the timeof day. The sensor used to measure the light intensity is theLX1972 device which it is a low cost silicon light sensor withspectral response that closely emulates the human eye. Sensorcircuitry produces peak spectral response at 520nm, with IRresponse less than 5%, of the peak response, above 900nm.Usable ambient light conditions range is from 1 to more than5000 Lux [10].

The Pressure Sensor extension is used to measure atmo-spheric pressure in weather forecasting applications. The boardmounts MP3H6115A6U pressure sensor and signal condi-tioning circuitry are being shown in Fig. 9 [11]. This figurepresents an example of a measured atmospheric pressure fora period of 30 days.

C. LEDs, Buzzer Output, Reed and Tilt Sensors

LED, buzzer output, reed sensor and tilt sensor (SQ-SEN-200 [14]) are used to visualize DIO lines states, to createa buzzer sound alarm and to monitor the state of the win-dows and doors. The LED board contains LEDs connectedto the digital outputs lines of a tag, via current limitationresistors. An auto-oscillated buzzer is also used on the Buzzerextension. The tilt sensor acts like a normally closed switchwhich chatters open and closed as it is tilted or vibrated.Unlike other rolling-ball sensors, the SQ-SEN-200 is truly anomnidirectional movement sensor.

Fig. 11. Dust Sensors and Signal

D. Gas Sensor Measurement

This methane gas sensor (see Fig 10) is used to detectthe concentration of methane gas in the air. Uses for leakdetection, this sensor has a concentration sensing range up to10,000 ppm. The sensor can operate at temperatures from -10to 50C and consumes less than 150 mA at 5V. It is also ableto detect a gas stove left on but not lit [12]. Other sensorscould be used to measure CO2, air contaminants which areemitted by cigarette smoke, concentrations of odorous gasessuch as ammonia and H2S generated from waste materials inoffice and home environments, volatile organic vapors such asethanol, methanol or LP gas and its components (e.g. propaneand butane).

E. Dust Air Density Detector

The module is implemented with the GP2Y1010AU0Fdevice, a dust sensor based on an optical sensing system,presented in Fig. 11. An infrared emitting diode (IRED) and aphoto transistor are diagonally arranged into this device [13].The basic principle on which the sensor detects the dust airdensity is to quantify the reflected light of dust in air. Thus,it is very effective in detecting fine particles like the ones inthe cigarette smoke. In addition, it can distinguish smoke fromhouse dust by the pulse pattern of output voltage. The dust airbeing correlated with the temperature and humidity variation,a cigarette smoke does not activate the fire alarm, preventingin this way false detections.

V. EXPERIMENTS

A. Application Panel

After making wireless measurements, the Tag4M device cansend the data to computers or to a network site using wirelessconnections. All the information is being plotted on graphicsusing the Pachube site [15]. The panels are presented in Fig.12.

B. Multi-agent system

We carried out the experiments in Kompics [16], which wasdeveloped in Sweden, at the Royal Institute of Technology

168

Fig. 12. Pachub Panel on WSN-Tech.Net Site

(KTH) in collaboration with the Swedish Institute of ComputerScience (SICS). It is a framework for building reconfigurabledistributed systems, using event-driven components [17].

We create five components for the tags and five componentsfor the APs and we ran simulations for a scenario with churn,where tags join and APs fail. The execution is presented inthe time space diagram from Fig. 13. The top of the diagram(I) shows the case of the failure of an AP, who has four tagsconnected to it. The reallocation of the failed AP tags to theclosest APs takes a few message delays. It can be seen inthe figure that, for each sensor reallocation, a new instance ofPaxos is started. The bottom of the diagram (II) shows the casewhen a new tag wants to join the system. It is, also allocatedto the closest AP after a few seconds (a few message delays).

VI. CONCLUSION

The proposed system presents many new characteristics.One of the most important consists of embedding ultra-low power, Wi-Fi transmission capabilities in a very smallpackage. The system runs on batteries having a character-istic life time of a couple of years and offering a platformfor sensor measurements. Thus, the monitoring system canuse any existent infrastructure, with significant decrease ofimplementation costs. Another characteristic of the systemis dynamic allocation of the measurement tags to the AP.This allocation is controlled by a society of agents. In failurestate (when a part of the system - AP - fails), the agentwill reallocate the tags to the rest of the APs, with respectto the communication quality requirements. Thus, by usingsoftware agents with wireless sensors, and employing thePaxos protocol, without any component redundancy and lowimplementation cost, we achieve high reliability of the system.

VII. ACKNOWLEDGEMENTS

The authors would like to thank Tallat M. Shafaat (KTH),Per Brand (SICS) and Cosmin Arad (KTH) for their profes-sional support.

Fig. 13. The allocation of the tags in the presence of Access Point failureand the allocation of a tag when it joins the system

REFERENCES

[1] Convert sensor data to web pages using a Cloud Instrument, june 2011.Available: http://www.tag4m.com.

[2] ZigBee, june 2011, Available: http://en.wikipedia.org/wiki/ZigBee[3] Leslie Lamport, “The part-time parliament, ” in ACM Transactions on

Computer System, 16(2), May 1998, pp. 133-169.[4] Rachid Guerraoui and Lus Rodrigues, “Introduction to Reliable Dis-

tributed Programming, ACM Computing Classification, 1998, Spring,pp. 54-58 and pp. 48.

[5] S. Folea, M. Ghercioiu, “Tag4M, a Wi-Fi RFID Active Tag Optimizedfor Sensor Measurements, ” in Tech Education and Publishing, Austria,2009, ISBN 978-953-7619-72-5.

[6] S. Folea, M. Ghercioiu, “Ultra-Low Power Wi-Fi Tag for WirelessSensing,” in IEEE International Conference on Automation, Quality andTesting Robotics, May 22-25, 2008, Cluj-Napoca, Romania.

[7] G2 Microsystems1, “G2C547 SoC Data Sheet, product brief, G2 Mi-crosystems, Inc., Campbell, CA, USA, 2008.

[8] Microchip, “High Precision Temperature-to-Voltage Converter, DataSheet, product brief, DS21496B, USA.

[9] Honeywell, “HIH 5030/5031 Series, Low Voltage Humidity Sensors,Data Sheet, 009050-2-EN IL50 GLO, 2010, USA.

[10] Microchip, “Ambient Light Detector, LX1972, Data Sheet, product brief,2005, pp. 1-9, Rev. 1.1b, 2005-10-31, pp. 1-2, www.microsemi.com.

[11] Freescale Semiconductor, “High Temperature Accuracy Integrated Sili-con Pressure Sensor for Measuring Absolute Pressure, On-Chip SignalConditioned, Temperature Compensated and Calibrated, MP3H6115A,Rev 4, 10/2009.

[12] Hanwei Electronics, “Technical Data MQ-4 Gas Sensor, Data Sheet,product brief, 2007, http://www.pololu.com/catalog/product/1633.

[13] Sharp, “GP2Y1010AU0F Compact Optical Dust Sensor, Data Sheet,product brief, Sheet No.: E4-A01501EN, Dec. 1. 2006, SHARP Cor-poration.

[14] SignalQuest, “SQ-SEN-200, Application Note Digital Filter and MotionEstimation Algorithm, 2006, pp. 1-2, 10 Water St. Lebanon, NH 03766USA.

[15] Tag4M Weather Station Powered by Solar Cell, june 2011. Available:http://www.pachube.com/feeds/7277.

[16] Kompicsv june 2011. Available: http://kompics.sics.se.[17] C. Arad, J. Dowling & S. Haridi, “Developing, simulating,

and deploying peer-to-peer systems using the Kompics componentmodel,” in COMSWARE’09, 2009.

169