CHAPTER 1

INTRODUCTION

Home automation gives an individual the ability to remotely or automatically control thingsaround the home. A home appliance is a device or instrument designed to perform a specificfunction, especially an electrical device, such as a refrigerator, for household use. The wordsappliance and devices are used interchangeably.

Automation is today’s fact, where things are being controlled automatically, usually the basictasks of turning on/off certain devices and beyond, either remotely or in close proximity.Automation lowers the human judgment to the lowest degree possible but does notcompletely eliminate it. The concept of remote management of household devices over theinternet from anywhere, any time in the world today can be a reality. Assume a system wherefrom the office desk, the user could view the status of the devices and decides to take controlby tuning his TV set to his favourite channel, turns on the cooling system, say the airconditioner, and switches on or off some of the lights. This user could walk back home andonly finds a very comfortable, pleasant home.

The recent developments in technology which permit the use of radio frequency technologysuch as Bluetooth, have enabled different devices to have capabilities of communicating witheach other. Bluetooth is a new technology, which has at its centre the goal of eliminatingwired connections between computers. Instead of connecting with wires, every appliance hassmall transmitters/receivers. The radio frequency used (2.4 GHz) is so high that the range oftransmission will be small (about 30 feet). This is important because the range is so small,that it can be used in apartments without much interference to your neighbours or from them.These are a few reasons that make Bluetooth technology ideal for home automation.

This project work explains how to control the electrical appliances using an Android device.Operating conventional wall switches is difficult for physically handicapped or elder people.This project provides the solution to this problem by integrating all the electrical appliancesto a control unit that can be operated by an Android application device (Android smart phoneor Tablet). Proposed system controls the electrical loads based on the data transmitted by theAndroid device. An android application should be installed in user’s mobile or tablet tocontrol the electrical loads. Using this android application user can send the commands to theBluetooth module to control the electrical loads. Wireless technology used in this project isBluetooth. It can also be called as “Android based Home Automation System” or “RemotePassword Operated Electronic Home Appliances Control System”. CHAPTER 2

LITERATURE SURVEY

As per our survey, there exist many systems that can control home appliances using androidbased phones/tablets. Each system has its unique features. Currently certain companies areofficially registered and are working to provide better home automation system features.Following models describes the work being performed by others. N. Sriskanthan [1]explained the model for home automation using Bluetooth via PC. But unfortunately thesystem lacks to support mobile technology. Muhammad Izhar Ramli [2] designed a prototypeelectrical device control system using Web. They also set the server with auto restart if theserver condition is currently down. Hasan [3] has developed a telephone and PIC remotecontrolled device for controlling the devices pin check algorithm has been introduced whereit was with cable network but not wireless communication. Amul Jadhav [4] developed anapplication in a universal XML format which can be easily ported to any other mobiledevices rather than targeting a single platform. Pratik Gadtaula of Telemark UniversityCollege, Faculty of Technology has done a Master’s thesis on “Home Automation” [5]. Thisproject of his is quite interesting and challenging on the other hand. The author has developeda home automation system which is quite similar to the concept we’re trying to implement inour project. His H.A system has got Raspberry pi tied together with Arduino controller forthe controlling of a number of devices, unlike ours. Similarly, his project has conceptualizedto integrate both the LAN network and Internet for two different aspect of the same projectidea, however has not managed to do so. Also, he uses a website based user side applicationfor controlling the home appliances through a web browser; this is striking differencebetween his project and what we’re trying to do. Next project we looked up to was “AndroidControlled Home Automation” [6], a project performed by Sabin Adhikari and co. fromKathmandu Engineering College, Electronics faculty. What they’ve succeeded to do is built ahome automation system which is controlled by an android app, much like ours, and hasGoogle based voice command system. Their hardware requirements are closely related toours. Their work includes video streaming from an IP camera to the android device and otherhome appliances control system. Their project is entirely based on local network connectionusing Wi-Fi. Each of these system has their own unique features and on comparison to oneanother lacks some advancement. Apart from the actual projects we consulted, we also didsome research on the background of this field, studied about the basics and foundationsnecessary to carry out this project. Likewise, some YouTube tutorial lessons really helped aswell. Similarly, from the site of tutorials-point [9], we learnt java and Xml coding forAndroid App.1.3 ObjectivesThe main objectives of our project are as follows:

 To remotely control home appliances and monitor them.

 To save time and utilize the energy efficiently.

1.4 Applications

The application includes remote controlling of home appliances and lighting systems in aneasy way.

1.5 Project Features

The features of our project can be highlighted in following points:

 Remote control of home appliances from anywhere using app under the bluetooth range.  Considerable reduction in electricity bills with efficient energy utilization.

1.6 Feasibility Analysis

This project can be implemented using affordable electronic and software technology makingit economically, technically and operationally feasible.

1.6.1 Economic Feasibility

This project is based on android phone based and few electronic components like ArduinoUno, LCD display, relay switches etc. which are affordable, making it economically feasibleto implement.

1.6.2 Technical Feasibility

This project is based on wireless technology and embedded systems which are reasonably inphase with currently used technology. Therefore, it is very much favoured by the technology.

1.6.3 Operational Feasibility

This software will have very easy to use, user friendly interface so it will be pretty muchoperable by anyone having little experience of using android phone. It could be helpful forphysically disabled person too, controlling home appliances with the click of a button. So it isoperationally feasible. Chapter 2

Problem Statement

There is a great energy crisis in current situation of our country. Moreover, people havebecome negligent in proper utilization of the available energy. People often forget to turn offthe light sources and other home appliance while staying out from home. Even in thosesituations, application of home automation makes it possible to control them from a distantplace in easy way with our smartphone. People are constantly running from place to place,working to accomplish everything on our never-ending “to-do” list. Because of the homeautomation system, we never have to worry about opening the door, switching off theappliances and so on. In short, we can save precious time and experience more dailyproductivity. Chapter 3

