You are on page 1of 20

HomeAutomation

A Full-Featured Infrastructure-Less Home Automation System

Project report

Ubiquitous Computing

Joakim Brjesson, Victor Strm, Yiqi Mao, Kadri-Ann Valgevli, Amir Sabbagh Pour

CHALMERS UNIVERSITY OF TECHNOLOGY Gteborg 2008

HomeAutomation Joakim Brjesson, Victor Strm, Yiqi Mao, Kadri-Ann Valgevli, Amir Sabbagh Pour Brjesson, Strm, Mao, Valgevli, Sabbagh Pour 2008. Chalmers University of Technology 412 96 Gteborg

Abstract
The HomeAutomation is a wireless home automation system that is supposed to be implemented in existing home environments, without any changes in the infrastructure. HomeAutomation let the user to control the home from his or her computer and assign actions that should happen depending on time or other sensor readings such as light, temperature or sound from any device in the HomeAutomation network.

Table of Contents
Project report Ubiquitous Computing 3 Joakim Brjesson, Victor Strm, Yiqi Mao, Kadri-Ann Valgevli, Amir Sabbagh Pour............................................................................3 Abstract Table of Contents
1 Introduction 2 Background
3 Concept 4 Realization

5 6
7 8
9 10

4.1 Network ..............................................................................................................................10


4.2 Software ...........................................................................................................................................12 4.2.1 4.2.2

User Interface ............................................................................................................................12 Program evolution and inner workings .............................................................................13

4.3 Electronics...........................................................................................................................13

4.3.1 Arduino........................................................................................................................14
4.3.2 Dimming/switching circuit.................................................................................................14 4.3.3 Wireless modules...............................................................................................................15 4.4 Prototyping and construction............................................................................................16

5 Evaluation

17

5.1 Electronic Blocks ..........................................................................................................17 5.2 Pen Timer ......................................................................................................................17 5.3 Control4..........................................................................................................................18
6 Discussion 19

HomeAutomation
2008-12-19

Project Report

1 Introduction
This report is describing our group project in the Ubiquitous Computing course. It is containing the design process of the project, starting with brainstorming we had to get the final product idea and finishing with the prototyping within home alike environment. The original problem was to design and implement a larger ubiquitous computing project into a home environment. The report is describing what kind of design process, hardware and software have been used to build up the prototype for that product design that we had chosen as our final goal.

HomeAutomation
2008-12-19

Project Report

2 Background
Most advanced home automation systems in existence today require a big and expensive change of infrastructure. This means that it often is not feasible to install a home automation system in an existing building. The HomeAutomation is a wireless home automation system that is supposed to be implemented in existing home environments, without any changes in the existing infrastructure. HomeAutomation lets the user to control his home from his or her computer. In the computer program the user can create actions what should happen with electrical devices in the network depending on the sensors sensing surrounding environment.

HomeAutomation
2008-12-19

Project Report

3 Concept
Every HomeAutomation box is a stand-alone device. It is connected to the mains and controls the power outlet of the electrical device that is plugged into it. There will be a receiver and transmitter in each of the box, so they can exchange information with the master (a computer). People can control power supply of electrical devices in order to create an interactive home environment to facilitate the control without changing any home appliance. People can enjoy the high technology and simplicity modern life style. Each device will be with standard setup and while adding it into network; it can be given an address and tasks to do. All the setting will be easily resettable to default value, so people can move the devices between different electrical devices and networks. HomeAutomation boxes will be put into different rooms at home, depending on the needed functionality. Various different sensors could be attached to the boxes. The sensors are used as triggers for actions, that user can set up in the computer program.

HomeAutomation
2008-12-19

Project Report

4 Realization
The project started off with a brainstorming session. All ideas about how the HomeAutomation should work and what functions it should have were written on a whiteboard. We discussed all possible solutions and ideas that we had come up with and removed things that were not possible to implement within this project scope. All that was left on the whiteboard in the end was divided up into following task areas: Network Create a wireless connection between embedded Arduino boards and the computer program. To define a protocol for serial communication that both Arduino and computer program can read. Software Computer software has to be able to control the communication, send tasks for HomeAutomation embedded devices and be provided with the GUI where end users can set up actions. Electronics This area covers in detail the hardware solutions chosen and how that affected the final prototype. The hardware could be described as three different work areas: arduino, dimmer/switching circuit and wireless modules. Prototyping and construction The last focusing area is prototyping the final product. We need to build the product and put it into aesthetic form. The presentation of the project should be done so the visitors understand how the final product is supposed to be used. Therefore we have to come up the suitable scenarios to present. Some furniture is needed to get a home environment feeling for the presentation.

