Sie sind auf Seite 1von 88

Auto-MATE:

Intelligent Home Automation Using


Mains Power Communications
by
Warren Hastings
Department of Computer Science and Electrical Engineering,
University of Queensland.

Submitted for the degree of


Bachelor of Engineering (Honours)
in the division of Electrical Engineering.

October 2000

117 Addison Road


CAMIRA QLD 4300

20 October 2000

The Dean
School of Engineering
University of Queensland
ST LUCIA QLD 4072

Dear Professor Simmons

In accordance with the requirements of the degree of Bachelor of Engineering


(Honours) in the division of Electrical Engineering, I submit this thesis entitled
Auto-MATE:

Intelligent

Communications.

Home

Automation

Using

Mains

Power

This work was performed in partnership with Mr Shane

Hingst under the supervision of Dr Mark Schulz.

I declare that the work submitted in this thesis is entirely my own except where
appropriately acknowledged and referenced.

This thesis has not been

previously submitted for a degree at the University of Queensland or any other


institution.

Yours Sincerely

Warren Hastings

ii

Abstract
This thesis document describes the design, development and successful
prototype implementation of an integrated home automation system titled AutoMATE. The Auto-MATE system replaces dumb electrical outlets and switches
found throughout the home with intelligent modules controlled by a central
computer.

The new modules connect to form a network using the existing

power lines and the CEBus Protocol.

The prototype system contains an

appliance module, a light dimmer module, a motion detector module and


climate sensing modules. The design is unique in that there are presently no
comparable products available in Australia. A set of design specifications and
criteria are developed against which the product implementation is realised. At
the completion of the project the final design is shown to compare favourably
with the specifications and several future directions that the project may take
are suggested. The Auto-MATE system serves as a proof of concept model
for ensuing development.

iii

Acknowledgments

I would like to thank the following people who helped to make this thesis
possible.

Shane Hingst for being without a doubt the best possible thesis partner.

Mark Schulz for sharing his enthusiasm and knowledge of home automation.

Geoff Walker for circuit design suggestions.

Graham Vayro of Vayrotec Pty Ltd for design advice and component
donations.

Andrew Sallaway for cunningly providing a television in the lab under the guise
of a thesis project.

iv

For Justine and Jasmine,


I may not be a smart man but I know what love is.

Forrest Gump

Contents
Abstract

iii

Acknowledgments

iv

Contents

vi

List of Figures

List of Tables

xi

1. Introduction

1.1 What is Home Automation? ................................................................... 1


1.2 The Home Automation Maze ................................................................. 2
1.3 The Auto-MATE Vision .......................................................................... 3
1.4 Auto-MATE Features ............................................................................. 4
1.5 Structure and Organisation of this Document ........................................ 4
2. Review of Existing Home Automation Technologies

2.1 X-10 ....................................................................................................... 7


2.1.1

The X-10 Protocol ..................................................................... 7

2.1.2

X-10 Products ........................................................................... 9

2.1.3

X-10 Summary ........................................................................ 12

2.2 LonWorks............................................................................................. 13
2.2.1

LonTalk ................................................................................... 13

2.2.2

LonWorks Products................................................................. 16

2.2.3

LonWorks Summary................................................................ 17

2.3 CEBus.................................................................................................. 17
2.3.1

The CEBus Protocol................................................................ 17

2.3.2

CEBus Products...................................................................... 21

2.3.3

CEBus Summary..................................................................... 23

2.4 European Home Standard ................................................................... 23


2.4.1

The EHS Protocol ................................................................... 23

2.4.2

EHS Products.......................................................................... 23

2.4.3

EHS Summary ........................................................................ 24

vi

2.5 Review Summary................................................................................. 24


3. System Design Specifications

27

3.1 The Auto-MATE System ...................................................................... 27


3.2 Design Criteria ..................................................................................... 28
3.3 System Topology ................................................................................. 29
3.4 Central Controller................................................................................. 30
3.4.1Controller Platform ....................................................................... 30
3.4.2

Modes of Control..................................................................... 31

3.4.3

Additional Services.................................................................. 31

3.4.4

PC to Power Line Interface ..................................................... 32

3.5 Mains Power Communications ............................................................ 32


3.5.1

Reliability................................................................................. 32

3.5.2

Baud Rate ............................................................................... 32

3.5.3

Transmission Distance............................................................ 33

3.5.4

Network Communications IC................................................... 33

3.5.5

Microcontroller......................................................................... 33

3.6 Intelligent Modules............................................................................... 34


3.6.1

Minimum Functionality ............................................................ 34

3.6.2

Light Switch / Dimmer ............................................................. 34

3.6.3

Appliance Module.................................................................... 34

3.6.4

Motion Detector....................................................................... 35

3.6.5

Climate Sensor........................................................................ 35

3.6.6

Load Sensing .......................................................................... 35

3.7 Summary of Design Specifications ...................................................... 35


4. Hardware Implementation

36

4.1 Overview of Hardware Requirements .................................................. 36


4.1.1

Physical Orientation of Subsystems........................................ 37

4.2 Mains Power Communications ............................................................ 38


4.2.1

Network Communications Transceiver IC ............................... 38

4.3 Microcontroller Selection...................................................................... 42


4.4 Load Control ........................................................................................ 43
4.4.1

Zero Voltage Crossing Detection ............................................ 43

4.4.2

Load Switching........................................................................ 44

4.5 Load Sensing....................................................................................... 44

vii

4.6 Local Control Buttons .......................................................................... 44


4.7 Power Supplies.................................................................................... 45
4.8 Temperature Sensing Circuit ............................................................... 45
4.9 Humidity Sensing Circuit...................................................................... 45
4.10 Motion Detector Circuit ........................................................................ 45
4.11 Three Phase Signal Coupling .............................................................. 46
4.12 Remote Voice Activation...................................................................... 46
4.13 PC Power Line Interface ................................................................... 46
4.14 Hardware Design Summary................................................................. 47
5. Software Implementation

48

5.1 Overview of Software Requirements.................................................... 48


5.2 Central Controller Software.................................................................. 49
5.2.1

CEBus Conformance............................................................... 49

5.2.2

The Common Application Language ....................................... 49

5.2.3

Internet Connectivity ............................................................... 50

5.2.4

Speech Recognition ................................................................ 50

5.3 Communications Software ................................................................... 50


5.3.1

Communications Protocol ....................................................... 51

5.3.2

Communications Driver ........................................................... 52

5.3.3

PC to Mains Power Interface................................................... 55

5.4 Module Application Software ............................................................... 55


5.4.1

CEBus Conformance............................................................... 55

5.4.2

Appliance Module.................................................................... 55

5.4.3

Light Dimmer Module .............................................................. 56

5.4.4

Motion Detection ..................................................................... 56

5.4.5

Temperature & Humidity Sensing ........................................... 56

5.5 Software Design Summary .................................................................. 57


6. Performance Evaluation of the Auto-MATE System

58

6.1 Terminal Status of Project.................................................................... 58


6.1.1

Hardware................................................................................. 58

6.1.2

Software .................................................................................. 59

6.1.3

Mains Power Communications................................................ 59

6.1.4

Status Summary...................................................................... 59

6.2 Comparison with Design Specifications ............................................... 59

viii

6.2.1

Central Controller .................................................................... 60

6.2.2

Mains Power Communications................................................ 60

6.2.3

Intelligent Nodes ..................................................................... 61

6.2.4

Phase Coupling....................................................................... 61

6.2.5

Comparison Summary............................................................. 62

6.3 Introspective Engineering Performance Evaluation ............................. 62


6.3.1

Utilisation of Project Tools....................................................... 62

6.3.2

Application of Design Techniques ........................................... 63

6.3.3

Critical Analysis of Personal Performance .............................. 63

6.4 Performance Summary ........................................................................ 64


7. Future Developments for Auto-MATE

65

7.1 Design Review..................................................................................... 65


7.1.2

Voice Command Control ......................................................... 65

7.1.3

Power Supply .......................................................................... 66

7.2 Possible Product Extensions ............................................................... 66


7.2.1

Power Measurement ............................................................... 66

7.2.2

SMS Text Messaging .............................................................. 67

7.2.3

Set Top Box ............................................................................ 67

7.3 Summary of Future Developments ...................................................... 68


8. Concluding Remarks

69

References

70

Appendices

74

A.

Circuit Schematics and PCB Layouts .................................................. 75

B.

Source Code Listings........................................................................... 81

C.

CAL Contexts Objects and Methods.................................................. 101

ix

List of Figures

Figure 2.1:

X-10 Signal Transmission ............................................................. 7

Figure 2.2:

X-10 Transmission Start Code ...................................................... 8

Figure 2.3:

X-10 Transmission Cycle .............................................................. 9

Figure 2.4:

Decorator Dimmer ....................................................................... 11

Figure 2.5:

Two Way Lamp Module............................................................... 11

Figure 2.6:

Appliance Module........................................................................ 12

Figure 2.7:

Eagle Eye Sensor........................................................................ 12

Figure 2.8:

Powerline Interface...................................................................... 12

Figure 2.9:

Leviton Dimmer ........................................................................... 16

Figure 2.10: Leviton Occupancy Sensor.......................................................... 16


Figure 2.11: Infinitelan Controller .................................................................... 17
Figure 2.12: OSI Model ................................................................................... 18
Figure 2.13: Spread Spectrum Chirp ............................................................... 19
Figure 2.14: Manager Plus .............................................................................. 22
Figure 2.15: Smart Switch ............................................................................... 22
Figure 2.16: Appliance Port ............................................................................. 22
Figure 2.17: Sensor Port ................................................................................ 23
Figure 2.18: EHS Development Board ............................................................ 24
Figure 3.1:

Auto-MATE Block Diagram.......................................................... 28

Figure 3.2:

Star Topology .............................................................................. 30

Figure 4.1:

CEBus Control Board .................................................................. 37

Figure 4.2:

CEBus Power Board ................................................................... 37

Figure 4.3:

Hardware Block Diagram............................................................. 38

Figure 4.4:

EK P300 Development Board...................................................... 39

Figure 4.5:

Flow Chart of P300 Initialisation .................................................. 40

Figure 4.6:

Domosip ...................................................................................... 41

Figure 5.1:

Communications Flow Chart 1 .................................................... 54

List of Tables

Table 2.1: Comparison of Home Automation Protocols.................................. 25


Table 2.2: Comparison of Controllers............................................................. 25
Table 2.3: Comparison of modules................................................................. 26
Table 4.1: Comparison of Microcontrollers..................................................... 43

xi

Chapter 1
Introduction

Home automation is predicted to become a boom industry by technology


pundits including Microsoft CEO Bill Gates [1]. Home automation can provide
additional time for recreational pursuits, monetary savings through power
management and peace of mind that valued homes and contents are being
monitored 24 hours a day. For elderly or disabled people home automation
could prove to enhance their quality of life immensely.
At present, there are still few complete integrated systems available
particularly in Australia, which lags behind other countries in development of
this technology.
There is a potential niche for the development of a reliable, cost-effective
fully integrated home automation system.

1.1 What is Home Automation?


By definition, automation refers to:
The automatic operation or control of equipment, a process, or a system without
conscious thought. [2]
Home Automation provides for the centralised control of lights and
electric devices throughout the home.

These devices are controlled by the

occupant or by sensors or timed events. The central controller can also act as
a gateway into the home allowing for remote control and monitoring.

Chapter 1
Automation Benefits Include:
Personal Convenience
Security
Peace of Mind
Energy Efficiency
Although not a new concept, home automation has long been the realm of
electronics enthusiasts and hobbyists or separate proprietary devices that
control individual sections of the home. Only recently has there been a drive by
industry to develop integrated systems with a focus on connectivity of all
household appliances and fixtures. The ultimate goal is to produce Plug n Play
type appliances that connect directly to the home automation network and
register themselves with the host controller without any consumer intervention.

1.2 The Home Automation Maze


At present, according to Home Toys [3], there are 6 open and 5 proprietary
home automation standards all vying to be the leading industry standard.
These standards operate over a variety of communications mediums1. This
confusing array of protocols and mediums has resulted in appliance
manufacturers being loath to commit to developing Plug n Play type products
until it becomes apparent which of the competing standards will eventually win
consumer support.
As a result specialist home automation companies have been
concentrating their efforts on developing automated versions of traditionally
dumb devices such as light switches, power points and sensors as a method
of easing the consumer into the automated world.
These products are primarily targeted at American markets and are
therefore either unavailable in Australia due to non-compatible voltage and
frequency, or are priced at around five to ten times the equivalent American
price.