Technology Used

The chapter goes through Android, a mobile operating system, and Arduino, the openhardware powered by Arduino. Furthermore, the chapter reviews the wireless communicationprotocols such as Bluetooth and Wi-Fi. All the technologies discussed in this chapter arefurther used to support the implementation of a smart automation system. The chapter alsoincludes the implementation of Wireless-based Home Automation Systems.

3.1 Android

Android [5] is an operating system, powered by Google, for mobile devices such as tablets,smart phones and PDAs. It was initially developed by Android Incorporated but was lateracquired by Google. Android is an open development platform, which means that handsetmakers can use the platform and customize it to fit their own requirements. By the time thisthesis was developed it is estimated that there are more than 300 million activated Androiddevices [6] in the world and Android is installed on ≈ 56% of devices worldwide.

Fig. Architecture of Android

Concerning the architecture, Android comprises of five layers being: Linux kernel, Androidruntime environment, Libraries, Application framework, and Application layer. The figure2.1 illustrates the Android’s architecture. The most important part of the Android OS is theLinux kernel. The Linux kernel is used for memory management, process scheduling,networking and other services. Every manufacturer can modify the Linux kernel to suit theneeds for their mobile device. The Linux layer is followed by the Android layer that containsthe native libraries that are installed for a specific phone and vendor. Android runtimecomprises the Dalvik virtual machine and the core Java libraries sits on the kernel. DalvikVM is Google’s interpretation of Java that is specifically designed for mobile devices. TheApplication Framework layer lies on top of these layers and is the layer used by developers tocreate applications. Finally, the applications and widgets are built on top of the previouslayers. Each interface screen is exhibited by Activity classes. A single application mayconsist of one or more activities and a Linux process that contains the activities. Anapplication can run in the background, even if its process has finished. It means that theactivity’s life cycle is not tied to the process life cycle. In short, Linux processes are justtrivial containers for activities that can be disposed when they are no longer needed (5).

3.2 ArduinoArduino is an open-source electronics prototyping platform. It is claimed that Arduino isbased on flexible, easy-to-use hardware and software. Furthermore, it is intended for artists,designers, hobbyists, and anyone interested in creating interactive objects or environments.

Fig. ArduinoArduino can sense the environment by receiving data from a variety of sensors and can alsoaffect its surroundings by controlling lights, motors, and other actuators (2). The hardwarecomprises of a processor on board with input/output support. The Arduino board can beextended with a plethora of add-on modules known as “shields”. Shields are boards that canbe plugged on top of the Arduino PCB extending its capabilities (2). To program themicrocontroller one needs to make a sketch. Sketches are software programs that are createdon a computer using the Arduino IDE using C and C++ languages. The IDE is also used fortransferring the code to the Arduino board. Arduino programs are composed by a structure,values (variables and constants) and functions (8). Arduino has several advantages whencompared to other microcontroller toolkits. For example, the software development isplatform independent and the developer can use any platform (e.g. Windows, Linux,Macintosh) for programming purposes. The open nature of Arduino has enabled theemergence of a massive community which provides a plethora of tutorials online; finally, it isrelatively cheap compared to other prototyping platforms. Therefore, it has been pleasantlywelcomed in the DIY community. In addition, since it was initially developed as aneducational prototyping platform it is relatively easy to learn (9).

3.3 Wireless Communication Technologies

Wireless telecommunications enable the transfer of information between two or more pointsthat are not physically connected. Distances can vary depending on the environment andtechnology used for the data transmission. This work focuses mainly on short-rangetechnologies such as Bluetooth and Wi-Fi.

3.3.1 Wi-Fi

Wireless fidelity or Wi-Fi is based on IEEE 802.11a/b/g/n (10) standards for wireless localarea networks. It allows wireless connection to the internet at broadband speeds. Thearchitecture is comprised of several components that interact with each other to provide awireless local area network (10) such as the physical layer and data link layer. Moreover,MAC procedures are defined for accessing the physical layer. In a Wi-Fi based network eachcell is a basic service set (BSS). BSS comprises of a set of Wi-Fi stations and clients connectto such stations. Wi-Fi therefore defines a distributed coordination function (11) among thepeers.

3.3.2 BluetoothBluetooth is based on a wireless radio system that is designed to remove the need for cablesfor short-range devices, such as mice, printers etc. A network that includes such devices iscalled a wireless personal area network. Topologies that are defined in Bluetooth are namedPiconet and Scatternet. A Piconet is a WPAN that consists of two or more devices. One ofthem serves as a master and the other are slaves. All of the devices in a Piconet aresynchronized with each other using the clock of the master. Slaves communicate only to themaster. Master can communicate with any device. Further, Scatternet comprises of differentPiconets that overlap time and space. Two or more Piconets can be connected with each otherto form a Scatternet. A Bluetooth device can be a part of different Piconets at the same time.This allows the data to flow beyond the range of a single Piconet. A device can only be amaster in one Piconet, but a slave in many Piconets (10).

Fig. Bluetooth Chip Module

3.4 The History of Home Automation

Even though home automation has been available to the average consumer for nearly 35years, the concept of home automation developed has been extensively explored in the 20.and 21 century. The table 2.1 summarizes the developments.

In 1975 a company called Pico Electronics developed and patented the X10 Power linecarrier technology. The company had already tried nine different approaches with no success,but while developing the system for tenth time they finally manage to succeed, so theydecided to call the technology X10. The idea behind X10 was to transmit a 120khz signal onthe electrical power line.