4.1 Network
The first task for network was to get two Arduino boards communicating with each other via serial communication. After some struggle with the wired connection we got it working. One of the Arduinos was sending a message and second one as echoing it back. On the same time, part of our group was working with trying to establish a wireless connection. The wireless components that we used are called Easy-Radio transceiver. These components could work both as transmitter and receiver, which fit perfectly for our project. It took some time to find out how to get the wireless communication working. After some testing we managed to echoing messages back with the wireless components as well. Now it was possible to send serial data over a wireless connection and it was time to test it with some more advanced Arduino code.

10

HomeAutomation
2008-12-19

Project Report

Figure 1: Wireless Connection between Computer Program and Arduino

To be able to try this out properly we had to come up with a protocol to use. A protocol describes how the packages that are going to be sent, how the communication is structured and what the sent/received bytes stand for. It is needed for the receiver to know how much and what kind information it is reading and how to should handle it. For a sender, a protocol gives the rules for what and in which order to send the data. The protocol we decided to use is a custom made, 40 bits long one: The first 8 bits for house code to identify that the HomeAutomation devices that you are controlling belong to your home network. Following 8 bits was for unit identification to make sure that the correct device responds to the message. In our implementation the computer program broadcasts the message to all devices. Therefore it is needed to have addresses assigned for the devices. Next 8 bits was assigned for function code. This tells to the device what task needs to be executed. For example if a lamp should blink or fade etc. The default function is a function that asks if anything have changed. The last 16 bits of the protocol is used to send values for the specific function that is being used. For the default function bit 1-4 is used for telling if connected digital sensor have changed, 5-8 if analog sensor have changed, 912 is used for telling if a digital sensor have been plugged in and 13-16 if any analog sensor have been plugged in.

The network that we created that is using this protocol is a master/slave network. The computer is the master and all the other devices are slaves.

Figure 2: Sketch of the Network with One Master (the Computer) and Four Attached Units.

11

HomeAutomation
2008-12-19

Project Report

The computer is asking each slave, one at a time, if anything has changed since last time. If something have changed then the slave will reply and tell what that have happened. If nothing has changed the slave will reply with that. When the master receives the reply from the slave that says that something has changed it will check if there are any actions that are triggered on the changes. Those actions are made in the computer software (4.2 Software). If there are actions that should be triggered the master will transmit information to the affected slaves and tell them what to do. For example if the party button have been pressed (digital sensor changed/ high/low) then tell a device to start blinking.

Figure 3: Easy - Radio Wireless Modules

4.2 Software
In parallel with the Arduino code being programmed, the software for the computer was created. The software is to be installed on the end user's computer in order to set up and run the HomeAutomation network at home. The program is written in Java, a language chosen because of the existing knowledge about the language in the group and the in-built cross-platform support. 4.2.1User Interface The main user interface is divided in two parts, the main panel with all connected devices and their status and a table of all currently configured actions and their priority.
4.2.1.1 Device Panel

The device panel is a horizontally scrollable list of all connected devices, which can be described by a custom name. For each device you can see all connected sensors and their status. You can also in real time control each device, for example set a lamps intensity to medium intensity or slowly fade another from off to fully lit and query the current status of the devices controllable outlet.
4.2.1.2 Actions

One of the main features of the program is the ability for the user to configure actions. An action is a kind of if-then clause. For example: If the night lamp lights up at night then set all hallway lamps to half lit. The user can also assign a custom name to each action to make it easy to associate the action with what is performed.

12

HomeAutomation
2008-12-19

Project Report

Below the list of devices there is a list of all currently configured actions and their priority. The actions priority can be changed and the actions themselves can be edited and deleted. If the Edit button or then Add new action is clicked, a new dialog is opened where the user can create or edit new actions to produce the kind of if-then clauses described above. Actions can have an arbitrary number of input triggers and output actions.
4.2.1.3 Other Functions