Chapter 1

1.3 The Auto-MATE Vision


The goal of this project is to engineer a home automation system that would be
suitable for integrating into new and existing homes. The product would have to
satisfy three minimum requirements.

Functionality
The system has to provide features that appeal to the mass market and not only
to enthusiasts.

Ease of Use
The system must be able to be used by a broad range of people.

As a

benchmark a familiarity with Microsoft Windows environment is assumed.

Cost
While cost at the prototype stage is not of paramount concern a light dimmer
that costs $1000 is probably not a feasible product so some budgetary caution
must be observed.

The Auto-MATE vision is then this:


To develop a cheap, reliable, entry level home automation system

In keeping with this vision the final product is expected to consist of a


central controller with some form of remote access such as a telephone or
Internet connection as well as modules for controlling lighting and power loads
typical of those found in an average home. It will include sensors for motion
detection, temperature and humidity. The controller and the modules will have
reliable, two-way communications over the mains power lines. Thus the AutoMATE system will follow a No New Wires policy of implementation.

Possible mediums are Powerlines, Infra-red, Twisted Pair, Radio Frequency, Coax, Fibre Optic

Chapter 1

1.4 Auto-MATE Features


The Auto-MATE vision has been realised over the course of the past nine
months. The details of the design implementation are located in Chapter 4
(Hardware Implementation) and Chapter 5 (Software Implementation). While
full details of the system functionality can be found in Chapter 6 a brief
summary is included below:
Successful adaptation of an existing freeware home automation controller.
Internet access to the system.
Development of a master module to interface the controller to the power
line.
Development of a light dimmer switch with local control and two-way
communication.
Development of a 10A appliance module with local control and two-way
communication.
Development of a climate sensor module with a temperature sensor and
humidity sensor.
Development of a motion detector module.

1.5 Structure and Organisation of this Document


This thesis provides an overview of the design and subsequent implementation
of an integrated home automation system tentatively titled Auto-MATE.
Following this introductory chapter the next section, Chapter 2, explores the
currently available products that are comparable to the desired Auto-MATE
product. From this product review a core set of features common to all home
automation systems is detailed.
Chapter 3 then builds upon this feature set and extends it where
necessary by utilising a top down approach to break the system into
components.

Beginning with the highest level and working down a

comprehensive set of specifications is derived.

Chapter 1
This set of specifications allows for a discussion of the Hardware
implementation in Chapter 4 and the Software implementation in Chapter 5.
Having specified the system and described the implementation it is then
appropriate to describe the status of the project at the end of the thesis period.
As the product has a working prototype it is possible to revisit the original
requirements and provide a comparison with the final working product. This is
presented in Chapter 6.
Chapter 7 provides a design review listing areas of the design that
performed sub-optimally and with hindsight would be changed. Included in this
chapter is a discussion of possible future directions for the Auto-MATE system.
Finally Chapter 8 provides some brief concluding remarks on what may
be considered a successful thesis project.

Chapter 2
Review of Existing
Technologies

Home

Automation

As stated in Chapter 1 there are several communications protocols available.


Of these only a few can utilise the mains power as the physical layer for
transmission.

Further reducing this only four protocols are sufficiently

developed to the point where actual commercial products have been developed.
These are X-10, LonWorks, EHS2 and CEBus3.
This chapter reviews these mains power communications standards as
well as the associated software and hardware products in order to derive a
suitable specification for the proposed Auto-MATE system.

A subset of

available products is presented that is indicative of the range, functionality and


cost of present devices.
The currently available home automation products share some common
attributes. They can all be categorised as one of three distinct sub-systems at
the highest level:
A communications protocol
A central controller/interface
Modules for control or sensing
Each standard and its associated products is evaluated below:-

2
3

European Home Standard


Consumer Electronics Bus

Chapter 2

2.1 X-10
X-10 is the home automation industry incumbent standard [4]. In 1978 Dave
Rye and the design team at Pico Electronics riding high on the success of
projects X-1 to X-94 decided to embark on a home automation project [5]. Their
goal was to develop a system to control lights and appliances over the existing
house power wiring. X-10 was originally designed as a protocol for one way
communications only. Recently a few products with limited two-way capabilities
have become available.

2.1.1 The X-10 Protocol


The transmission method used by X-10 is based on a simple data frame with
eight data bits (one byte) preceded by a predetermined start code. The X-10
binary data is transmitted by sending 1ms bursts of 120kHz just past the zero
crossing of the AC waveform. A binary "1" is defined as the presence of a
pulse, immediately followed by the absence of a pulse. A binary "0" is defined
as the absence of a pulse, immediately followed by the presence of a pulse [6].
The X-10 devices all have a zero voltage-crossing detector built in so the
transmitters and receivers can synchronise.
This is shown in Figure 2.1: X-10 Signal Transmission.

Figure 2.1: X-10 Signal Transmission


4

X-1 to X-8 were calculator ICs, X-9 was an automated record changer.

Chapter 2
The transmitted pulses have a duration of 1ms and the receivers open a
receive window of 0.6ms. The setting of the transmission start point is achieved
by transmitting a sequence beginning with at least 6 leading clear zero
crossings, then a start code of "pulse", "pulse", "pulse", "absence of a pulse" (or
1110). This is shown in Figure 2.2: X-10 Transmission Start Code.

Figure 2.2: X-10 Transmission Start Code

Each device on an X-10 network is described with a house code and a


unit code.

The house code is a 4 bit nibble that is given a letter code

designation from A to P. The unit code is also a nibble with a numerical code
designation from 1 to 16. After the initialisation sequence the house code is
transmitted followed by the unit code.

Once a receiver has processed its

address data, it is ready to receive a command. As before, all data frames must
begin with a start code then the following nibble gives the letter code. The next
nibble is the command. An additional bit, the function bit, is added to the end of
the second nibble to differentiate between unit code and command.

This

function bit takes the value 0 when the second nibble is a unit code and 1
when the second nibble is a command. Since the last bit is the function bit all
the commands end in a binary 1.
All X-10 frames then require a minimum of eleven AC cycles to transmit
one frame consisting of six clear zero voltage crossings, the start code and the

Chapter 2
required two data nibbles.

For purposes of redundancy, reliability and to

accommodate line repeaters, the X-10 protocol calls for every frame of data to
be transmitted twice. In addition whenever the data changes from one address
to another address or from an address to a command or from one command to
another command the data frames must be separated by at least six clear zero
crossings (or "000000"). Therefore the full transmission of an X-10 command
takes 47 AC cycles as shown in Figure 2.3: X-10 Transmission Cycle.

Figure 2.3: X-10 Transmission Cycle

2.1.2 X-10 Products


X-10 is the most established of the home automation protocols and as such it
has the largest product base.
2.1.2.1 ActiveHome
ActiveHome [7] is a PC based home automation program that allows for control
of up to 256 X-10 devices. The devices can be controlled in three ways. The
program has a scheduler that controls devices at preset times, there is a
handheld remote control and devices can be controlled at the computer using a
graphical interface. ActiveHome does not support two way communications so
there is no way of polling the status of a device.
ActiveHome retails for US $133 (No distributor in Australia).

Chapter 2
2.1.2.2 HAL 2000
HAL 2000 [8] is a PC based home automation program similar to ActiveHome.
It too can control 256 devices with one way communications only. HAL 2000
has the ability to be controlled via voice either locally or over a telephone in
addition to preset scheduled control and control at the computer. HAL can
access the Internet to retrieve information such as weather, sports reports etc.
HAL 2000 retails for US $399 ($749 in Australia).
2.1.2.3 HomeSeer
HomeSeer [9] is a PC based home automation program with two way
communication capabilities it incorporates a communication interface that keeps
track of device states when used with devices capable of two way
communications. In addition to scheduling and control of X10 devices from the
computer, HomeSeer offers voice recognition and interaction using Microsoft
Voice Agent, as well as access to X10 devices from the Internet via a web
browser or by using e-mail. HomeSeer allows the user to include scripts written
in Visual Basic or Perl for logic dependant operations.
HomeSeer retails for US $80 (No distributor in Australia).
2.1.2.4 MisterHouse
MisterHouse [10] is a freeware open source home automation that can be run
on a PC under either Windows or Unix. MH is written in the Perl language and
can be extended by the addition of objects and methods. For example, the
following will create an object for a light and turn it on 15 minutes after sunset:

$backyard_light = new X10_Item "C4";


if (time_now "$Time_Sunset + 0:15") {
speak "I just turned the backyard light on at $Time_Now";
set $backyard_light ON;
}

X10_Item, time_now, speak, $Time_xxx, and set are all home automation
related objects, methods, functions, and variables defined in MH.
10

Chapter 2
MisterHouse executes actions based on voice input, scheduling, file data
and serial port data. There is a web interface to allow control and feedback
from any browser on the Internet. MisterHouse has two way communications
with capable devices. It also shares a modem for caller ID and paging, reads
MS Outlook calendars for event reminders as well as reading and writing e-mail,
HTTP5, and FTP6 files unattended.
2.1.2.5 Decorator Dimmer Switch
The Decorator switch [11] (shown in Figure 2.4:
Decorator Dimmer) is available in 110V version only.
It is capable of local and remote control but is limited
to one way communications meaning that a local
change of status is not updated in the controller.
Retails for US $19.99 (No distributor in Australia.)
Figure 2.4: Decorator
Dimmer
2.1.2.6 ActiveHome Two Way Lamp Module
The ActiveHome lamp module [12] (shown in Figure 2.5:
Two way lamp module) has limited two-way control. When
used with a two-way compatible controller the module can
respond to a status request command with an indication as
to whether the module is on or off but not the level of
dimming.

The module is capable of local and remote

control. The device can switch an incandescent load of


300 watts and is available in a 110 volt version only.
Retails for US $32.99 (No distributor in Australia).

5
6

Figure 2.5: TwoWay Lamp Module

Hypertext Transfer Protocol


File Transfer Protocol

11

Chapter 2

2.1.2.7 Power House Three Pin Appliance Module


The Three Pin Appliance Module [13] (shown in Figure 2.6:
Appliance Module) is capable of being turned on and off using
one-way communication and has no local control. The device
can be purchased in 240 and 110 volt versions with the 240
volt version being capable of switching 10 Amps.
Figure 2.6: Appliance
Module

Retails for US $13.99 ($79 in Australia.)

2.1.2.8 The Power House Eagle Eye Motion Sensor


The Eagle Eye [14] (shown in figure 2.7: Eagle Eye
Sensor) sensors motion over a range of 7 meters and
then can transmit a signal to a two-way computer
interface indicating that motion has been detected.
Retails for US $24.99 (No distributor in Australia.)
Figure 2.7: Eagle Eye
Sensor
2.1.2.9 Power House Two-Way Power Line Interface
The Power House interface [15] (shown in
Figure 2.8: Power Line Interface) allows for
two-way communications between a PC
RS2327 port and the power line.
Retails for US $24.99 (No distributor in
Australia.)

Figure 2.8: Power Line Interface

2.1.3 X-10 Summary


X-10 is the most popular and cheapest form of home automation currently
available. In the USA it is estimated that over 100 million X-10 products have
been sold since its inception in 1978 [16]. X-10 requires nearly a second for a
7

Serial Communications Standard

12

Chapter 2
byte to be transmitted in a 50Hz system. In spite of the slow transmission
speed X-10 still suffers from unreliable transmission, as there is no form of error
checking for lost frames from noise or signal collisions. Although some new
devices have two-way communications the command is limited to a simple
status check whereby the device responds that it is either on or off. The X-10
devices then act as slave devices and are not capable of initiating a
transmission when a change of state occurs locally.

2.2 LonWorks
The LonWorks standard was developed by Echelon [17]. The standard consists
of the LonTalk protocol, Neuron chips and LonWorks transceivers. The Neuron
chip is a proprietary device of LonWorks and consists of three resident 8-bit
processors: two processors dedicated to LonTalk protocol processing, and a
third dedicated to the node's application program. The transceivers can only
interface with the Neuron chip which in turn can only be programmed using a
LonWorks proprietary version of the C language known as Neuron C.
Although the standard has been in existence for ten years it was until
October 1999 a closed proprietary standard.