Every signal was specifically coded with a House and Unit code. Although such technologieshad been developed for the best part of 50 years (30) none of them was implemented in anysimilar fashion. After they patented their work it took just a few years for introducing theirfirst product into the market. So, in 1978 they released the X10 protocol to the market (12).Due to the fact, that data transmission was done reusing existing power lines, it was relativelycheap because no additional wiring was needed. The technology is analyzed in detail in thechapter 4.

The 80s were the springboard of home automation. In 1983 Murata, Namekawa and Hamabeproposed a standardization plan for home automation systems because there was nocompatibility among the different manufacturers that were proponents of home automationsystems in Japan. The research group was called HBS study group. In 1984 after two years ofwork seven manufacturers reached an agreement on standardization. They proposed a homebus system (HBS) that consisted of three bands: Base-band, for controlling signals; Sub-band,for highspeed data signals; and FM/TV-band, for visual information.

In comparison to the X10 protocol the HBS used a coaxial cable that, according to HBS studygroup, had a lower installation cost than other protocols.

In such case, if a house already has a coaxial wired installation; it is possible to incorporateHBS to the existing system with few modifications. Their plan was to install the interfaceLSIs for the HBS into electronic devices to be shipped in the following decade (13).

As a result of the work in 1984 by Murata et.al a home automation system was developedbased on the HBS in 1985 by Inoue, Uemura, Minagawa, Esaki and Honda. It consists of foursubsystems.

1. Room Monitor Control subsystem

• System for controlling home functions and security

2. Telephone subsystem• Telephone and security alarm

3. Telecontrol subsystem

• Controlling of devices and security sensors via telephones that are not located in the house

4. In-house Video Control subsystem

• For receiving video signals from picture phone sentry (16).

After 3 years of successful experiments and two built model houses, Murata revised andupdated the proposition made in 1983. The new proposed HBS had two bands fortransmitting information within the house instead of 3 bands that were proposed 3 yearsearlier. The base band remained the same but in lieu using sub-band and FM/TV-band, sothey merge the two bands into a broad-band (17).

Parallel to the Japanese, manufacturers in the United States also recognized the problem ofstandardization. A lot of new domestic electrical equipment was being offered to theconsumers, but none of these had a way of integrating every device into a central network.The only way for a consumer to integrate every single device was to acquire products fromone manufacturer only. In 1983 the

Electronic Industries Association organized a committee to develop a standard that addressed

the problem of standardization (14).

David MacFadyen was the founder and chief executive officer of Upper Marlboro, Md.consortium. In 1984 he introduced the Smart House concept. While other companies on themarket offered home automation systems that people could install into their homes, DavidMacFadyen proposes a new approach. The consortium started developing houses with homeautomation systems already preinstalled and by the year 1987 they planned to have 5000houses ready to be sold.

The houses would be programmable and every device would interact with each another viacomputer networks (15).

Meanwhile, also in early 80’s, the Electronic Industries Association (EIA) (31) had beenworking on Consumer Electronic Bus (CEBus). After five years of extensive research anddevelopment they published the working draft standard.

According to the EIA, CEBus was designed to allow manufacturers to produce electronicdevices that can interact with other manufacturers’ products over different media channels. ACEBus’ features were the allowing naming devices. For example, a user could name hisliving room television named as ”Living room TV”. This removed the necessity of knowing anumeric code for each device (31).

CEBus had a four layer network model.

1. Application layer• Device requests the generation of an Application Layer Protocol Data Unit(APDU) and thisis handed down to the network layer.

2. Network layer

• Receives the APDU and makes it into a Network Layer Protocol Data Unit(NPDU). Then itsends it to Logical Link Control sublayer(LLC) which is a part of the Data Link layer.

3. Data Link layer

• Logical Link Control sublayer appends a header with additional service information to theNPDU to make a LPDU and invokes the services of Medium Access Control (MAC)

• Medium Access Control Here the LPDU is made into a MDPU and sent to the physicallayer

4. Physical layer

• For receiving video signals from picture phone sentry (14).

After the introduction of the CEBus standard research continued for the EIA. Although SmartHouse planned 5000 houses to be ready by 1987, their plan failed due to a number ofobstacles. For instance, when Smart House was introduced the company wanted to make onelarge cable containing telephone, TV, power and communications wiring. But the wire cameout so thick that it was not feasible to run it between the walls. And by the end of 1987founder and CEO David MacFadyen left the company because of persistent reoccurringproblems with wiring. Further, Gerald Engel expressed”The company underestimated thedifficulty of getting the group of disparate industries involved with Smart House to agree onanything”. Lastly, the project engineers focused on adding new features to the Smart Houseinstead of release its first products to the market (15).

In late 80’s there were four key players in the home automation standard industry: HBS,Smart House, Esprit Home Systems and CEBus. The Japanese and Europeans groups wantedto make their standard a world-wide standard (18).

So in 1988, a committee named Home Electronic Systems (HES) was created. It comprisedof International Electrotechnical Commission (IEC) and International Organization ofStandardization(ISO). Their job was to specify home automation standards. By the end of1989 the U.S. team required to HES to consider their home automation system. Later, in 1992there were already seven home control systems included by HES:

1. BatiBUS (France)

2. CEBus (USA)

3. D2B (Holland)

4. EIB (Germany)5. ESPRIT Home Systems (Common market)

6. HBS (Japan)

7. CEBus (USA)

Also in 1992 was the completion and release of CEBus Standard IS-60 (18).

1993 was a critical year for SMART HOUSE automation. They released the first product tothe market. Further, first SMART HOUSE model opened in Naperville, USA (19).

Meanwhile, the World-Wide Web (WWW) was developed by scientists in the CERNlaboratory in 1990. It became the technology of choice for internet applications and in 1996Peter M. Corcoran, Joe Desbonnet and Karl Lusted proposed a way to remotely accessCEBus networks via the HTTP protocol. They implemented a fault diagnosis system. Thehardware, part of the implementation, consisted of a CEBus network, an active CEBus nodeand a PC-based server. The software included a modified CEBus protocol, WWW servermodification, serverend

