DIY Home Automation

subduedlockΜηχανική

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

68 εμφανίσεις

DIY Home Automation

Chris Barrett

Disclaimer


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


X10


1
-
wire


Infrared


Text to speech


Caller ID


Digital IO

X10


Powerline Carrier (PLC)


Control signals are sent over the house

s
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

CM12AU

Computer Interface

AM12

Appliance Module

LM15EB

“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


A,B,C,…,P


Unit Code


1,2,3,…,16


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


K3 ON


Turns the kitchen light on


K3 OFF


Turns the light off


K3 DIM25


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

X10


“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.

X10
-

“Gotcha #2”


X10 signals can occasionally get lost or
corrupted.


Most X10 modules are not bi
-
directional.


No feedback to confirm if the command was
received.

1
-
wire


Firstly, it actually uses two wires …


1 wire for ground


1 wire for power
and

data


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
address)

iButton


One physical implementation of 1
-
wire
devices.


Looks like a watch battery.



Two main types used for HA:


Thermostat


Serial number


Can be used to identify regular occupants

Infrared


IR transceiver connected to the PC


www.usbuirt.com



Allows the control of:


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


the PC using a surplus IR remote.



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

Text To Speech


Reads out information, reminders and
warnings:


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


www.weedtech.com




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


Switches, LEDs, push buttons, etc

Misterhouse


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.


www.misterhouse.net

Heating


Wireless thermostat.


PC based RF receiver (W800RF32)


www.wgldesigns.com


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
time.

Motion Detectors


Can double as sensors for an security system.



A work in progress at this stage.

Doors


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.

Doorbell


Plays a WAV file when someone presses the
button.


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
$Doorbell

=~ /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
$FrontDoor

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,
and


sends an IR signal to the stereo to turn down the
volume.

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
requested.

Irrigation


Project is on hold because of the water
restrictions.


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:

1.
Turns on the light if it’s dark,

2.
Reads out the forecast for the day,

3.
Reminds me if our dog needs its monthly pills, and

4.
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
tomorrow.”


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.

Demonstration


A live demonstration of the system via the
Internet.