LonWorks has been primarily

used in the automation of buildings and factories and is used extensively in


energy management applications.

Within the last two years Echelon have

made a push into the home automation market.

2.2.1 LonTalk
LonTalk [18] is the communications protocol for the LonWorks system. The
LonTalk protocol design follows the International Standards Organisations
Reference Model for Open Systems Interconnection (ISO OSI), which
prescribes the structure for open communications protocols.

LonTalk

implements all seven layers of this model.

Layer 1: Network Physical Layer


This layer addresses the specifics of wiring and connections.

13

Chapter 2
Layer 2: Data Link Layer
This layer defines the rules of access to the physical layer. Services provided
by this layer include error detection, flexible allocation of bandwidth, priority
access mechanisms, message collision avoidance and collision detection.

Layer 3: Network Layer


This layer specifies the destination of a message on the network. Services
provided by this layer include the node address information. It provides for
routing of messages to control network bandwidth usage as well as determining
which nodes on the network receive various messages.

Layer 4: Transport Layer


This layer establishes the type of services required for the node messages
depending on the level of reliability required by the application. The services
provided are broadcast addressing, acknowledged service, unacknowledged
service, duplicate packet detection and authentication.

Layer 5: Session Layer


This layer provides the communications to request action from another node.

Layer 6: Presentation Layer


This layer provides translation of the network data for the application.
Examples of services provided in this layer include Input, output, and
configuration variables for the node and standard data representations for
physical quantities. The standard data representations are important to assure
interoperability between products from different manufacturers.

Layer 7: Application Layer This layer includes services to simplify development of application programs to
interface to specific sensors, actuators, and external microprocessors.

The LonTalk protocol provides a common applications framework that


ensures interoperability by using network variables and Standard Network
Variable Types (SNVTs) [19].

Network variables communication between


14

Chapter 2
nodes on a network takes place using the network variables that are defined in
each node.

The product developer defines the network variables when the

application program is created as part of the application layer of the protocol.


Some nodes may send a network variable while others may receive. By only
allowing links between inputs and outputs of the same type, network variables
enforce an object-oriented approach to product development.

Whenever a

node program writes a new value into one of its output variables, the new value
is propagated across the network to all nodes with input network variables
connected to that output network variable.
protocol within the Neuron Chip.

This action is handled by the

The user defines the network variable

connections when the nodes are installed on the network. The use of SNVTs
contributes to the interoperability of LONWORKS products from different
manufacturers.

The following are examples of SNVTs:


Variable Type Units
Temperature Degrees Celsius
Relative Humidity Percent
Device State Boolean
Day of Week Enumerated List (Mon-Sun)
LonTalk Network Management Services are a formal part of the LonTalk
protocol. Support for these services is contained in every LonWorks node. This
guarantees that all nodes, regardless of origin, can respond to LonTalk
commands from nodes designed to perform network management functions.
Each node has a 48-bit unique ID assigned during manufacture.
The Neuron Chip is the heart of the LONWORKS technology. Nodes
contain a Neuron Chip to process all LonTalk protocol messages, sense inputs
and manipulate outputs, implement application-specific functions and store
installation-specific parameters. Neuron chips are programmed in Neuron C,
which extends ANSI Standard C to support an object-oriented approach to
developing distributed applications.

15

Chapter 2
Power line transceivers communicate with either a proprietary spread
spectrum or a narrow band technology that provides reliable communications
for up to 2000 meters on a clear line

2.2.2 LonWorks Products


As Echelon are relatively new to the home automation industry there are fewer
devices available. It appears that LonWorks has been used to successfully
develop custom industrial automation systems for several years and the devices
being put forward for home automation use are scaled back versions of these.
2.2.2.1 i.LON 1000 Internet Server Starter Kit
The i.Lon starter kit [20] is available through Echelon and includes network
control software and the PC to mains power interface for mains power
communications. The software includes a web browser for complete control
over the Internet.
Retails for US $1975.00 (No distributor in Australia.)

2.2.2.2 Leviton Dimmer Switch


The Leviton switch [21] (shown in Figure 2.10: Leviton
Dimmer) has local and remote control with full two-way
communications. The switch turns on/off and has dimming
increments of 1%.
Retails for US $75.95 (No distributor in Australia.)

Figure 2.9: Leviton


Dimmer

2.2.2.3 Leviton Occupancy Sensor


The Leviton sensor [22] (shown in Figure 2.11: Leviton
Occupancy Sensor) is capable of sensing motion up to 30
meters away and reporting this back to the host controller.
Retails for US $35.95 (No distributor in Australia.)

Figure 2.10: Leviton


Occupancy Sensor

16

Chapter 2
2.2.2.4 INFINITELAN Single Phase Meter/Controller
The INFINITELAN controller [23] (shown in
Figure 2.12: Infinitelan Controller) allows for
control of loads up to 30 Amps as well as
the monitoring of the power supplied to the
load.

The energy use data can be

transmitted in ASCII format back to the host


controller. This device has no local control.
Retails for US $260.00 (No distributor in
Australia.)

Figure 2.11: Infinitelan Controller

2.2.3 LonWorks Summary


LonWorks is still very much a controlled proprietary technology. Although the
Neuron chips required in all LonWorks modules can be purchased from
manufacturers including Motorola, the development tools such as the Neuron
C compiler must be purchased directly from LonWorks.

The development

tools are expensive.

2.3 CEBus
The CEBus Standard [24] is an open standard, developed and controlled via the
standards processes of the EIA8 and ANSI9. CEBus is designed specifically for
home automation networks and as such all product developments have been
with the home consumer in mind.

Within the EIA the standard has the

designation EIA-600.

2.3.1 The CEBus Protocol


The CEBus standard implements four of the seven layers of the open systems
interconnection (OSI) model of the International Organisation Standardisation
as shown in Figure 2.13: OSI Model [25].

8
9

Electronics Industry Association


American National Standards Institute

17

Chapter 2

Figure 2.12: OSI Model

Layer 1: Network Physical Layer


The physical layer exchanges symbols with the data link layer, encoding and
decoding the symbols to and from the medium states. The states required to
represent the symbols are modulated and demodulated with the medium carrier
by the physical layer.
The CEBus standard defines that there are two different states, superior
and inferior.

The inferior state is defined as the idle state.

To begin a

transmission, the medium starts in the superior state. It then alternates states
for each successive symbol that is transmitted. The length that each state is
transmitted for determines the transmitted signal.

There are four different

symbols, logical one, logical zero, end-of-field and end-of-packet.

The

transmission lengths for different symbols are Logical One 100s, Logical Zero
200s, End-of-Field 300s and End-of-Packet 400s.
For the power line medium the superior state is described as a chirp of
noise. The chirp is defined as a signal that changes frequency from 200kHz to
400kHz, and then 100kHz to 200kHz within the space of 100s. The spreadspectrum chirp is shown in Figure 2.14: Spread Spectrum Chirp.

18

Chapter 2

Fig 2.13: Spread Spectrum Chirp

In order to create the different length states for the different symbols, this
100s chirp is repeated to create the required length symbol.

Finally, the

frequency sweep means that the chirp is spread-spectrum, which gives the
signal better noise resistance. All data in the CEBus protocol is transmitted in
packets with a header and a message. The header contains information on the
type of service being provided as well as source and destination addresses with
the total length being nine bytes. The packet message can be up to 32 bytes
long. Using the spread spectrum technology transmission speeds of 10kbps
are standard with a low error rate especially when used in the address
acknowledged modes.

Layer 2: Data Link Layer


The data link layer is responsible for receiving all of the packet types:
ACK_DATA, UNACK_DATA, ADR_ACK_DATA, and ADR_UNACK_DATA as
well as rejecting duplicate packets of type ACK_DATA, ADR_ACK_DATA, or
ADR_UNACK_DATA.
It allows the node to recognise its own system and node address and the
broadcast address (system and/or node address = 0000).

19

Chapter 2
Layer 3: Network Layer
The network layer is required to generate an ID_Packet when first configured
(addresses installed), upon power-up after being configured, or after system or
unit address changes and generate an ID_Packet if a request for an ID header
is received.

Layer 4: Application Layer


The Application layer contains the Common Application Language CAL. This is
the language by which CEBus devices communicate. The CEBus Application
Language is a set of common language and data constructs created to enable
inter-operation between products used in residential automation. The reasoning
behind CAL is to provide interoperability between different manufacturers
products without prior knowledge of the products.
An easy way to gain a high-level understanding of CAL command syntax
is to view it in terms of object-oriented design. In the world of CEBus devices,
each control within a device may be thought of as an object. For example to
turn up the volume on a radio by three levels, the CAL Control function would
somehow need to deliver a message -- "turn yourself up 3 notches" -- to the
Volume Control Object associated with the radio in question. Upon receiving
the message, the Volume Control Object would add 3 to the value of one of its
instance variables, such as current_volume_level. This action by the object
would then increase the volume of the radio.
CAL bundles one or more of these messages into an Application Layer
Service Data Unit ASDU, and sends it out over the CEBus network. An ASDU
can be sent to one node, a group of nodes, or all nodes on the CEBus network.
Physically, these nodes are associated with particular devices (television,
stereo, VCR, washing machine, light, air conditioner etc.).
CAL Objects are not organised in a class hierarchy. The exact behaviour
of a CAL Object depends on the device context under which it exists. CAL
supports a hierarchy within a device. A device, characterised by its unique Unit
address, is functionally subdivided into contexts.

The Universal Context is

always present and handles device level commands, such as naming, and
addressing. The Universal Context contains instance variables that store node
specifications (manufacturer, model, name, class, etc.) as well as node
20