CGI and client-end Java interfaces. Accordingly to Peter M. Corcoran et. al. the system canbe thought as”The ”active” CEBus-node contains a dedicated microcontroller with modifiedprotocol software to facilitate test and monitoring activities. The Medium Access Control(MAC) sublayer of the Datalink layer has been reprogrammed to allow the system to receiveand record all network packets.

These captured packets are passed to the Application layer along with channel timings in”unit system times” (USTs). The HTTP server software runs on a standard PC which is alsointerfaced with the CEBus network by means of an ”active” CEBus node, as described above.A”daemon” program monitors CEBus activity. A range of services are available fromthis”daemon”. Basic services including the logging of network traffic to a server-enddatabase and transmitting selected network traffic to a remote WWW client. The software canalso accept sequences of network packets from a remote WWW client for transmission on the

CEBus network via the ”active” node.” (20). It is considered to be the pioneer of onlineremote controlling of not only CEBus protocol but also for all home automation systems.

By 1997 there were eight national home automation standards and one international homeautomation systems. These included:

1. X-10(U.S)

2. CEBus(U.S)

3. LonTalk(U.S)

4. SMART HOUSE(U.S)

5. BatiBUS(Europe)6. EIB(Europe)

7. European Home systems(Europe)

8. HBS(Japan)

9. HES(international) . . .

Manufacturers had a huge number of different standards to choose. Such big number ofstandards delayed the development of home automation products.

By the year of 2002 the U.S had eight standards, 12 open protocols and 10 proprietaryprotocols. This diversity only complicated to the manufacturers to develop commercialproducts. Fortunately the Europeans efforts realized that the vast number of protocols slowsdown development of home automation technology and decided to combine the threerivalling protocols into one called Konnex. In contrast, the U.S approach did did the oppositepushing on the development of multiple protocols. That was a negative sign for a lot of thetechnologies. The problem was foreseen by Kenneth Wacks: ”The market for home systemsis not large enough support so many protocols. Therefore, many will not last.” (22).

Although people knew that there were too many home automation protocols and technologieson the market, it did not stop them from inventing and proposing new systems in the 2000s.One of such new solutions was proposed by Sriskanthan, Tan and Karande. It was a homeautomation system that relied on Bluetooth.

They chose Bluetooth since it covered, in their opinion, all the basics needed for automating ahome. For example, it operated over the unlicensed and available frequency of 2.4 GHz and itcould link devices within a range of 10m. The system developed consisted of a HostController that was implemented on a Personal

Computer and a microcontroller that was able to communicate with the host throughBluetooth. They named it The Home Automation Protocol (HAP) and realised great futurefor their proposed solution. Sriskanthan et. al says ”With our home system, which consists ofthe HC that usually takes a form of PC, Internet connectivity can easily be established andcontrol be made available. Efforts in such direction will help realize a truly wireless, fullyautomated home automation system (21)”.

All types of different home automation solutions were presented in the coming years. Forexample:

2. 2005 A. R. Al-Ali and M. AL-Rousan presented a home automation system based on Java(24).

2005 there was a huge expansion in home automation systems. Most of the systems that arewidely popular today were first introduced that year. First, a home automation system namedInsteon was developed by a company called SmartLabs. The main characteristic of Insteonwas that it had a mesh topology which composed of RF and PLC. In short, one can use onlyRF, only PLC or both at the same time.

Secondly, a wireless networking technology called ZigBee was introduced by the ZigBeeAlliance. It was developed for small datarate and short-range applications.

One of the distinctive features is that a ZigBee based network can easily scale without therequirement of powerful transmitters. And lastly there came the Z-Wave. It is a wirelessprotocol by ZenSys. The manufacturer states that”The Z-Wave protocol is a low bandwidthhalf duplex protocol designed for reliable wireless communication in a low cost controlnetwork. The protocols main purpose is to communicate short control messages in a reliablemanner from a control unit to one or more nodes in the network (27). These three lastapproaches are considered for the analysis in chapter 3.

Fig: Z-wave

Different technologies are becoming more and more cheaper and accessible to everyone. In2006 an open-source single-board microcontroller was introduced by a group of Italianstudents who named it Arduino. The motiviation for creating Arduino was to develop adevice that was less expensive than other prototyping systems and easily extendable. It wasnot meant exclusively for home automation but a lot of people saw a way of integrating theboard into their home automation systems. A work that relies in the utilization of the Arduinoboards for home automation is DomoticHome introduced in 2009. The author Mattia Lipreriwanted to develop a simple and cost efficient way to automate the lights and the garage doorin his house (28). The specifics of the project are discussed in the following chapter.Similarly, in 2011 Google announced of developing their own home automation system thatlets Android applications discover, connect, an communicate with electrical appliances anddevices in the home. Android@Home will use a mesh networking protocol that functions inthe 900MHz frequency bands just like Z-Wave (29). The wireless protocol used for theAndroid@Home demo at Googles’ I/O Developers Conference was based on SNAP fromSynapse Wireless (32).

Home automation has become more and more popular the recent years. As a result of theextensive research carried on in the home automation domain, there are approximately 15000articles and/or patents published since 2001 and approximately 5000 have been published inthe last 2 years.

Android@Home

Android@Home was announced by Google in May 2011. The system is announced to workwith a mesh network in the 900MHz frequency bands. Google chose 900MHz because it isleast likely to be crowded than the wiﬁ 2400 spectrum. It is assumed that their protocol,announced in the Google’s I/O Developers Conference, was based on SNAP from SynapseWireless (32). It is still a closed protocol. Initially, Google announced that they will create an

Fig. Android Home

