Beruflich Dokumente
Kultur Dokumente
October 2000
20 October 2000
The Dean
School of Engineering
University of Queensland
ST LUCIA QLD 4072
Intelligent
Communications.
Home
Automation
Using
Mains
Power
I declare that the work submitted in this thesis is entirely my own except where
appropriately acknowledged and referenced.
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.
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.
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
Forrest Gump
Contents
Abstract
iii
Acknowledgments
iv
Contents
vi
List of Figures
List of Tables
xi
1. Introduction
2.1.2
2.1.3
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
2.3.2
CEBus Products...................................................................... 21
2.3.3
CEBus Summary..................................................................... 23
2.4.2
EHS Products.......................................................................... 23
2.4.3
vi
27
Modes of Control..................................................................... 31
3.4.3
Additional Services.................................................................. 31
3.4.4
Reliability................................................................................. 32
3.5.2
3.5.3
Transmission Distance............................................................ 33
3.5.4
3.5.5
Microcontroller......................................................................... 33
3.6.2
3.6.3
Appliance Module.................................................................... 34
3.6.4
Motion Detector....................................................................... 35
3.6.5
Climate Sensor........................................................................ 35
3.6.6
36
4.4.2
Load Switching........................................................................ 44
vii
48
CEBus Conformance............................................................... 49
5.2.2
5.2.3
5.2.4
5.3.2
5.3.3
CEBus Conformance............................................................... 55
5.4.2
Appliance Module.................................................................... 55
5.4.3
5.4.4
5.4.5
58
Hardware................................................................................. 58
6.1.2
Software .................................................................................. 59
6.1.3
6.1.4
Status Summary...................................................................... 59
viii
6.2.1
6.2.2
6.2.3
6.2.4
Phase Coupling....................................................................... 61
6.2.5
Comparison Summary............................................................. 62
6.3.2
6.3.3
65
7.1.3
7.2.2
7.2.3
69
References
70
Appendices
74
A.
B.
C.
ix
List of Figures
Figure 2.1:
Figure 2.2:
Figure 2.3:
Figure 2.4:
Figure 2.5:
Figure 2.6:
Appliance Module........................................................................ 12
Figure 2.7:
Figure 2.8:
Powerline Interface...................................................................... 12
Figure 2.9:
Figure 3.2:
Figure 4.1:
Figure 4.2:
Figure 4.3:
Figure 4.4:
Figure 4.5:
Figure 4.6:
Domosip ...................................................................................... 41
Figure 5.1:
List of Tables
xi
Chapter 1
Introduction
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.
Chapter 1
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
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.
Possible mediums are Powerlines, Infra-red, Twisted Pair, Radio Frequency, Coax, Fibre Optic
Chapter 1
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
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
2
3
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.
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.
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.
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.
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.
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:
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.
5
6
11
Chapter 2
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.
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
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 7: Application Layer This layer includes services to simplify development of application programs to
interface to specific sensors, actuators, and external microprocessors.
Chapter 2
nodes on a network takes place using the network variables that are defined in
each node.
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.
connections when the nodes are installed on the network. The use of SNVTs
contributes to the interoperability of LONWORKS products from different
manufacturers.
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
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 development
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.
designation EIA-600.
8
9
17
Chapter 2
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.
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
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.
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.
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
Contexts are
The most
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.
such
as
temperature
and
motion
Figure 2.15:
Smart Switch
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
23
Chapter 2
Development Board) manufactured by Trialog [33].
communications over the power line between two ST7 development boards
when connected to a host microcontroller.
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.
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
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
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
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
Chapter 3
This minimum set of specifications leads to the block diagram of 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.
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.
29
Chapter 3
The only
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.
31
Chapter 3
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.
11
12
32
Chapter 3
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.
The Auto-MATE
The individual
34
Chapter 3
decisions such as controlling heating and cooling devices. When requested the
sensor should provide a temperature and a humidity reading with reasonable
accuracy.
With the
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.
1)
2)
3)
4)
5)
6)
7)
Host microcontroller
8)
9)
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.
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).
37
Chapter 4
Auto-MATE
Control Module
Power
Line
Power Board
Control Board
CEBus Powerline
Coupling
Microcontroller
Local Control
Buttons
Load Switching
Motion Detector
Zero Voltage
Crossing
Detection
Temperature
Sensor
Load Sensing
Humidity Sensor
Controlled
Device
From the
The first is a
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.
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.
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.
39
Chapter 4
communicates to the host microcontroller using the SPI14.
The host
14
15
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.
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.
Intellon and screen captures of the generated signals were e-mailed to them but
they were unable to explain the lack of interrupts.
The pre-mounted
16
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.
The
Schematics.
4.3
Microcontroller Selection
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
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.
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.
44
Chapter 4
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.
45
Chapter 4
of the PC814 is connected to a microcontroller interrupt input, which is then
pulled low when motion is detected.
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.
speaker/microphone input/output ports that can connect straight into the sound
card ports on the PC thus enabling two way voice communications.
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.
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.
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.
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.
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>
50
Chapter 5
22
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.
transfer the receiver must compute the checksum and reply as to the validity of
the transfer.
Having
established
the
required
protocol
between
the
host
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.
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
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
?
54
Chapter 5
The CAL
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.
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.
56
Chapter 5
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.
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.2
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
60
Chapter 6
addressed acknowledged mode and still around 90% reliable in the
unacknowledged mode.
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
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.
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 these
62
Chapter 6
modules was created. The process then continued down to the hardware and
software blocks necessary to realise the final product.
63
Chapter 6
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.
listed below:
65
Chapter 7
This section
this
functionality
was
not
implemented
preliminary
66
Chapter 7
provide digital readings for active, reactive and apparent power as well as
phase angle and voltage, current and frequency readings.
23
67
Chapter 7
68
Chapter 8
Concluding Remarks
This thesis document describes the design process and subsequent
implementation of a basic home automation system.
69
References
[1]
[2]
Fowler, F.G. and Fowler. H.W., Oxford Concise Dictionary, 6th ed,
Clarendon Press, Oxford,1978.
[3]
[4]
[5]
Rye, Dave. How it all started, History of Dave Rye and X-10,
http://www.hometoys.com/resources.htm, August 2000.
[6]
[7]
[8]
[9]
70
71
72
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