Chapter 2
variables (such as power on/off and device

online/offline.

As well as the

Universal Context, a device may contain one or more additional contexts.


These other contexts represent functional subsystems within the device. Audio
and Tuning are examples of contexts within a television.

Contexts are

subdivided into objects. Objects represent particular controls or functions within


a context.

Objects are divided into classes which represent common

functionality. For example, an object class 07 (Analog Control Object) may be


used to represent a volume control, a thermostat, or a light dimmer. The exact
function of an object is solely dependent on the context in which the object is
instantiated.
Contexts other than the Universal Context fall under the heading of
Operation Group Contexts. These contexts represent functional subsystems of
consumer devices. Examples of Operation Group Contexts are Audio Context,
Lighting Context, Security Zone Context, and Environmental Zone Context.
Each context specification consists of the name of the context and its ID
number used to address the context within the product. A general description of
the context is given along with possible applications of the context. The objects
that could make up the context are then listed. Not all objects listed in a context
need be provided in a particular implementation of a product.
Each device on a CEBus network has its own address consisting of a
house code and a device address each of which have 64 thousand (216)
addresses.

2.3.2 CEBus Products


As CEBus is a protocol specifically targeted at home automation the developed
products are designed with the home consumer in mind.

The most

comprehensive range of products developed for the CEBus protocol is the


SmartGear range by GE-Smart [26]. This range is expected to be available in
the USA in the fourth quarter of 2000. Initially the devices will only be for 110
volt systems.

21

Chapter 2
2.3.2.1 GE-Smart Manager Plus
The Manager Plus [27] (shown in Figure 2.15:
Manager Plus) is a stand alone programmable
control panel.

Devices connected to the network

can be monitored and controlled using an LCD


display and a menu driven interface. The controller
allows for scheduled events as well as inputs from
sensors

such

as

temperature

and

motion

Figure 2.14: Manager Plus

detection. A separate RF remote provides control


from up to 30 meters away.
Expected retail price US $900.

2.3.2.2 GE-Smart Smart Switch


The Smart Switch [28] (shown in Figure 2.16: Smart
Switch) is capable of turning on/off up to 500W of load
with dimming functionality.

The switch can be

controlled locally or remotely over the home network.


The output state can be queried via the network by the
host controller.
Expected retail price US $175.

Figure 2.15:
Smart Switch

2.3.2.3 GE-Smart Appliance Port


The Appliance Port [29] (Shown in Figure 2.17:
Appliance Port) plugs into the existing mains power
point and an appliance such as a coffee maker or radio
can be plugged into it. The port can supply a load of
20 Amps on a 110 volt supply. The port can be turned
on/off locally and remotely by the controller.
Figure 2.16:
Appliance Port

22

Chapter 2
2.3.2.4 GE-Smart Sensor Port
The Sensor Port [30] (shown in Figure 2.18: Sensor
Port) interfaces between sensors such as motion
detectors, light or temperature sensors that have a
digital or analog output and the mains power line.
The data is then available to the central controller via
the network.
Figure 2.17: Sensor
Port

2.3.3 CEBus Summary


The CEBus protocol and associated products are well placed to be the front
runners in the home automation industry in terms of functionality and range.
CEBus products are unavailable in Australia at present.

2.4 European Home Standard


The European Home Standard [31] is the European equivalent of the American
CEBus Standard. EHS is an open technology and development requires only a
modem chip and a microcontroller. EHS is behind the other standards reviewed
in terms of product development.

2.4.1 The EHS Protocol


EHS specifies a network protocol that covers layers 1, 2, 3 and 7 of the OSI
reference model. It also specifies a Network Management section and uses a
spread spectrum chirp to transmit the data [32].
The protocol supports several media: power-line, coaxial cable, twisted
pair, infrared and radio frequency. Initial efforts have been focused on the
power-line medium at 2400 bits/sec.

2.4.2 EHS Products


As stated earlier EHS lags competing standards. The only product available for
comparison is the ST7 Development Board (shown in Figure 2.19: EHS

23

Chapter 2
Development Board) manufactured by Trialog [33].

This board enables

communications over the power line between two ST7 development boards
when connected to a host microcontroller.

Figure 2.18: EHS Development Board

2.4.3 EHS Summary


EHS is several years behind other standards at present and is unlikely to be a
dominant force in home automation without the support of a product
manufacturer.

2.5 Review Summary


In this chapter a subset of available home automation protocols and products
were reviewed. From this review it is possible to identify a set of minimum
products and functionality necessary to provide a useful home automation
system for entry level consumers. The three sub-systems of protocol, controller
and modules are each summarised in table 2.1, 2.2 and 2.3 respectively. From
these tables the following minimum set of desired features has been identified:

24

Chapter 2
Two way data transmission at an acceptable speed with error and collision
checking.
Scheduled and sensor triggered events.
Internet connectivity allowing remote control and monitoring.
Light switch/dimmer module.
Appliance module.
Motion detector module.
Climate sensor module.
Modules with full two-way communications and local control were applicable.
The derived list of features represents only a small subset of the possibilities
for a home automation system.

It is however sufficient for an entry-level

system. From these features a specification for the proposed Auto-MATE home
automation system can be formalised. The complete specification is presented
in Chapter 3.

Protocol

Baud Rate

error
detection

collision
detection

Noise
immunity

Proprietry
software
required?

Number of
possible
addresses

X-10
LonWorks
CEBus

10bps
10kbps
10kbps

no
yes
yes

no
yes
yes

poor
good
good

yes
yes
no

256
64k
64k

EHS

2.4kbps

yes

yes

good

no

64k

Table 2.1: Comparison of Home Automation Protocols

Protocol

Product

2-Way

X-10
Active Home
X-10
HAL 2000
X-10
Home Seer
X-10
Mister House
LonWorks
i.Lon
CEBus Smart Manager

no
no
yes
yes
yes
yes

Internet
Connectivity
no
yes
yes
yes
yes
no

Event
Scheduling

Voice
Control

yes
yes
yes
yes
yes
yes

no
yes
yes
yes
no
no

Hand Cost $US


Held
Remote
yes
$133.00
no
$399.00
no
$80.00
no
Freeware
no
$1,975.00
yes
$900.00

Table 2.2: Comparison of Controllers

25

Chapter 2

Protocol
X-10
X-10

Device

Local
Control
yes

Cost $US

yes

$32.99

no

no

$13.99

n/a

n/a

$24.99

yes

n/a

$24.99

yes

yes

$75.95

n/a

n/a

$35.95

yes

no

$260.00

GE Smart
Switch
GE Appliance
Port

yes

yes

$175.00

yes

yes

unavailable

GE Sensor
Port

yes

yes

unavailable

no
Decorator
Dimmer
Lamp Module limited

X-10

Appliance
Module
X-10
Eagle Eye
Motion
Detector
X-10
Powerline
Interface
LonWorks
Leviton
Dimmer
LonWorks
Leviton
Occupancy
Sensor
LonWorks INFINITELAN
30A controller
CEBus
CEBus

CEBus

2-Way

$19.99

Table 2.3: Comparison of modules

26

Chapter 3
System Design Specifications
Having reviewed the current state of the home automation market it is now
possible to specify the requirements for a new, low cost, reliable, entry level
home automation system to satisfy the vision statement in Chapter 1.

An

overview of the complete system requirements will be presented before


detailing the specifications for each of the sub-sections as listed in Chapter 1.
At each juncture the emphasis will be on satisfying the core functionality derived
from the technology review of Chapter 2.
The specifications developed in this chapter will be sufficiently detailed to
allow for the subsequent design of the hardware and software components in
chapters five and six.

3.1 The Auto-MATE System


The Auto-MATE system is intended as a low cost, entry level product. This
means that the system will have the minimum functionality necessary to be a
useful integrated home automation system.

From the previous chapter the

minimum specifications for the complete system are:


Reliable two-way mains power communications at an acceptable speed with
minimum transmission errors.
Controller for monitoring system status and handling timed and sensor
triggered events.
Remote control and monitoring of the system using a web interface and email messages.
Control and sensor modules with local control and load sensing intelligence
where applicable.
27

Chapter 3

This minimum set of specifications leads to the block diagram of Figure 3.1:
Auto-MATE Block Diagram.

Figure 3.1: Auto-MATE Block Diagram

In addition to fulfilling the desired functionality the system must also adhere to a
set of design criteria as set out below.

3.2 Design Criteria


The following criteria are necessary to ensure the Auto-MATE system is a
desirable product and does not become quickly redundant.

Functionality
The system has to provide a level of functionality that appeals to the mass
market and not only to enthusiasts. To ensure this the Auto-MATE system is
initially limited to automating only devices that are common to most homes.

Ease of Use
The system must be able to be used by a broad range of people. There is
however a limit on the minimum level of complexity possible in an automated

28

Chapter 3
product. A testament to this is the number of programmable VCRs around the
world flashing 12:00. As a benchmark a familiarity with Microsoft Windows
environment is assumed.

Cost
While cost at the prototype stage is not of paramount concern some budgetary
caution must be observed if the product is to be feasible in the long term. The
present cost of an X-10 appliance module in Australia is $79 ($AUS). The
equivalent Auto-MATE module is expected to have superior features so an
initial prototype cost of twice the X-10 cost seems reasonable.

3.3 System Topology


The basic premise of a home automation system is that the automated devices
be linked together so that the action of one device may be dependent on the
state or action of one or more other devices. The interconnection of similar
devices is commonly referred to as a network.
There are three possible network topologys to be considered, these are
Star, Ring and Bus. In Australia power and lighting circuits are radial wired
which precludes the use of a ring network. The use of a Bus would be an
interesting method of control as each module would need to be intelligent
enough to know what other modules require the information they have as well
as being able to know which node can use the network at any time. The use of
a Bus would however prevent any direct control by the home occupant as well
as being unable to provide a gateway into the home for the purposes of external
control and monitoring. The final topology considered then is the Star. This
type of network is predominant in existing home automation systems and is the
preferred network for the Auto-MATE system. With a Star network (shown in
Figure 3.2: Star Topology) all attached modules are controlled by a central
controller. The advantage of a Star system is that nodes can be added or
removed or malfunction at any time without affecting the network.

29

Chapter 3

Figure 3.2: Star Topology

Having derived the system topology to be a star network in this section it is


necessary to now specify the requirements for each of the Auto-MATE subsystems.

3.4 Central Controller


The central controller is responsible for monitoring and updating the status of
each connected device. In keeping with the design criteria the controller must
provide a user friendly interface to the system. The central controller also
requires an interface to the power lines to enable the mains power
communications.

3.4.1 Controller Platform


From the product review of Chapter 2 it can be seen that the most popular
platform for developers of home automation systems is a PC.

The only

competitor to the PC based controllers at present is the stand alone controller


such as the GE-Smart Manager.
The choice of a suitable platform for the system controller is dependent
on a wide range of variables such as useability, reliability, cost and extensibility.
The continuing prevalence of Personal Computers in homes makes them an
ideal choice as they can satisfy the useability, cost and extensibility
requirements. The additional cost can be limited to the required software and

30

Chapter 3
the interface module to the power line. Adapting an already familiar device
satisfies the useability requirement and a PC iof capable of being extended with
peripheral devices as needed.
The reliability issue is less easily satisfied with the selection of a PC as
the controller platform. The reliability of a PC suffers from software crashes and
power failures. The software crashes can be limited by the use of a dedicated
PC used only for the home automation system. A back up power supply such
as an UPS10 would be required to keep the system running during power
outages. Both of these solutions would add to the overall cost of the system
[34]. As the Auto-MATE system is not intended to control sensitive applications
such as fire alarms the use of a shared PC is acceptable.

3.4.2 Modes of Control


The use of a PC as the central controller allows for several modes of control.
From the product comparison the most useful modes of control are local control
at the computer, remote access to the system via the Internet and control from
within the home using voice commands. A GUI11 should be provided to allow
an easy to use interface between the occupant and the Auto-MATE system.
The controller must initiate events based on time scheduled commands or as a
result of inputs from sensor modules.

3.4.3 Additional Services


In addition to the modes of control the central controller can perform other
services to enhance the performance of the automation system. If the system is
to be connected to the Internet for the purposes of remote control the same
connection can be utilised for additional purposes. The Auto-MATE system will
include the ability to retrieve information from the Internet. Such information
may include, but is not limited to, weather reports, sports information and
television guides.

This information can then be presented to the home

occupant or used by the controller to make decisions such as turning on a


module that controls an irrigation system.
10

Uninterruptable Power Supply

31

Chapter 3

3.4.4 PC to Power Line Interface


The selection of a PC as the controller platform requires that a dedicated
module must be included into the design to provide a seamless interface
between the computer and the power line. This interface should be able to
connect directly to the computer using an existing IO12 port as well as
connecting to the power line. This connection should appear transparent to the
end user.

3.5 Mains Power Communications


The mains power communications is an integral component of the automation
system. Some existing systems suffer from unreliable, slow communications. It
is unlikely that a home automation system would become a widespread product
with such problems.

3.5.1 Reliability
Reliability is probably the most important criteria for an automation system of
any description. The communications protocol must provide error checking for
transmissions with automatic retries on unsuccessful attempts. As the power
line is a noisy environment the transmitted signal should be either spread
spectrum or multi-channel to maximise successful transmissions.

3.5.2 Baud Rate


Although most home automation applications are not time critical the
transmission rate should be the maximum possible to allow for possible future
extensions to the home network. At present the best transmission rates are in
the vicinity of 10kbps [35] so this is the specified rate for the proposed AutoMATE system.

11
12

Graphical User Interface


Inout/Output

32

Chapter 3

3.5.3 Transmission Distance


According to the AS30013 [36] the maximum distance for a lighting or power
sub-circuit in a residential installation is 50 meters. Therefore allowing for the
central controller and a module to be at the furthest extremities of different
circuits the maximum transmission distance would be 100 meters. Therefore
this distance is the minimum specification for the Auto-MATE system.

3.5.4 Network Communications IC


The mains power communications is not possible without the use of a dedicated
network communications chip.

The chip selected must fulfil the following

functionality:
Application programmable or allow connection to a host microcontroller.
Support the power line as the Physical Layer.
Provide for automatic retries of unsuccessful transmissions.
Capable of transmission rates of at least 10kbps.

3.5.5 Microcontroller
A microcontroller will be required for the purposes of responding to received
commands as well as initiating data transmissions back to the central controller.
The microcontroller may be a host device or embedded in the network
communications chip depending on the hardware implementation.

The

microcontroller will need to comply with the subsequent minimum feature set:
8 bit registers
UART serial communications interface
Two external interrupt pins
Analog to digital converter
8 bit timer
20 IO pins

13

Australian Standard 3000 specifies the rules for wiring in Australian installations

33

Chapter 3
Sufficient memory for protocol implementation and device control code
written in a procedural language such as C.

3.6 Intelligent Modules


The level of intelligence of the reviewed products varies from devices that can
simply turn on/off when a command is received to devices with full two way
communications and power measurement capabilities.

The Auto-MATE

modules are intended to provide features comparable to existing products.

3.6.1 Minimum Functionality


The modules must have full two-way communications. By this it is meant that
the modules can respond to commands sent to them as well as initiating
communications when the status is changed locally. When a command is sent
from the central controller the receiving module must respond acknowledging
that the command has been successfully performed. Each device must have a
unique address as well as a group address to enable commands such as all
lights off. The product review of Chapter two identified the minimum sub-set of
possible devices for an entry-level system to be functional.

The individual

specifications for each of these devices is detailed below:

3.6.2 Light Switch / Dimmer


The light switch must be rated to control a 240 Volt, 10 Amp load. The switch
needs to be capable of turning the load on/off as well as dimming to any one of
ten levels. The switch must be controlled by the central controller as well as
locally at the switch. The switch should default to a safe off state after a power
down reset.

3.6.3 Appliance Module


The appliance module is intended to mimic the functionality of the light switch
module without the dimming capability.

34

Chapter 3

3.6.4 Motion Detector


The motion detector module should sense motion from a distance of at least 10
meters. When motion is detected the central controller should be alerted. The
detector should be able to be activated and deactivated remotely.

3.6.5 Climate Sensor


The climate sensor is intended to provide useful information about the local
conditions within the home.

This will enable the central controller to make

decisions such as controlling heating and cooling devices. When requested the
sensor should provide a temperature and a humidity reading with reasonable
accuracy.

3.6.6 Load Sensing


Most of the home automation devices available do not provide any means of
sensing whether the load has actually been turned on or off. For a device to be
considered intelligent it is not sufficient that it simply switches the load and then
reports back that the task has been performed it must also ensure that the load
is in fact on. As an example the light switch may turn on but if the bulb has
blown the command was not successful. For this reason it is necessary to
include some load sensing hardware into the light and appliance modules.

3.7 Summary of Design Specifications


In this chapter the specifications for each subsection of the proposed system
have been derived. The specifications have been developed to comply with the
both the required functionality and the outlined design criteria.

With the

proposed product now specified it is possible to detail the design and


implementation of the final Auto-MATE product. The hardware implementation
is presented in Chapter 4 and the software implementation in Chapter 5.

35

Chapter 4
Hardware Implementation
With a set of design specifications now in place the hardware implementation
can be detailed. The hardware design can be divided into several sub-systems
at the lowest level. These sub-systems are first identified and then the actual
implementation is described as the chapter progresses. Each of the hardware
modules for the Auto-MATE system is made up of these building blocks. The
full hardware schematics and PCB layouts are included as Appendix A.

4.1 Overview of Hardware Requirements


The hardware sub-systems required for implementing all of the proposed AutoMATE modules are as follows:

1)