Android bulb with Lightning Science. According to Ted Russ, chief business developmentoﬃcer for Lightning Science, the bulbs will be using the 6LowPAN standard. Consequently,Android@Home protocol is likely to be based on 6LowPAN technology. Geoﬀ Mulligandescribes ”6LoWPAN is a protocol deﬁnition to enable IPv6 packets to be carried on top oflow power wireless networks, specifically IEEE 802.15.4. The concept was born from theidea that the Internet Protocol could and should be applied to even the smallest of devices(42).” 6LoWPAN works in the 915mHZ frequency band and has a range of 10-100 meters. Adistinct feature of 6LowPAN is the number of hops which is up to 255, so it is practicallycertain that a message will reach the intended node (34). Furthermore, with the release of theArduino boards Google lets people try and build peripheral devices and accessories which arecompatible with their Android@home system. Consequently, both open platforms, Androidand Arduino, join together to support and extend Google’s Android@home environmentautomation approach. Moreover, the open nature of Android and Arduino resolve some issuessuch as licenses and fees. In addition, since there are already more than 230 million Androiddevices activated, it is very promising to develop devices with pre-existing Androidconnectivity (6).

ZigBee

ZigBee is a wireless technology developed by the ZigBee Alliance. Its architecture is

4. Application Layer - consists of APS sub-layer and ZDO:

• APS sub-layer - provides services such as discovery and binding.

Fig. ZigbeeZigbee uses RF communication type. The frequency bands in which ZigBee works are868MHz, 915MHz and 2400MHz. The range varies from 10 to 100 meters and thetransmission data rate is 250kbit/s. There are two types of devices in a ZigBee network beingFull and Reduce function. A Full function device usually acts as networks coordinator. AZigBee network requires at least one network coordinator. A network coordinator keeps anetwork tree of the other devices that can be contacted. In addition, the network coordinatoris the center node. The system uses hand-shaked protocol. In other words if an enddevice getsa command it responds to the coordinator that it has received and executed (26). ZigBee iscapable of connecting more than 64000 devices. It is possible due to the fact that ZigBeenetworks are extendable with each other so in theory the number of devices can be inﬁnite.Starter kits start from 150 euros and modules from 16 euros.

DomoticHome

Fig. Domotic Home

DomoticHome is an open-source project originaly developed by Mattia Lipreri. Lipreri’s

main goal was to improve the comfort of a domestic environment. The home automationsystems that are currently available in Italy happened to be expensive or hard to install andrun. So Lipreri decided to develop his own system with two goals, that the system should below cost and accessible to everybody. The system relies on Arduino boards extended with anEthernet Module to connect it to the home local area network. DomoticHome.net is a websitewhere one can generate Arduino code for communicating with diﬀerent devices and theAndroid phone application. The DomoticHome system works under the Wi-Fi frequencyband, 2401MHz to 2495MHz. The range depends on the capabilities of the router and theAndroid device but it is approximately 20 meters. There is no error detection on this system.If Arduino gets the command from the phone it replies that the command has been executed.However, the Arduino simply acts as a intermediary between the appliances and the mobiledevices. The system supports up to 14 devices since the Arduino board has only 14 pins thatyou can connect your devices to, it does not explore any multiplex strategy for increasing thenumber of devices that can be manage by the Arduino board. The Arduino board costs around50 euros and the necessary ethernet module costs 60 euros.3.5 Analysis

3.5.1 Reliability

Reliability is one of the key factors when one is considering of buying a new device, vehicle,household item etc. The same applies for home automation systems. If there is no errordetection or correction in a system, there is no way to ﬁnd out if a command got through tothe device it was intended unless you can physically see or touch the machine. Especially inhome automation systems the reliability in handling some devices is crucial. For instance, asmoke detector managed by the home automation system required high levels of reliabilityfrom the device and from the system controller.

In terms of error detection and redundancy all of the discussed systems have strategies andmechanism to guarantee that the messages are delivered and executed correctly. Insteon,Zigbee, Z-Wave and Android@home (assumed to be based on 6LowPAN) employchecksums. The diﬀerence is that Insteon and ZWave use 8-bit checksums, butAndroid@home and Zigbee use the IEEE 802.15.4 deﬁned 16-bit checksum. If a messagesent by a controller does not reach the intended device or the command is not initiated, thenthe end-device does not send a successful message back. If the controller does not get theacknowledge in a speciﬁed time window it deploys a retransmission thus the network can beconsidered as reliable. In contrast, DomoticHome and X10 have only one-waycommunication capabilities so they do not have error detection or retransmission strategieswhich make them unreliable.

3.5.2 Ease of Installation

Another important aspect when selecting a home automation system is ease of installation.The question is if a home owner can install the system by himself without requiring extensiveprior knowledge or hiring technicians to support the installation. In this matter, Insteonclaims to provide easy installation. When an Insteon device is powered up for the ﬁrst time itautomatically connect to the Insteon network. Similarly, Android@Home provides a plug-and-play installation approach, but it requires initial pairing of the Android control devicewith the appliance. Other systems are not that easy to install. In contrast, since Z-Ware andZigbee are protocols rather than products the market oﬀers a wide number of solutions basedon Z-Ware and Zigbee. Therefore, the ease on installation of such systems is providerdependent. In addition there is no automatic connection to the networks with the device.Every device has to be manually added to the network. Further, the X10 requires more eﬀortthan its competitors in terms of ease of installation. It needs additional know-how ofelectrical wiring since it has to be connected to the existing home wiring systems (if anyotherwise the house required to be wired). All of the previously mentioned solutions arecommercial. In contrast, DomoticHome is not a commercial product, which means that ithasnot been developed for end-customers. It is mainly used by developers or people withtechnical skills. Consequently, installing such a system is more diﬃcult than others.

3.5.3 Communication