Apart from the two abovementioned core functions of the user interface, there are also a few assorted functions to be able to setup the network properties and to monitor the network activity and the messages getting transferred. 4.2.2Program evolution and inner workings The first version of the computer software was a basic program for testing out the serial communication using the custom made protocol. It had a simple graphical interface for creating packages to be sent to Arduino and to monitor incoming packages. The actual communication is taken care of by a Java library called Java Communications API (Sun Corporation, 1998), which provides access through the Java Virtual Machine to the hardware Com port on different platforms. Next iteration of the program was model the actual devices. Every attached device is modeled as an instantiation of the device class, which keeps track of the devices state and provides an interface to communicating with it. Every time a message is decoded it is propagated to the device affected, which in turn updates its own state and notifies any subscribers to its changes (the graphical user interface for example). After the implementations of devices followed the implementation of the actions described earlier. One class keeps track of all actions and registers as subscriber to any changes for the devices used as input triggers for the actions. It then, according to the priority of the actions, relays the state of all connected devices to each action. The actions class then checks if the current world state matches the requirements set in its input triggers and, if that is the case, performs the actions configured by the user. Each device affected by an output action gets flagged, thus making sure no device gets controlled twice during the same state update.

4.3 Electronics
ZDC circuit generally detects if the input signal crosses the reference point (0v in our case) and produces an output state change. This circuit consists of two opto couplers in parallel. They are directly connected to main voltage. Each of these opto couplers works in half cycle of the AC voltage signal, and outputs are connected in parallel, so we'll have four state changes per cycle at the output of the opto couplers. It will be used by the Arduino for future actions.

13

HomeAutomation
2008-12-19

Project Report

Figure 4: ZDC Circuit

Figure 5: ZDC output signal

4.3.1Arduino We have used Arduino to detect pulses from the ZDC circuit. The signal from ZDC goes to Pin3 of Arduino which is defined as external interrupt handler (INT1). For each pulse the interrupt will be triggered and a timer inside the Micro controller (MCU) will be set with the desired interval. The output from the MCU is a digital output from Pin Number 5 which goes to the Dimming/Switching circuit

4.3.2Dimming/switching circuit This circuit includes an Opto coupler-triac driver which triggers the triac gate. The triac simply acts as a switch. By switching the triac we can control the output voltage, therefore we can have an AC light dimmer. When Microcontroller sends a positive pulse to the opto coupler (EL503), it will trigger the triac via the triac gate. Triac keeps onstate until the phase voltage reaches 0v. If you feed the triac gate with a permanent High signal, it will remain in the on state, so it will act as a normal switch.

14

HomeAutomation
2008-12-19

Project Report

4.3.3Wireless modules These modules operate on the Pan-European 433Mhz frequency band from a 3.6v power supply. There are 9 frequency channels available on each module. You can use encryption for the transmitting data. The baud rate is set to 19,200Kbps by default. The range can be extended by using the proper antennas up to 250m Line Of Sight (LOS). (Low Power Radio Solutions Ltd., 2003) Beside these circuits we have added an LED, push button and also two general purpose digital/analogue inputs for each box. The LED indicates that the related box is powered on and is working properly. By pressing the push button on the box, a new address will be automatically assign to the box from the PC. Its possible to connect different kind of analogue/digital sensors to each box. When you plug in the sensor connector you can see in the software if its connected properly or not.

Figure 6: Whole circuit

15

HomeAutomation
2008-12-19

Project Report

4.4 Prototyping and construction


To be able to present our product it was needed to make the boxes where the Arduino boards with the needed circuits will be placed in. After some research and discussion within the group, we decided for using time switches. These are suitable for this purpose and they already have the power connector. We removed the micro controller that originally it had inside and replaced it with our dimmer circuit and power supply module. Some modifications were needed on the cover to make holes for digital and analog sensor connector. As the space was quite limited inside the time switch box, we created a separate box for the communication module. It had the Arduino board and Easy-Radio module inside it.

Figure 7: Arduino board inside a box of time switch

In order to present the functionality of the technology, we chose to build a party mode scenario. It blinks and dimmers the lights and turns on radio. For that purpose one special digital sensor was created. It was a normal switch but we made it into a big red button to attract attention. The HomeAutomation devices that has this special box attached to, reads this sensor value (recognizes if the button was pressed). When the party-mode-button is pressed the devices enter a party-mode-state. The specific events of the party-mode can be assigned in the computer GUI software.