Mains Power Network Communications circuit.

2)

Load switching circuit

3)

Load sensing circuit

4)

Zero voltage crossing circuit

5)

Power supply circuit

6)

Local control buttons circuit

7)

Host microcontroller

8)

Temperature sensor circuit

9)

Humidity sensing circuit

10) Motion detector circuit

36

Chapter 4

With these ten hardware blocks all of the proposed features of the Auto-MATE
system modules can be implemented. The only exception is the PC / power
line interface module that will be discussed separately.

4.1.1 Physical Orientation of Subsystems


Although not all modules require all of the hardware blocks it was decided early
in the implementation process to build generic printed circuit boards capable of
being implemented as any one of the required modules. The hardware blocks
are separated into being either power or control blocks and are incorporated
onto one of two printed circuit boards depending on this designation.

The

CEBus Power Module (shown in Figure 4.2: CEBus Power Module) consists of
sub-systems 1 4. The remaining circuitry is located on the CEBus Control
Module (shown in Figure 4.1: CEBus Control Module).

Figure 4.1: CEBus Control Board

Figure 4.2: CEBus Power Board

A block diagram of the hardware is shown in Figure 4.3: Hardware Block


Diagram.

37

Chapter 4
Auto-MATE
Control Module

Power
Line

Power Board

Control Board

CEBus Powerline
Coupling

Microcontroller

5V & 15V Power


Supply

Local Control
Buttons

Load Switching

Motion Detector

Zero Voltage
Crossing
Detection

Temperature
Sensor

Load Sensing

Humidity Sensor

Controlled
Device

Figure 4.3: Hardware Block Diagram.

4.2 Mains Power Communications


The mains power communications component is an integral section of this
thesis project.

As set out in section 3.5 of the specifications the

communications must be inherently reliable and reasonably fast.

From the

product review of Chapter 2 the possible choices are LonWorks, CEBus or


EHS. Of these three the chosen protocol was CEBus. This implementation
decision was due to the fact that CEBus is a completely open standard and
therefore requires no proprietary development tools. CEBus has the edge over
EHS in terms of available literature and the fact that it has already been proven
in product development. To implement the CEBus protocol using the mains
power lines as the physical layer requires two components.

The first is a

CEBus compliant Network Interface Transceiver and its necessary signal


isolation circuitry.

The second is a host microcontroller to implement

transmitted commands and data.

4.2.1 Network Communications Transceiver IC


The selection of CEBus as the protocol for the mains power communications
enables the implementation to progress to the selection of a suitable network
communications chip. Three CEBus transceiver ICs were considered. These

38

Chapter 4
were the SSC P300 PL Network Interface IC from Intellon Corporation [37], the
IT800 Power Line Modem from Itran Communications [38] and the CEWay PL111 Power Line Communication Transceiver from Domosys Corporation [39].
The Itran product was quickly disregarded as it does not become available until
the fourth quarter of 2000.
The initial selection was the Intellon SSC P300.

This selection was

based solely on availability as an evaluation kit for this chip had been
purchased the previous year for another thesis project [40]. Attempts over a six
week period to communicate over the power lines using the P300 proved
remarkably unsuccessful.

The following sections detail the difficulties

encountered with the use of the P300 and the successful implementation of its
successor the CEWay PL-111.
4.2.1.1 The Intellon SSC P300
The evaluation kit contains two EK P300 development boards (shown in Figure
4.3: EK P300 Development Board) and allows for an interface to the power line
through supplied plug packs.

Figure 4.4: EK P300 Development Board

The development board requires connection to a host microcontroller to


initialise the P300 chip and process the data to and from the chip. The P300

39

Chapter 4
communicates to the host microcontroller using the SPI14.

The host

microcontroller and the network interface controller have a master/slave


relationship. The NIC15 can not send data to the host until commanded to do
so. The NIC can only request service from a host via an interrupt line. The host
must respond to the interrupt request with a command that allows the chip to
return its data. Commands from the host allow the host to read or write the
internal registers of the NIC [41]. When the P300 chip is first powered up or
after a power down reset it is required that the host microcontroller initialise the
Layer_Config_Info data structure. This data structure consists of 7 bytes and
includes such information as the device address. This register is written to by
first sending a Layer Management Write command (0x03) followed by the seven
data bytes. After each data byte has been successfully received by the NIC it
will generate another interrupt to the host which will then send through the next
byte [42]. This process is shown graphically in Figure 4.5: Flow Chart of P300
Initialisation.

Figure 4.5: Flow Chart of P300 Initialisation

14
15

Serial Peripheral Interface


Network Interface Controller

40

Chapter 4
Difficulties were encountered when attempting to perform this initialisation
routine. It seemed that the required interrupt was not generated by the NIC
every time that a byte was transferred serially from the host microcontroller to
the P300.

On some occasions all seven data bytes were transmitted

successfully but most often they were not.

This in turn meant that the

microcontroller had no means of knowing when to send the next byte. Attempts
to isolate the problem using a digital oscilloscope and logic analyser seemed to
indicate that the correct signals were on all of the pins and the failure lay with
the Intellon chip.

Technical assistance was sought from the Engineers at

Intellon and screen captures of the generated signals were e-mailed to them but
they were unable to explain the lack of interrupts.

A query posted to the

comp.home.automation newsgroup provided no solution but it did provoke a


thread dedicated to the unreliability of the Intellon product. Without being able
to even initialise the P300 chip there seemed little else to do than move on to
another product!

4.2.1.2 CEWay PL-111


Having dispensed with the P300 the next (and
preferred) product was the CEWay PL-111.
This is a power line communications transceiver
that implements the CEBus physical and data
link layers.

The CEWay PL-111 includes a

proprietary DSP16 for superior performance in


noisy environments. The PL-111 is available in
a pre-mounted package that includes the
necessary amplification and filtering circuitry for
the CEBus spread spectrum chirp to be
transmitted and received.

The pre-mounted

package is labelled the DomoSIP Power Line


Interface (shown in Figure 4.6: DomoSIP).
Figure 4.6: DomoSIP

16

Digital Signals Processor

41

Chapter 4
The DomoSIP has a twenty pin SIP17 connector which can be simply plugged
into a matching socket to interface with the Auto-MATE PCB.
DomoSIP package necessitates the use of a host microcontroller to
implement the Auto-MATE modules. The DomoSIP board requires a 5 volt and
a 15 volt supply and it communicates to the host using the serial UART18
interface. The DomoSIP still requires additional circuitry to interface with the
power lines. This circuit is discussed next.
4.2.1.3 Peripheral CEBus Circuitry
Domosys provide the circuit schematic for the interface between the power line
and the DomoSIP board.

This circuit was successfully implemented.

The

circuit consists of a CEBus 12/12 turn transformer 100-400 kHz supplied by


General Magnetic Technologies, a high pass filter formed by R1 and C1 and on
either side of the transformer is a transient voltage surge suppressor indicated
by V1 and V2.

The circuit schematic is included in Appendix A: Circuit

Schematics.

4.3

Microcontroller Selection

The selection of the DomoSIP board means that a host microcontroller is


necessary. A number of possible 8-bit devices were considered. The required
features were outlined in the previous chapter but in terms of hardware
development two additional requirements are availability and ease of
implementation. Considered microcontrollers were
Motorola 68HC11
PIC 16F871
ATMEL 90S4414
ATMEL 90S8535
The comparison of features and cost is presented in table 4.1: Comparison of
Microcontrollers.
17
18

Single Inline Package


Universal Asynchronous Receiver Transmitter

42

Chapter 4

MCU
68HC11
16F871
90S4414
90S8535

Program
Ext
EEPROM RAM
IO pins
memory
Interrupts
512 bytes
none
128
1
40
4k bytes
128
128
1
32
4k bytes
256
256
2
40
8k bytes
512
512
2
40

A/D
Converter
8-bit
10-bit
none
10-bit

UART

Cost

yes
yes
yes
yes

$28
$20
$7
$9

Table 4.1: Comparison of Microcontrollers

Of the reviewed microcontrollers the two ATMEL products had the


greatest range of features for the least cost and were available immediately.
The 4414 is ideal for use on the PC / power line interface circuit as this requires
less code and does not need an analogue to digital converter for the
implementation. The 8535 is suitable for the module development and excellent
development resources are available for the ATMEL products in terms of
product data and software compilers [43].

4.4 Load Control


As the Auto-MATE modules are designed to replace existing light switches and
power points within the home they must be capable of switching the loads that
are commonly connected in homes. All Australian homes use switches and
GPOs19 that are rated to a minimum of 10 Amps. Therefore a circuit capable of
switching this load and being controlled by the output of the host microcontroller
is required.

For the purposes of light dimming the commonly used phase

control technique is utilised. For this method the load is switched on at varying
points in the AC waveform depending on the level of current and voltage
required. The time that the load is switched depends on a software delay. The
software requires a reference input corresponding to the zero voltage crossing
of the waveform. This is discussed next.

4.4.1 Zero Voltage Crossing Detection


This circuit was implemented using a Sharp PC814 AC input photocoupler. The
input is connected via a resistor to the AC supply and the output stage of the
19

General Purpose Outlet

43

Chapter 4
coupler is connected to a 5 volt supply and a pull down resistor. During the
period when the AC waveform passes through 0.7 to 0.7 volts the output stage
does not conduct and an external interrupt on the microcontroller is pulled low.

4.4.2 Load Switching