In a modern home there are a lot of devices that use RF communication technologies. Themore there are devices the more interference in the environment. For example a lot of homeshave Wi-Fi that works on 2.4GHz frequency. A residential building might have 10 or morediﬀerent Wi-Fi networks colliding and interfering with each other. Some home automationsystems employ multi-channel approach which is capable of using diﬀerent frequencies toreduce the probability of interference (e.g. ZigBee, Z-Wave and Android@Home). ZigBeesmain advantage is that the coordinator in the ZigBee network is capable of automaticallychanging the working frequency if any node in the network detects major interference. Thefrequency range of the other technologies can be changed manually depending on the user’sneeds. Insteon, DomoticHome and X10 use single-channel approach which means that theyhave only one frequency. Insteon works in the 900 Mhz frequency which is less crowded thanthe DomoticHome Wi-Fi frequency that can be a problem. But a lot of manufacturers aredesigning devices that use the sub-gigahertz frequency which in turn can also startovercrowding the frequency range. Physical range is equally important. But the signalstrength is very dependent on the environment. If there are walls made of concrete all aroundthe receiver/transmitter of a system, then the range is reduced signiﬁcantly. Most of thesystems compared can use nodes in the network to extend the range of the message. X10 andDomoticHome do not have such capabilities.

3.5.4 Scalability

Scalability is the ability to extend the network by adding extra networks or nodes. This mayinclude using networks that are based on the same technology or networks that are usingsome other technology. The only technology that can utilize device from another technologyis Insteon. It is capable of using original X10 devices because it shares the message protocolof the system. Insteon is capable of having 1024 nodes in its network which is a biggernumber when comparing to X10 or Z-Wave that can address up to 256 and 232 devices in anetwork respectively. The weaker of them happen to be DomoticHome. It can utilize 14 of itspins and this is also the maximum number of devices it can incorporate. Although, this isenough in the case of a mediumsized apartment. However, as mentioned before nomultiplexing strategies are considered. If the 14 bits are used by the board in multiplex modeit would be possible to manage 196 devices depending of the multiplex protocol used. Themost extendable is ZigBee which allows 64000 devices and it is extendable to theoreticallylimitless number of devices since one can add inﬁnite amount of ZigBee networks to anexisting network.3.5.5 CostThe cost of a home automation system is also important to customers. Every starter kitincludes the basic setup hardware and software one needs to automate lighting devices. Aswe can see from the table the cheaper the system the harder it is to install. DomoticHomedoes not have a starter kit. For the installation you need an Arduino board complementedwith an ethernet module which is approximately 120 euros. Some other resources one mayneed (including wiring, relays etc.) are rather cheap. Further, the prices for Android@Homeare not available yet and Insteon starter kits are sold from 75 euros and the modules from17.99 euros, but at the time the technology is not compatible with european voltages andsockets. Manufacturer of Insteon have announced that they will start distributing EU-compatible devices in the summer of 2012. On the other hand, X10 is the cheapest of them allwith prices for the starter kit from 57.99 euros and modules from 4.99 euros.

However, the installation happen be diﬃcult to install so the hiring of technicians is required- this turns in extra costs for support and consulting. The same applies for ZigBee and Z-Wave. A starterkit is nearly 200 euros and the modules are from 21.50 euros. This is a majordrawback since it already brings some diﬃculties to install and the cost is higher whencompared to its competitors.3.6 The Implementation of Wireless-based Home Automation Systems

This chapter addresses the implementation of home automation systems which rely on twodiﬀerent wireless communication technologies. The home automation systems presented relyon Arduino and Android open platforms.

As mentioned earlier the ﬁst idea was to implement Android@Home but since it is notavailable on the market yet we considered DomoticHome. Arduino was considered because itis open hardware and compared to other prototyping platforms it is the cheapest.Furthermore, it has a strong and active community and it is estimated that there are more than300000 Arduino devices sold since 2006. Arduino also has a cross-platform open IDE. Otherhome automation systems are relatively expensive, so the systems tries to be low cost byutilizing Arduino as hardware platform. Furthermore, Android was considered because of itspopularity among smartphones nowadays. Google estimated that there are over 300 millionactivated Android devices and 850 thousand are activated daily.

In addition, Arduino is highly Android compatible.

3.6.1 Scenario

The scenario describes a person who has installed a home automation system at his/her home.Every light in the apartment is connected to Arduino-based hardware. If he leaves a room hecan easily turn on/oﬀ the lights in the room he is leaving via his smart phone. He starts anAndroid application that is connected to the Arduino board using either Bluetooth or Wi-ﬁ.Later, he presses on the button named ’Bedroom’ and presses ’ON’ button on the screensending the ”Light On” command to the lights installed in the room labelled as ”Bedroom”.Later, the command is received by the Arduino board which execute the command turning onthe lights. Further, he chooses ”Living room” from the phones screen and presses ’OFF’ toturn oﬀ the lights and the command is executed in similar fashion. When heading to the roomhe might want to regulate the temperature of the home by pressing ’Temperature’ on hisphone. The telephone displays the current temperature which it gets from a thermistor moduleconnected to the Arduino. In similar fashion several devices can be controlled from thehandset. Fig. Block Diagram

3.6.3 Software Used

3.6.4 Programming Language used

 Embedded C/C++  Java & XML3.6.5 How to Connect the Bluetooth HC-05 to the Arduino1) Connect the Arduino’s +5V and GND pins to the bus strips on the breadboard, as shown inthe above circuit diagram.

2) Power the HC-05 module by connecting the 5V and GND pins to the bus strips on thebreadboard. The HC-05 is powered using 5VDC but includes an on-board voltage regulatorthat generates a 3.3V supply to power the transceiver. This means the TXD/RXD pinsoperate at only 3.3V.

