DIY Home Automation


5 Νοε 2013 (πριν από 4 χρόνια και 6 μήνες)

80 εμφανίσεις

DIY Home Automation

Chris Barrett


I am a hobbyist

I have no attachments to any of the companies that
I will mention other than that I have bought some of
their products.

References to the companies and their products do
not constitute endorsements.

What is Home Automation?

“home automation”

“smart homes”

“intelligent houses”

Automating aspects of your home to make
things more efficient and/or enjoyable.

My Introduction to HA

The Technologies in my House




Text to speech

Caller ID

Digital IO


Powerline Carrier (PLC)

Control signals are sent over the house

existing electrical wiring

no extra wiring is required!

The signals are not noticed by and don

t affect
the operation of non
X10 equipment.

Developed and patented in 1978

Examples of X10 Equipment


Computer Interface


Appliance Module


“Socket Rocket

X10 Addressing Scheme

Each device (eg a light) is assigned an address

made up of a House code and Unit code

House Code


Unit Code


So a light in the kitchen might be K3

256 (16*16) combinations

Multiple devices can have the same code but will be
controlled as one.

Examples of X10 Commands


Turns the kitchen light on


Turns the light off

K3 DIM25

Turns the light on but at 25% of it’s normal power


“Gotcha #1”

X10 wont work with devices that need a human
to press a button for it to do something.

The device needs to be capable of doing its job
as soon as it gets power.

For example, X10

Wont work with a VCR, but

Will generally work with a kettle or a pedestal fan.


“Gotcha #2”

X10 signals can occasionally get lost or

Most X10 modules are not bi

No feedback to confirm if the command was


Firstly, it actually uses two wires …

1 wire for ground

1 wire for power


this is where the name comes from

The 1
wire devices in my house use the
existing Cat
5E cabling.

Each device has a unique ID (like a MAC


One physical implementation of 1

Looks like a watch battery.

Two main types used for HA:


Serial number

Can be used to identify regular occupants


IR transceiver connected to the PC

Allows the control of:

devices (eg TV, stereo, VCR) from the PC, and

the PC using a surplus IR remote.

>IR repeater allows me to keep the
PC and USB
UIRT in a closet.

Text To Speech

Reads out information, reminders and

Reads out the weather forecast each morning.

Reminds me the night before and the morning of
rubbish day.

Tells me when the news is on.

Digital I/O

Serial interface board

Each of the 14 lines can be configured as
inputs or outputs.

Switches, LEDs, push buttons, etc


The ring master or brain of the the system.

Open source.

Written entirely in Perl

Multi platform

Win32, Linux, Mac, etc

All of the automation within my house was
created using Perl.


Wireless thermostat.

PC based RF receiver (W800RF32)

The system looks at the temperature provided
by the thermostat …

Compares it to my desired temperature for the
time of day …

If necessary sends commands to an X10
controllable relay which in turn controls the
ducted gas heater.

Motion Detectors

Generally one in each room.

In some rooms, the lights are turned on
automatically if motion is detected and it’s dark.

In all rooms, the lights are turned off if no
motion is detected for a user
defined period of

Motion Detectors

Can double as sensors for an security system.

A work in progress at this stage.


The front and back doors are fitted with devices
that send a signal whenever the doors are
opened or closed.

The system advises when a door has been left
open too long.

A device has also been fitted to a closet and a
light is turned when on the door is opened.

just like the fridge.


Plays a WAV file when someone presses the

If the front door is not opened within 45
seconds then an email is sent to me indicating
that we missed a visitor.

Future plan is to install a camera (eg web cam)
to take a photo and include it in the email.

The code that manages the doorbell

$Doorbell_timer = new Timer();

$Doorbell_Answer_timer = new Timer();

if (state_now

=~ /normal/) {

play(volume=>100, file=>'Trumpet1.wav');

flash $LoungeRoom_light;

if (inactive $Doorbell_timer) {

set $Doorbell_Answer_timer (45);

set $Doorbell_timer (120);



if (expired $Doorbell_Answer_timer) {

Send_Email(undef,"Doorbell"," No
one answered the door",undef);


if ((state_now

eq "open") && (active $Doorbell_Answer_timer)) {

unset $Doorbell_Answer_timer;

print_log "Door has been answered

email will not be sent";


Caller ID

Modem detects the phone ringing.

The system:

reads the phone number from the modem,

looks up a database of phone numbers and reads
out the name if it’s known or the phone number,

sends an IR signal to the stereo to turn down the

Weather Data

The system downloads:

Weather conditions (current temp, wind speed, etc)
from the Bureau of Meteorology every 20 minutes.

Forecast information once an hour.

Conditions are plotted on a number of graphs.

Forecast is read out each morning, and when


Project is on hold because of the water

Plan is to have a system that will adjust
watering parameters depending on:

the forecast for today and the next couple of days,

the current conditions,

the recent past conditions, and

any government imposed watering restrictions.

Example #1

My computer room

Each morning when I walk into the room for the
first time, the system:

Turns on the light if it’s dark,

Reads out the forecast for the day,

Reminds me if our dog needs its monthly pills, and

Turns on the radio in the lounge room and sets it
to Triple J.

Example #2

Rubbish Day

We have our rubbish collected on Thursdays.

On Wednesdays at 18:15, 19:15 and 20:15 the
system announces that “It is rubbish day

On Thursday morning the system announces at
07:15 and 07:45 that “It is rubbish day today.”

Example #3

Front door

Motion sensor outside near the front door
detects motion and turns on:

the exterior light if it’s dark outside and

the light immediately inside the front door if it’s dark
inside the house.

Example #4

News Time

At 17:57 the system announces that “The news
is on soon”.

At 17:59 the system transmits IR signals to:

Turn the TV on,

Set the channel on the TransACT STB to 9, and

Set the stereo to accept the audio feed from the TV.


A live demonstration of the system via the