The switching of the 10 Amp load is facilitated by the use of a BTA 16 600B
Triac. The Triac is fired by a micro controller output pin through a MOC3041
Optoisolated Triac Driver. A snubber circuit consisting of a 100 Ohm resistor
and a 0.1 F capacitor enables the switching of inductive loads without damage
to the Triac.

4.5 Load Sensing


The load sensing functionality was included to add an element of intelligence to
the Auto-MATE design. The goal was not to provide a power measurement but
to simply give an indication of whether the load was connected. This circuit was
implemented by placing two power diodes in series with the connected load.
This provides a 1.4 volt drop across the diodes while current is conducting
through the load. A series combination of a Sharp PC814 photocoupler and a
100 Ohm resistor is placed in parallel with the diodes. While the current is
conducting the output stage of the 814 is conducting and a microcontroller pin is
held high.

4.6 Local Control Buttons


The Auto-MATE modules that are used for controlling lights and appliance loads
require local control at the switch or outlet. This was implemented simply using
a pushbutton for each operation (these being on, off, increment & decrement).
Each pushbutton is connected to an input pin of the microcontroller as well as
an input pin to a 74HCT02 CMOS NOR gate. The output of the NOR gate
generates an external interrupt on the host microcontroller then differentiating
between buttons is performed in software.

44

Chapter 4

4.7 Power Supplies


The Auto-MATE boards require a 5 volt and a 15 volt rail. These voltages are
supplied from a 240:18 volt transformer through a rectifier and then regulated
using a MC7805 and a MC7815 regulator respectively.

4.8 Temperature Sensing Circuit


As a feature of the Auto-MATE system a temperature sensing module allows for
control of climate sensitive devices to be activated or deactivated.

The

temperature sensor selection was based on cost. The most economical sensor
available was the LMM 355 National Semiconductor [44]. This device produces
as linear change in output voltage for a change in temperature and has an
accuracy of 1 degree.

The output of this sensor is connects to the A/D

converter input of the microcontroller.

4.9 Humidity Sensing Circuit


The humidity sensor selection was also based on cost. The chosen sensor was
the HU10 from Thermometrics [45].

This sensor provides a linear voltage

output with changes in humidity between 20 and 100 percent.

4.10 Motion Detector Circuit


A motion detector provides an extra dimension to the Auto-MATE system. It
provides an indication to the central controller that an area is occupied. This
has potential uses such as security monitoring and load shedding in unoccupied
rooms. Motion detectors are commonly found in homes controlling individual
external lights.

The Auto-MATE implementation of a motion detector is an

adaptation of a standard product. PIR20 sensors can be purchased that are


connected to the 240 volt power supply and 240 volts is available on a switch
wire when motion is detected. The switch wire is usually connected directly to
the controlled load.

In the Auto-MATE implementation the switch wire is

connected via a resistor to the AC input of a PC814 photocoupler. The output

45

Chapter 4
of the PC814 is connected to a microcontroller interrupt input, which is then
pulled low when motion is detected.

4.11 Three Phase Signal Coupling


Although very few domestic abodes in Australia are connected to a three phase
supply it was considered a useful experiment to attempt to couple the CEBus
signal across the three phases. To do this a simple capacitor coupling circuit
was designed with X-1 rated surge suppression capacitors.

A calculated

capacitance value of 235nF was connected across the 415 volt phase voltage.
This provided an impedance of 13.5k Ohms at the 50Hz supply frequency and
an impedance ranging from 6.8 Ohms to 1.7 Ohms for the spread spectrum
CEBus signal.

4.12 Remote Voice Activation


A desired specification for the Auto-MATE required voice activated control of
the system. Several methods were considered to implement this feature in
hardware.

Ceiling mounted speakers throughout the house were thought

impractical as the voice commands could not be successfully transmitted over


the powerlines with the specified data rate. It would therefore be necessary to
run new wires to each speaker which is not in keeping with the desired policy of
no new wires. The selected method for at least demonstration purposes was
handheld UHF21 transceivers from Digitor.

These transceivers have

speaker/microphone input/output ports that can connect straight into the sound
card ports on the PC thus enabling two way voice communications.

4.13 PC Power Line Interface


As stated earlier in the chapter all of the Auto-MATE modules for sensing and
control consist of the outlined hardware blocks. The power line interface is
slightly different. It still requires the voltage supplies and CEBus signal coupler
on the power board but the control board is not used. Instead a separate PCB
20
21

Passive Infra-Red
Ultra High Frequency

46

Chapter 4
was designed specific to the requirements for the interface to the power line.
From the PC communications are via a serial communications port which is
connected to a MAX232 transceiver chip to communicate to the ATMEL 4414
microcontroller UART. At this juncture a design decision had to be made with
regards to the communications with the DomoSIP network chip that also
requires the UART connection.

Possible choices were to change the chip

selection to one that includes two UART interfaces, connection of a separate


UART IC that interfaces with the SPI port of the 4414 or the use of a second
microcontroller to talk to the first one via the SPI and then to the DomoSIP using
the UART connection. The latter was selected as a simple option with the
lowest cost.

4.14 Hardware Design Summary


This chapter has detailed the implementation of all of the hardware subsections
required to implement the various specified modules for the Auto-MATE system.
The accompanying circuit schematics and PCB layouts are included in
Appendix A. Where appropriate, design decisions have been explained and
circuit functionality has been described. It is now appropriate to discuss the
software implementation of the system in order to complete the design
implementation section. This discussion is presented next in Chapter 5.

47

Chapter 5
Software Implementation
This chapter discusses the software implementation for the Auto-MATE system.
The software development consists of several layers which must integrate
seamlessly to ensure system reliability.

5.1 Overview of Software Requirements


The software implementation is quite heavily dependent upon the hardware
selection detailed in chapter 4. The software can be broken into three distinct
components. These being:
Central Controller Software
Communications Software
Specific Application Software
The communications software is specific to the Domosys CEWay PL-111
NIC.

The selection of ATMEL microcontrollers, with their larger program

storage, as the host chip allows for the communications and application layer
code to be implemented in the C programming language.
The CodeVisionAVR [46] cross compiler was used as the development
environment for the microcontroller software.

This compiler has extensive

features and support for the low cost of US $150.


The software developed for the Auto-MATE system must enable the
system to conform to the specifications and criteria set out in Chapter 3. The
software has been written to conform to the CEBus EIA-600 standard.

48

Chapter 5

A complete listing of the source code is included as Appendix B: AutoMATE Source Code
The implementation for each particular software component is presented
below.

5.2 Central Controller Software


In order to facilitate the development of this project within the time frame
afforded to an undergraduate thesis it was decided to adapt an existing home
automation program rather than attempt to design one from scratch.
MisterHouse is a Perl based freeware home automation program developed to
control X-10 devices. The adaptation of MisterHouse to control CEBus devices
was approved and heartedly encouraged by the programs author Mr Bruce
Winters. MisterHouse implements all of the specified features required of the
central controller. The adaptation of the code to run the CEBus Auto-MATE
system is outlined next.

5.2.1 CEBus Conformance


In order for the Auto-MATE system to be fully compliant to the EIA-600 it must
implement a minimum set of CAL methods.

The software implementation

required for a successful demonstration of the working system necessitates only


a sub-set of these methods. Therefore the Auto-MATE system is not eligible for
certification to the EIA-600 standard.

5.2.2 The Common Application Language


The Common Application Language specifies an order for the arrangement of
the data bytes within a data packet. The MisterHouse program must therefore
ensure that when a command is received at the central controller it outputs the
data in the correct order to the mains power interface. Each command that
MisterHouse recognises is mapped to a corresponding array. The MisterHouse
program transmits the data held in the array through the serial port to the host
microcontroller in the mains power line interface module.

49

Chapter 5
The first nine bytes are the packet header consisting of the transmission
mode and then eight address bytes for the house and unit codes of the
transmitting and receiving modules.
Following the header are the data bytes in the following format:

<Context><Object><Method><Instance Variable>

This allows the receiving module to perform the command as requested.


When a packet is received back to the central controller, either through a
confirmation of a command execution or an update of a local change of status,
the data is unpacked in the interface module and sent through to the
MisterHouse program where the Instance Variable is updated.

5.2.3 Internet Connectivity


The MisterHouse program allows for connection to the Internet and for control
and monitoring of the system via a web browser.

5.2.4 Speech Recognition


The MisterHouse program incorporates a Microsoft Speech Engine which
allows for voice control and spoken response via the sound card ports of a PC.

5.3 Communications Software


The communications software is responsible for the reception and transmission
of data between the CEWay PL-111 and the host processor. It provides a
transparent interface between the application layer software and the physical
medium of the power line. The software is required to perform the following
functions [47]:
Initialisation of the CEWay PL-111 chip
Transmission of a frame
Reception of a frame
Monitoring the PL-111 status

50

Chapter 5

The communications software requires adherence to the CEWay Host


protocol as specified by Domosys. This protocol can then be used to implement
the communications layer between the application layer and the physical
network layer.
An overview of the communications protocol is presented next followed by a
discussion of the actual software implementation.

5.3.1 Communications Protocol


The serial communications between the host microcontroller and the CEWay
chip is at the specified rate of 19200 baud.
The messages transmitted and received between the CEWay PL-111
and the host must conform to the following format [48]:

<start><primitive type><primitive ID byte><number of data bytes><data><checksum>

Start: The start character (0x10) is always used to begin a message


Primitive type: The primitive type can be either an input or an output primitive.
Inputs allow communications from the host processor to the PL-111 and can be
either data requests (Primitive type = 0x01) or LSM22 requests (Primitive type =
0x02). Outputs allow communications in the reverse direction and can be data
indications (Primitive type = 0x01), request confirms (Primitive type = 0x02) or
LSM indications (Primitive type = 0x03).
Data requests are used to indicate to the CEWay that the attached data
packet is to be transmitted through the physical medium.
LSM requests are used to configure the CEWay chip. Such things as
unit address and transmission type may be set with this primitive type.
Data indications allows the CEWay to indicate to the host that it has
received a packet and pass it up to the host.
Request confirm allows the CEWay to indicate to the host that it has
attempted a transmission and pass the success of the transmission up to the
host. LSM indications allows the CEWay to indicate to the host if a

22

Layer System Management

51

Chapter 5
transmission error has occurred and to pass the nature of the error up to the
host.
Primitive ID byte: This byte determines which of the specific primitive functions
is to be executed within a primitive type.
Number of data bytes: The number of data bytes included in the data field
Data: Data field sent to the receiver. It should contain the number of bytes
indicated by <number of data bytes>.
Checksum: This byte is a twos complement of all preceding bytes sent through
during the transfer phase excluding the start character.

At the end of the

transfer the receiver must compute the checksum and reply as to the validity of
the transfer.
Having

established

the

required

protocol

between

the

host

microcontroller and the CEWay PL-111 Network Interface Chip it is now


possible to detail the actual communications implementation.

5.3.2 Communications Driver


The communications driver is the software layer that utilises the above protocol
to enable network communications.
When the module is initially powered up the host microcontroller runs a
routine to set up the serial communications with the CEWay chip. This routine
enables the transmit and receive interrupts on the host microcontroller as well
as setting the baud rate to 19200 on both the host and the CEWay.

The

CEWay is also reset at this point to ensure that all registers are cleared.
Upon reset the CEWay chip sends through a message to the host
containing the MA_INITIALZE_PROTOCOL.confirm primitive byte.

This

indicates the successful reset of the CEWay chip. When this byte is received
the host can then reply with a MA_SET_VALUE.request primitive byte to
initialise the required registers in the CEWay chip.
Part of this initialisation includes setting the unit and house code
addresses for the device. Each of the Auto-MATE modules is initialised with a
default address specific to the module type.

For example a light dimmer

module has the house address 0x50 and the unit address 0x50.

These

addresses are stored in the EEPROM memory of the host controller when it is

52

Chapter 5
programmed. The central controller may change the address when the device
is connected to the network.
When the initialisation stage is complete the program returns to the main
loop where it polls the CommLinkInterface status flag on each iteration. When
the flag is set the program flow depends on whether the flag was set by a
request from the application layer or by the CEWay.
If the request is from the application layer the program must format a
CEBus header and data packet with the information provided by the application
layer. The header includes information such as the addresses of the intended
recipient and the sending node. In the Auto-MATE system the default recipient
is always the central controller.
If the request is from the CEWay it may be either a LSM primitive or a
data request primitive. In the case of a data request the data packet is read into
the host and the message is extracted and passed on to the application layer. If
a LSM request is received the host must manage the request appropriately and
in most cases this will result in a reset of the CEWay chip.
At the end of a data transmission or reception the host must confirm the
checksum and report a successful data transfer to the CEWay.
The communications program flow is presented graphically in Figure 5.1:
Communications Flow Chart.