3) Connect the TXD pin on the HC-05 module with the RXD pin (Pin 0) on theArduino. This connection allows the HC-05 to send data to the Arduino. The reason why wepair up TXD on the Bluetooth module with RXD on the Arduino is simple. The TXD pin isused to transmit data from the Bluetooth transceiver, while the RXD pin is used to receivedata on the Arduino.

Although the Arduino is using 5V signal levels, and the HC-05 is using only 3.3V signallevels, no level shifting is required on this particular signal. This is because the Arduino isbased on an Atmel ATmega328 microcontroller which defines logic high as any level above3V. So no level shifting is necessary when going from 3.3V to 5V. However, that isn’talways true when going the other direction from 5V to 3,3V as we’ll discuss in the next step.

Fig. Connection of Arduino from Bluetooth module

4) Now we need to connect the TXD pin on the Arduino to the RXD pin on the HC-05. Thisconnection will form the second half of the two-way communication and is how the Arduinosends information to the HC-05.

Since the receiver data lines on the HC-05 are only 3.3V tolerant, we need to convert the 5Vtransmit signal coming from the Arduino into a 3.3V signal. While this is usually best doneusing a logic level converter, we’re instead just using a simple voltage divider to convert the5V signal into a 3.3V signal.As shown in the circuit diagram, we’ve connected a 1k ohm and a 2.2k ohm resistor acrossthe GND and TXD pins on the Arduino. This is called a resistor divider because it dividesdown the input voltage. We obtain the 3.3V level signal from the intersection of these tworesistors.

The equation for a divided down voltage is Vout = [2.2k/(2.2k + 1k)]*5V = (2.2k/3.2k)*5V =3.46V, which is close enough to 3.3V to prevent any damage to the HC-05.

This crude solution should never be used with a high-speed signal because the resistors forma low-pass RC filter with any parasitic capacitance on the connection.

Once you have connected the HC-05 module to the Arduino, you can power the Arduino witha 12V DC supply or USB cable. If the red and blue LEDs on the HC-05 are blinking, thenyou have successfully connected the bluetooth module with the Arduino.

We don’t use the STATE and EN pins on the HC-05 module, since they are not requiredfor this setup.3.6.6 Setting up the Relay Circuit

The next step is to connect the Arduino to a relay module, so that we can turn the connecteddevice ON/OFF. As shown in the circuit diagram above, we’ll be connecting the relaymodule in series with our electrical load, so that we can break the connection when we wantto turn the device off and complete the circuit when we want to turn it on.

For this application we’re using a relay module which includes the relay drive circuitallowing it to connect directly to a microcontroller GPIO pin.

CAUTION: The relay module we’re using can handle up to 10 amps of current at up to240V AC. That’s enough current for a lot of devices but not enough for high powerappliances like a heater or dryer. For high power appliances you’ll likely need about twicethe current capacity (~ 20 amps). You can either upgrade to a higher current relay, or placemultiple relays in parallel. Two 10 amp relays in parallel are equivalent to a single 20 amprelay since half of the current goes through each relay.

Here’s how to connect the relay module to the Arduino:

1) First, connect the 5V and GND pins of the relay module to the bus terminals on thebreadboard.2) Next, connect the IN1 pin on the relay module with PIN 4 on the Arduino. If you have amulti-channel module (2, 4 or 8 channels), you can connect IN2, IN3 … In(n) with differentdigital pins on the Arduino, and repeat the steps below for configuring the other pins.

3) Now we need to connect the AC load to the relay module. If you look carefully at theterminal block on the relay module, you’ll find these three terminals:

C: CommonNC: Normally ClosedNO: Normally Open

3.6.7 Here’s how the relay module works:

When the relay is off, the COM terminal is connected to the NC (Normally Closed) terminal,which means if you connect the bulb to the NC terminal; it will turn ON even when the relayisn’t energized. But that’s not what we want.

We want to turn on the bulb only when we send a signal from smartphone. That’s the reasonwe connect the load to the NO (Normally Open) terminal, so that when the relay is triggeredfrom the Arduino, the contact switches from the NC terminal to the NO terminal, therebycompleting the circuit.

3.6.8 Uploading the Code

After you have successfully wired things up, the next step is to upload the code to theArduino. In order to upload the code, connect the Arduino through the USB port on yourcomputer and open the Arduino IDE.#define RELAY_ON 0#define RELAY_OFF 1#define RELAY_1 4char data = 0;void setup() {// Set pin as output.pinMode(RELAY_1, OUTPUT);// Initialize relay one as off so that on reset it would be off bydefaultdigitalWrite(RELAY_1, RELAY_OFF);Serial.begin(9600);Serial.print(“Type: 1 to turn on bulb. 0 to turn it off!”);}void loop() {if (Serial.available() > 0) {data = Serial.read(); //Read the incoming data and store it intovariable dataSerial.print(data); //Print Value inside data in Serial monitorSerial.print(“\n”); //New lineif(data == ‘1’){digitalWrite(RELAY_1, RELAY_ON);Serial.println(“Bulb is now turned ON.”);}else if(data == ‘0’){digitalWrite(RELAY_1, RELAY_OFF);Serial.println(“Bulb is now turned OFF.”);}}}The code is actually pretty simple. It initializes the relay first in the setup() method, and thenwaits for input on the serial port in the loop() method. If ‘1’ is received as input, it turns onthe relay, and if ‘0’ is received, it turns off the relay.

Since the Arduino UNO uses its UART port for programming, it can’t communicate with thecomputer and receive data from the HC-05 Bluetooth module at the same time. If you haveattempted the above code on an UNO, you should get the error:avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00An error occurred while uploading the sketchDon’t worry though. Simply unplug the jumper wire connected to Pin 0 on the Arduino UNO(RXD pin), and re-attempt the code update. You should now be able to update the codesuccessfully. After programming is complete then reconnect the jumper wire.