Figure 8: The Christmas Mode Button

16

HomeAutomation
2008-12-19

Project Report

5 Evaluation
During the exhibition we let people to try the system. Most people found it interesting and they appreciated the idea to automate their home environment. It made them think about automated actions that they would like to have at their home environment. When we explained a few examples where HomeAutomation could be used they were very fast at coming up with their own examples. The party mode was introducing the product's functionality quite well. Unfortunately we could not let people to play around with GUI program to define their own actions due to some software issues. Once a while we experienced some problems within our system and we had to reset our devices, but overall working experience was good. The feedback we got was mostly positive. We were also told that the system speed should be much faster in order to be successful product. During our presentation it took more than 5 seconds for all devices to start their tasks. Due to the time limits we were not able to present our second scenario that we had thought. We wanted to show the analog sensors. We had created 2 LDR sensors and we wanted to perform a use case that if you turn of one lamp then 2 other will dim down to 50% and if you turn off 2nd lamp that the 3rd one will be turned off as well. We didn't get the analog sensor detection working properly within the time we had and also the analog sensor reading was producing much communication in the system that made it even slower. Related work

5.1 Electronic Blocks


Electronic Blocks is a programming interface for children between three and eight years old. There are three kinds of blocks in the project: sensor blocks, action blocks and logic blocks. The sensor blocks detect light, sound and touch. The action blocks are able to produce light, sound and movement. The logic blocks are controlling the signals between the sensor blocks and action blocks. By connecting those blocks with each other children will be able to program their own structures. For example a robot might be able to follow light. (Wyeth & Wyeth, 2001)

Figure 9: The Electronic Blocks

5.2 Pen Timer


The timer is a white board with a groove in the middle; it can control the electrical devices when they connected. The only thing to do is use a pen to draw a line on the

17

HomeAutomation
2008-12-19

Project Report

groove, the LEDs will turn on, and the timer works. As time passes, LED will go out one by one, and the line at the same time will be wiped after power cut off. It also can set "break time" mode for the electrical devices. Users can draw lines without continuous line to meet their needs, so that power can get through these times. (Huang et. al, 2005)

Figure 10: The Pen Timer

5.3 Control4
Control4 is the full home automation system that is available on the market. It is an advanced system that supports lightning, climate, home theater solutions. People need to build in the infrastructure into their home walls. The systems are controlled remotely and all electrical devices remote controls will be replaced with the Control4 remotes. (West et. al., 2003)

18

HomeAutomation
2008-12-19

Project Report

6 Discussion
The HomeAutomation could be developed further by making it more stable and put more effort on the visual design of the product. We could reduce the size of the product by replacing the power supply module and Arduino microcontroller with much smaller pieces. All the devices could be equipped with IR receiver to control the electrical devices at home that support the IR communication. More sophisticated actions and scenarios can be created with this. IR commands enable larger variety for controlling electrical devices that only the power outlet. A lot of improvements could be done in the computer program as well. It should be more customizable for an end user and it should have some password protection for security reasons. It would be also nice to make it web-based so that users can control their home remotely.

19

HomeAutomation
2008-12-19

Project Report

7 Conclusion
HomeAutomation is undeniably a resource which can make a home environment automated. People can control their electrical devices via these HomeAutomation devices and set up the controlling actions in the computer. We think this product have high potential for marketing in the future. At the moment the components are a bit to high to be able to produce these devices for a interesting price.

20

HomeAutomation
2008-12-19

Project Report

8 References
Wyeth, Peta, Wyeth, Gordon (2001), Electronic Blocks Tangible Programming Elements for Preschoolers, University of Queensland, Brisbane, Australia. West, Smith, Morgan (2003): Control4 Home Automation, Tillgnglig: <http://www.control4.com/> (2008-12-18). Low Power Radio Solutions Ltd. (2003), Tillgnglig: <http://www.lprs.co.uk/> (2008-12-18). Henry Huang, Jack Chang & Howard Yu (2005), Pen Timer, Tillgnglig: <http://www.k1982.com/design/187845.htm> (2008-12-18). Sun Microsystems (1998), Java Communications API, Tillgnglig: <http://java.sun.com/products/javacomm/> (2008-12-18).

21

HomeAutomation
2008-12-19

Project Report

9 Appendixes
Appendix I: Project plan

22

You might also like