53

Chapter 5

START

Initialise Baud rate


Reset CEWay

No

Reset
Successful ?

Yes

Initialise CEWay
Registers

No

CommLink
Interface Flag
Set ?

Yes
Application
Layer Request
?

No

CEWay
Request ?

Yes

Yes

Transmit Data
Packet

Data Request
?

No

Error
Handling

No

LSM Request
Error
Handling

No

Error
Handling

Yes

Read In Data

Checksum OK
?

Figure 5.1: Communications Flow Chart 1

54

Chapter 5

5.3.3 PC to Mains Power Interface


The software implementation of the PC power line interface module is simpler
than for the control modules as it contains no application layer software. The
program simply formats data sent from the PC into CEBus packets and then
forwards the packets including the header on to the CEWay. In the reverse
direction the data is read in from the CEWay into the host which is then
responsible for unpacking the data packets and transmitting the data out serially
to the PC.

5.4 Module Application Software


The application software implements the various control and sensing functions
required of the Auto-MATE modules.

5.4.1 CEBus Conformance


The application software uses the Common Application Layer constructs
necessary to comply with the EIA-600 Standard. To do this each module must
contain the Universal Context, as well as any further contexts required for the
individual module functionality.

Within the contexts are the methods and

instance variables used to change the state of the device.

The CAL

implementation of each module type is presented below.


The listing of CAL Contexts, Objects and Instance Variables utilised in
the Auto-MATE system is provided as Appendix C: CAL Listings.

5.4.2 Appliance Module


The appliance module contains the Universal context only (0x00). Inside this
context resides the Node Control Object (0x01) which contains the Instance
Variable Power (designation w). Changing the value of this variable results in
the controlled device being turned on or off (0 = OFF, 1 = ON) [49]. Therefore
a received data packet to turn on the appliance would appear as:
<0x00><0x01><0x45><w><0x01>

55

Chapter 5
When the application layer receives notification from the communications
layer that a packet has been received the program flow executes a case
statement based on the method and the Instance Variable is updated. This in
turn causes the microcontroller pin controlling the triac driver to be driven low
thus turning on the load.

5.4.3 Light Dimmer Module


The light dimmer module contains the Universal Contexts and the Light Sensor
Context (0x20). Within the Light Level Context the Current_Value IV (C) is
used.
When the light is on and the Current_Value is updated this variable
corresponds to an array index. The array holds values for delays to set the
firing angle for the load controlling triac.

When the zero voltage crossing

interrupt is detected the delay value is written to the timer register. The load
triac is fired inside the timer overflow interrupt thus varying the light intensity.

5.4.4 Motion Detection


The motion detector module uses the Universal and Light Sensor Contexts.
Inside the Light Sensor Context is the Occupancy Object which contains the
Function_of_State IV (F). This variable has the values 1 = Occupied, 0 =
Unoccupied.
This value is sent back to the central controller when the unit is activated.

5.4.5 Temperature & Humidity Sensing


Objects for the reading of these sensors are in the Environmental Sensor
Context (0x41) and are the Temperature Object (0x02) and the Humidity Object
(0x03).

When a request is received at the module an analogue to digital

conversion is performed on the appropriate channel and the result is packaged


up and transmitted back to the controller.

56

Chapter 5

5.5 Software Design Summary


This chapter has provided an overview of the software implementation for the
Auto-MATE system.

The software was separated into communications and

application layers.
It has been shown that the communications software implementation
conforms to the requirements of the EIA-600 CEBus standard and the protocol
used is specific to the CEWay PL-111 NIC.
The application layer has been developed in accordance with the CAL
section of the EIA-600 but does not completely conform to this standard.
The next chapter evaluates the success of the chosen hardware and
software implementations.

57

Chapter 6
Performance Evaluation of the Auto-MATE
System
This chapter describes the status of the Auto-MATE system at the conclusion of
the thesis project period.

The final product is then compared against the

derived product specifications of Chapter 3. Where relevant, explanations of


the test procedures used to evaluate the performance are detailed. Finally an
evaluation of the authors personal engineering performance is included.

6.1 Terminal Status of Project


At the completion of the thesis project a considerable proportion of the
proposed home automation system functionality had been successfully
implemented. This section lists the final hardware and software functionality.

6.1.1 Hardware
All aspects of the envisaged hardware design have been successfully
implemented except for the two-way voice control using the UHF transceivers.
At the time of writing the transceivers could be used to communicate with the
PC controller but there was no communication back to report on the success of
the request. The hardware is all contained on the PCBs developed for the
project with no extraneous wiring.

58

Chapter 6

6.1.2 Software
The software implementation was completed to a level that allowed full testing
of the Auto-MATE system. The system uses the CEBus protocol and CAL but
only a subsection of the full CAL specification has been implemented in the
application layer of the Auto-MATE modules.

6.1.3 Mains Power Communications


The mains power communications has been fully implemented and rigorously
tested. None of the difficulties encountered with the use of the Intellon P300
device were present during the development of the design using the Domosys
product.

6.1.4 Status Summary


The Auto-MATE system is a working prototype with all functionality that was
specified as being the minimum requirements for an entry level home
automation system. As a thesis project is intended as a Proof of Concept
exercise the development of the Auto-MATE system can be viewed as a
success. The aim of the project was to develop a functional home automation
system of a type currently unavailable in this country at a cost comparable to
available lessor products. This aim has been achieved.
It is now appropriate to review each section of the design with a view to
comparing the final product with the initial design specifications.

6.2

Comparison with Design Specifications

The design specifications derived in Chapter 3 were developed with the ideal
final product in mind. In some areas the final design did not attain the desired
level of functionality and in other areas it has exceeded expectations. The
comparison for each section is presented below.

59

Chapter 6

6.2.1 Central Controller


The modification of the MisterHouse program from X-10 commands to CEBus
commands proved to be a complete success. The use of an existing open
source program allowed for easy modification. The code allows for the use of a
subset of the CEBus Common Application Language that is sufficient for the
developed control modules. Further work would be needed to provide the full
CAL capabilities required for EIA-600 compliance.
The web interface and e-mail capabilities are already facilitated in the
MisterHouse program and only minor code alterations were required to tailor the
program to the new automation system.
The voice interface to the MisterHouse program works perfectly with a
PC microphone attached and outputting the voice through speakers. This is
existing code and only the command to be executed has been added to the
MisterHouse files. The use of UHF transceivers has not been fully implemented
at the time of writing.

The speech recognition software attached to the

MisterHouse program has a success rate at present of around 75% when


responding to commands transmitted using the hand held transceivers. The
Microsoft speech engine has the facility to be trained to increase reliability.
The results obtained were after the minimum two training sessions had
been performed. It is expected that further voice recognition training would
improve the performance.
It was intended in the original specifications that the MisterHouse
program be able to confirm the success of commands by transmitting voice
back over the UHF transceivers to the user.
transmit/receive switch to be controlled.

This would require the

The envisaged method was a

transistor in parallel with the existing switch on the device to be controlled by an


output pin on the microcontroller in the mains/PC interface board. This was not
implemented due to time constraints.

6.2.2 Mains Power Communications


The mains power communications component of the thesis project has been
thoroughly tested in a residential environment.

The tests showed that the

system communications are 100% reliable when transmission is in the

60

Chapter 6
addressed acknowledged mode and still around 90% reliable in the
unacknowledged mode.

The tests carried out in an existing house had

maximum transmission distances of approximately 70 meters when transmitting


between different circuits.

The tests were only over a single phase as is

common in most homes. The transmission rate for the Auto-MATE system is
9600 bps which meets the specifications set out in Chapter 3.

This

transmission rate has been confirmed on a digital oscilloscope by viewing the


frequency of the spread spectrum chirp transmissions.

6.2.3 Intelligent Nodes


The control and sensing modules, that were specified in Chapter 3 as being
necessary to consider the Auto-MATE system a complete integrated home
automation system, have all been implemented.
The modules have two-way communications and control of the attached
device can be performed locally or via the central controller using voice, web
page, e-mail or at the PC. The MisterHouse program is updated whenever a
status change occurs.
The load sensing functionality provides a feature unique to the AutoMATE system and works perfectly.
The humidity and temperature sensors provide readings that are within
the specified tolerances.
The implementation of the motion detector was sub-optimal in
performance. The problem lays in the decision to modify a cheap PIR sensor
not designed for switching digital signals. The design works but there is an
initial power up delay of approximately 1 minute before any detections can
occur. Also once the device is activated by movement a minimum delay of 5-10
seconds, which is the minimum on time, must pass before a new motion may be
detected. In spite of these failings the detector unit is still useful for purposes
such as room occupancy as a 10 second delay is not critical in this instance.

6.2.4 Phase Coupling


The attempt to couple the CEBus signal between the three phase power lines
was carried out in the Axon room 403 thesis labs. This met with only limited

61

Chapter 6
success. Even with the CEBus signal set for Acknowledged mode with the
maximum number of retries only a small percentage of the transmitted
commands were received.

It would appear that the signal attenuation

presented by the capacitors was too great. This method of phase coupling is
reportedly used in the United States by home automation hobbyists for X-10
transmissions [50].

As X-10 uses a fixed frequency signal the selection of

capacitor sizes is made easier.

6.2.5 Comparison Summary


The completed Auto-MATE system has been shown to compare favourably
against the proposed specifications and criteria. The finished product has met
most of the required functionality with only a few exceptions.

As these

specifications were derived from a review of existing similar products it can be


said that the Auto-MATE Home Automation System would form the basis for a
marketable product.

The following section reviews the engineering process

used to develop the Auto-MATE product.

6.3 Introspective Engineering Performance Evaluation


Having compared the final product with the proposed specifications it is now
appropriate to reflectively critique the design process used to bring this thesis
project to completion.

6.3.1 Utilisation of Project Tools


At the commencement of the project it was realised that management of time
and resources would be a critical element of the projects eventual success.
With this in mind one of the first tasks performed was the creation of a project
Gantt chart. The dynamic nature of the thesis project constantly evolving over
the course of the year made any attempts to pin down the duration of tasks
futile. This made difficult the use of such a tool and its use was therefore
discontinued.

62

Chapter 6

6.3.2 Application of Design Techniques


Greater success was found in the use of engineering design techniques
employed during the development of the Auto-MATE product. The technique
used throughout the process has been predominantly a top down approach.
This approach served well to implement the hardware design in particular.
From the high level concept of a Home Automation System the product
review enabled the detailing of the next layer components of such a system.
These are the controller, the communications protocol and the attached
modules.

From the subsequently derived specifications a required set of

modules was created. The process then continued down to the hardware and
software blocks necessary to realise the final product.

At each stage the

selection of components to be included in the following layer was dependent on


a review of the specifications and the design criteria.

6.3.3 Critical Analysis of Personal Performance


The success of a thesis project is dependent largely upon the efforts of the
thesis student. To bring this project to fruition has required varying measures of
innovation, resourcefulness and sweat.

This section is an attempt at self-

evaluation of the authors performance during the thesis project period.


Throughout the course of this thesis every effort has been made to
approach the project in a professional manner. As a thesis involves careful
management of the time spent working towards the completion, a high level of
self-discipline has been required to ensure a working prototype would be ready
by the due date. To this end the authors performance has been quite good.
Possible weaknesses have been a tendency to focus on building the product
and what can be done rather than Engineering a Solution to the problem. On
a positive note the importance of realising when to admit defeat and move on
has been highlighted with the success of the DomoSIP implementation
compared to the failures encountered with the Intellon product. Without the
change in mains power communications chip six weeks into the thesis period
the Auto-MATE demonstration would probably have consisted of a poster
demonstration rather than a working prototype.

63

Chapter 6

6.4 Performance Summary


This Chapter has served to provide a means of gauging the success of the
Auto-MATE project. The status of the project at the end of the thesis project
period has been described and a comparison of the final product against the
design specifications has been performed.

An explanation of the design