3.6.9 Controlling the bulb from your Android device

Now that we have setup the hardware and successfully uploaded the code, the next step is tocontrol the setup from a smartphone. In order to that, we have developed an app which willbe installed on our android phone.

3.7 Use Case Diagram

Fig. Use Case

3.7 Work Flow Diagram

Fig. Work Flow of proposed Home automation

Chapter 5

Testing and Results

5.1 Installation of Arduino

For coding of Arduino we need software called Arduino IDE. As a global overview ofArduino programming, it is divided, as established in the IDE code development, in two mainparts: setup and loop functions. The first is the function that is executed only the first timethat application runs, instead the second one is executed as a loop, continuously. For thisapplication additional functions are included to segment and make the program moreefficient. There is a function for each mode of function that includes the necessary controlloops. At the beginning of the Arduino code all the components are delimited: type, the pin towhich is associated and the operation mode. In addition, it is also declared the globalvariables and the libraries which will be used in the whole code.Coding on Arduino IDE is done for LCD display, relay and Bluetooth module. Fig. Snapshot Of Code on Arduino IDE

The code is:

#include <LiquidCrystal.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

String inputs;

#define relay1 6 //Connect relay1 to pin 9

#define relay2 7 //Connect relay2 to pin 8

#define relay3 8 //Connect relay3 to pin 7

#define relay4 9 //Connect relay4 to pin 6

void setup()

Serial.begin(9600); //Set rate for communicating with phone

lcd.begin(16,2);lcd.setCursor(0,0);

lcd.print("HOME-AUTOMATION");

lcd.setCursor(0,1);

lcd.print("Project by:-");

delay(5000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("VINAYAK GUPTA");

lcd.setCursor(0,1);

lcd.print("VAISHNAVI SETH");

delay(2000);

lcd.clear();

lcd.setCursor(0,0);

lcd.print("TANAY SEN");

lcd.setCursor(0,1);

lcd.print("VIJAY KUMAR PAL");

delay(2000);

lcd.clear();

pinMode(relay1, OUTPUT); //Set relay1 as an output

pinMode(relay2, OUTPUT); //Set relay2 as an output

pinMode(relay3, OUTPUT); //Set relay1 as an output

pinMode(relay4, OUTPUT); //Set relay2 as an output

digitalWrite(relay1, LOW); //Switch relay1 off

digitalWrite(relay2, LOW); //Swtich relay2 off

digitalWrite(relay3, LOW); //Switch relay1 off

digitalWrite(relay4, LOW); //Swtich relay2 off

}void loop()

while(Serial.available()) //Check if there are available bytes to read

delay(10); //Delay to make it stable

char c = Serial.read(); //Conduct a serial read

if (c == '#'){

break; //Stop the loop once # is detected after a word

inputs += c; //Means inputs = inputs + c

if (inputs.length() >0)

Serial.println(inputs);

if(inputs == "A")

lcd.clear();

lcd.print("LIGHT ON");

digitalWrite(relay1, LOW);

else if(inputs == "a")

lcd.clear();

lcd.print("LIGHT OFF");

digitalWrite(relay1, HIGH);}

else if(inputs == "B")

lcd.clear();

lcd.print("FAN ON");

digitalWrite(relay2, LOW);

else if(inputs == "b")

lcd.clear();

lcd.print("FAN OFF");

digitalWrite(relay2, HIGH);

else if(inputs == "C")

lcd.clear();

lcd.print("TV ON");

digitalWrite(relay3, LOW);

else if(inputs == "c")

lcd.clear();

lcd.print("TV OFF");

digitalWrite(relay3, HIGH);

else if(inputs == "D")

{lcd.clear();

lcd.print("MUSIC ON");

digitalWrite(relay4, LOW);

else if(inputs == "d")

lcd.clear();

lcd.print("MUSIC OFF");

digitalWrite(relay4, HIGH);

inputs="";

}The completed proposed home automation using Arduino and Bluetooth looks like the belowpicture.

Fig. Final Completed project

The USB attached from Arduino kit needs to be connected from a DC source whereas theplug needs to be inserted to supply an AC source.

5.2 Android Application

To operate the above hardware we require a android mobile app that will connect with thehardware through a Bluetooth module HC-05.The snapshot of the operating android app is:

Fig. Snapshot of the App

Chapter 6 Conclusion

The conclusion, this low cost system is designed to improve the standard living in home. Theremote control function by smart phone provides help and assistance especially to disabledand elderly. In order to provide safety protection to the user, a low voltage activatingswitches is replaced current electrical switches. Moreover, implementation of wirelessBluetooth connection in control board allows the system install in more simple way. Thecontrol board is directly installed beside the electrical switches whereby the switchingconnection is controlled by relay. Furthermore, flexible types of connections can be designedas backup connections to the system. The connected GUIs (Graphical User Interface) aresynchronized to the control board. They indicate the real-time switches status. The system isdesigned in user-friendly interface. The easy to use interface on Window and Android GUIprovides simple control by the elderly and disabled people. For future work, GSM technologybased Home Automation can be developed which has been already discussed in the previoussection. All the future work is expected without spending extra cost, makes sure of safety andsecurity too.

Proposed system is only able to control the appliances within short range, for future researchwork it is recommended to increase the range and interface more sensors and it should be alow cost and user friendly system. Moreover home automation system can be interfaced withbiomedical (EMG) signals. It will be beneficial for amputees; they will be able to control theappliances using their muscle's movement.

Related Works:

There are many related works. We can enlist them as follows:

1. Remote Control operated Home Automation System with microcontroller.

2. Remote Control operated Home Automation System without microcontroller.

3. Cellular phone controlled Home Automation System without microcontroller.