methodology used during the project is provided, as is an attempt at a review of


the authors personal performance. Several areas are highlighted where the
product performance is deemed to be sub-optimal.
Now with the benefit of hindsight it is possible to review some of the
design decisions in order to suggest possible product improvements and
extensions. This review is performed in Chapter.7

64

Chapter 7
Future Developments for Auto-MATE
As with any prototype development there are design decisions that could in
retrospect be improved upon. During the course of this thesis some of the
chosen methods of implementation have been revealed to be inferior to
techniques that were unknown at the time.
The implementation of the home automation system described thus far in
this thesis was only intended to provide a small subset of the possible
applications of a home automation system. There exists quite a broad scope
for extending the Auto-MATE system beyond its current status.
Both the design improvements and the product extensions are explored
in the following sections.

7.1 Design Review


Some sections of the original design warrant further refinement to ensure
optimal performance by the Auto-MATE system.

These improvements are

listed below:

7.1.2 Voice Command Control


The use within this thesis of UHF transceivers is suitable for demonstration
purposes only. Ideally a method of control would be developed that did not
require the occupant to carry around a hand held device. This may include
multi-directional speakers in each room that utilise voice compression
algorithms to allow the commands to be sent through the power lines.
This possibility was not explored in this thesis.

65

Chapter 7

7.1.3 Power Supply


The power supply used to provide a 5 volt and a 15 volt rail incorporates a 3VA
240:9 volt transformer. The secondary windings are connected in series to
provide an output of 18 volts RMS. When rectified and smoothed this should
equate to an input to the regulator of 25 volts. The transformers have poor
regulation and actually output a secondary voltage of 24 volts RMS thereby
causing the 5 volt regulator to dissipate close to its maximum allowable heat
even with a heat sink attached.
Possible solutions would be the use of a higher rated regulator or a lower
VA rated transformer. A further solution that may reduce the size of the PCB
and therefore reduce cost would be the use of a switch mode power supply
such as a forward converter.

7.2 Possible Product Extensions


The possibilities for a home automation system are quite endless. Throughout
the implementation of the Auto-MATE project the focus has been on the
minimum system components necessary for a useful product.

This section

explores several further avenues of development that were either suggested


during the project, or considered too time consuming to complete in an
undergraduate thesis time frame.

7.2.1 Power Measurement


A useful task for the control modules to perform would be the measurement of
the power consumption of the attached device. This would allow consumers to
monitor power usage and track possible areas of overuse thereby providing
obvious economical benefits through potential savings on electricity bills.
Although

this

functionality

was

not

implemented

preliminary

investigations were carried out into a feasible method of implementing such a


feature. The suggested hardware implementation would be to use an ATMEL
AT73C500 Watt/Hour meter chipset [51]. This is a two chip meter that requires
the external connection of a current transducer and a voltage reference to

66

Chapter 7
provide digital readings for active, reactive and apparent power as well as
phase angle and voltage, current and frequency readings.

7.2.2 SMS Text Messaging


Through the adaptation of the MisterHouse program a successful web interface
to the Auto-MATE system has been established.

While the Internet has

experienced a phenomenal growth access is still mostly limited to people with a


PC and an Internet connection. The prevalence of mobile phones makes them
an ideal candidate for remote access to the home automation system. Nearly
all mobile phones available at present have capabilities beyond simple voice
communications. One of these is SMS.23 Using an SMS message a user
would be able to request the status of a device in the home and change it if
needed by entering a command message. The message can be received by a
mobile phone in the home, which can then transmit the message as a text file
serially into the PC for the central controller to interpret. A perfect scenario for
this is when you are in the car half way to your destination and are suddenly
plagued with doubt as to whether the iron is turned off. A quick phone call
would reveal the status of the iron and if required could turn it off.

7.2.3 Set Top Box


For the Auto-MATE system a PC was derived as being the best solution for the
central controller. A PC does indeed represent the best solution at present but
evolving technologies may quickly change this. In particular the generation of
devices known as set top boxes may render the PC obsolete. In most homes
a main focal point is the television. Set top boxes such as the Teknema Easy
Rider [52] are already available in the US to provide an Internet connection
using the television as the user interface. A natural progression of this would be
to use the television as the interface for the home automation central controller.

23

Short Message Service

67

Chapter 7

7.3 Summary of Future Developments


This Chapter has identified possible areas of improvement for the Auto-MATE
system in addition to providing an insight into future directions that the system
development may take. Of the future directions the SMS text messaging and
the power measurement capability are within the scope of development for an
undergraduate thesis project.
It was intended that the SMS feature be implemented during the course
of this thesis.

This had to be revised due to the extended time taken to

implement the mains power communications component.

68

Chapter 8
Concluding Remarks
This thesis document describes the design process and subsequent
implementation of a basic home automation system.

The intention was to

develop a low cost, functional, entry-level home automation system that is


suitable for retrofitting into existing homes initially in Australia. A system that
meets the derived specifications has been completed to a stage that allows a
proof of concept demonstration to be performed.
Evidence of sound engineering practice throughout the product design
has been provided and consideration has been given to areas in which the
design may be improved. Possible future extensions to the product are listed in
the final section.
As all of the initial listed objectives for the thesis project have been met
the thesis project may be considered a success.

69

References
[1]

Gates, Bill. Looking Forward to Successful Home Technology,


http://www.microsoft/BillGates/columns/1998essay/7.15col.htm, Oct 2000.

[2]

Fowler, F.G. and Fowler. H.W., Oxford Concise Dictionary, 6th ed,
Clarendon Press, Oxford,1978.

[3]

Home Toys. Standard List, http://www.hometoys.com/resources.htm,


April 2000.

[4]

X-10 Inc. X-10 Inc., http://www.x10.com/homepage.httm, June 2000.

[5]

Rye, Dave. How it all started, History of Dave Rye and X-10,
http://www.hometoys.com/resources.htm, August 2000.

[6]

Kingery, Phil. Digital X-10, http://www.hometoys.com/resources.htm,


June 2000.

[7]

X-10 Inc. Active Home Feature Guide,


http://www.x10.com/products/x10_cklla_2.htm, September 2000.

[8]

Home Automated Living. HAL 2000 Features,


http://www.automatedliving.com/, September 2000.

[9]

Keware Technologies. HomeSeer Data Sheet, available as PDF


http://www.keware.com/homeseer14.pdf, September 2000.

[10] Mister House. MisterHouse Features, http://www.misterhouse.net/, April


2000.
[11] X-10 Inc. Decorator Dimmer Switch Product Description,
http://www.x10.com/products/x10_ws12a.htm, September 2000.
[12] X-10 Inc. Active Home 2-way Lamp Module Product Description,
http://www.x10.com/products/x10_1m14a.htm, September 2000.
[13] EON3 Technology. PowerHouse Appliance Module Technical Notes,
http://www.eon3.com/content/products/product.detail.asp?intProductID=13
2#, September 2000.
[14] X-10 Inc. Eagle Eye Motion Detector Product Description,
http://www.x10.com/products/x10.ms14a.htm, September 2000.

70

[15] X-10 Inc. PowerHouse 2-way Powerline Interface Product Description,


http://www.x10.com/products/x10_tw523.htm, September 2000.
[16] Rye, Dave. X-10 Myths and Realities,
http://www.hometoys.com/resources.htm, June 2000.
[17] Echelon. Echelon Pty Ltd, http://www.echelon.com, May 2000.
[18] Echelon. LonTalk Protocol Reference,
http://www.echelon.com/products/core/default.htm, May 2000.
[19] Weeks, Kenneth, P. Introduction to the LonTalk Communications
Protocol,
http://www.hometoys.com/htinews/oct97/articles/weeks/weeks.htm, May
2000.
[20] Echelon. i.Lon Starter Kit Documentation & Examples, available as
PDF from http://www.echelon.com/products/ilon/default.htm, September
2000.
[21] Leviton. Lighting Control Units Data Sheets, available in PDF from
http://www.echelon.com/products/resdir/RESDRPDF/LEVITON.PDF,
September 2000.
[22] Leveton. Occupying Sensors Data Sheets,
http://www.echelon.com/products/resdir/RESDRPDF/LEVITON.PDF,
September 2000.
[23] Infinitelan. EMC2000 Data Sheet, available as PDF from
http://www.infinitelan.com, September 2000.
[24] CEBus. CEBus Home, http://www.cebus.org, March 2000.
[25] Marwick Pty Ltd. E1A 600 Draft Specification, available as PDF from
http://www.marwickltd.com/library.htm, June 2000.
[26] GE-Smart. GE-Smart House, http://www.gesmart.com, September 2000.
[27] GE-Smart. Manager Plus Specification Sheet, available as PDF from
http://www.gesmart.com/managerplus.pdf, September 2000.
[28] GE-Smart. Smart Switches Specification Sheet, Available as a PDF
from http://www.ge-smart.com/lights.pdf, August 2000.
[29] GE-Smart. Smart Gear Appliance Port Specification Sheet, Available
as a PDF from http://www.ge-smart.com/ports.pdf, August 2000.
[30] GE-Smart. SmartOne Sensors Specification Sheet, Available as PDF
from http://www.ge-smart.com/sensors.pdf, August 2000.

71

[31] European Home Standard. EHS home, http://www.ehsa.com/index.htm,


April 2000.
[32] European Home Standard. The European Home Systems Concept,
http://www.ehsa.com/index.htm, April 2000.
[33] Trialog Inc. Trialog home, http://www.trialog.com, April 2000.
[34] Chadwick, Craig. To PC or Not To PC,
http://www.hometoys.com/resources.htm, September 2000.
[35] Wacks, Kenneth. Introduction to the CEBus Communications
Protocol, http://www.hometoys.com/resources, August 2000.
[36] AS 3000 1991: Electrical Installations Buildings, Structures and
Premises. (1991) Standards Association of Australia.
[37] Intellon Corporation. Intellon home, http://www.intellon.com, March
2000.
[38] Itran Communications. IT800 Power Line Modem Product Overview,
http://www.itrancomm.com/Products1.html ,May 2000.
[39] Domosys Corporation. Domosys home,
http://www.domosys.com/home/index.asp, April 2000.
[40] Alick, Q., The Internet Power Line Adaptor, Undergraduate Thesis,
Univ. of Queensland, Department of Computer Science & Electrical
Engineering, 1999.
[41] Intellon Corporation. Using Intellons Serial Peripheral Interface
Application Note #69, Available as PDF from
http://www.intellon.com/products/ssc/whitepapers.html, March 2000.
[42] Intellon Corporation. Your First CEBus Packet Application Note
#64, Available as PDF from
http://www.intellon.com/products/ssc/whitepapers.html, March 2000.
[43] Atmel Corporation. Atmel home, http://www.atmel.com, February 2000.
[44]National Semiconductor. LM355 Temperature Sensor Data Sheet,
Available as PDF from
http://www.national.com/pf/LM/LM35.html#Datasheet, September 2000.
[45] Thermometrics. HU 10 Humidity Sensor Data Sheet, Available as PDF
from http://www.thermometrics.com/htmldocs/numindex.htm, September
2000.

72

[46] HP Info Tech. CodeVisionAVR C Compiler Features,


http://dhptechn.webjump.com, February 2000.
[47] Domosys Corporation. CEWay PL-111 Data Sheet, Available as PDF
from http://www.domosys.com/cewaypliii/index.asp, June 2000.
[48] Domosys Corporation. CEWay PL-111 Sample Code, Available as
PDF from http://www.domosys.com/cewaypl-iii/index.asp, June 2000.
[49] Marrick Ltd. EIA-600.81, Available as PDF from
http://www.marrickltd.com/library.htm, August 2000.
[50] Kingery, Phil. Should I Use a Capacitor as an X-10 Signal Bridge?,
http://www.hometoys.com/resources.htm, August 2000.
[51] Atmel Corporation. AT73C500/501/502 Data Sheet, Available as PDF
from http://www.atmel.com/atmel/products/prod254.htm, October 2000.
[52] Teknema Inc. Internet TV Set-Top Box,
http://www.teknema.com/itv.html, October 2000.

73

Appendices

74

Appendix A
Circuit Schematics and PCB Layouts

75

Appendix B
Source Code Listings

81

Appendix C
CAL Contexts, Objects and Methods

101

Das könnte Ihnen auch gefallen