Home Automation X10 - Linux

 
   X10 power line modules can control your lights, fountain, garage door and more.
  I bought the Active Home kit from x10.com
This kit has an x10 to serial interface bridge, CM-11A,  which connects to your PC. A cool universal learning remote and a wireless x10 transceiver are also included.
   120Khz pulses are sent over the power line as shown in Figure2. The x10 modules receive these pulses, decode them and activate the lamp or appliance.
  I use my computer to generate the control program. The control program consist of timers, macros, and triggers. I use heyu to  upload the x10 control program to the CM-11A. 
powerline

Getting started

  Download  x10_heyu.tgz from http://heyu.tanj.com/  Read the FAQ for instructions on installing heyu. The FAQ is well written so I will not go into the installation details.  Plug the CM-11A into the AC outlet and then into a serial port on your PC. 
  Here is a copy of my .x10config file. I changed the TTY to /dev/ttyS4 set the default house code to A and added aliases for my x10 devices. Once the config file is ready su to root and run "heyu info"  to see if your PC is talking to the interface.

[root@Nt5server root]# heyu info
Firmware revision Level = 1
Interface clock: Tue, 21:52:07, Julian 349
Housecode = a
0 = off, 1 = on,               unit  16.......8...4..1
Last addressed device =       0x0100 (0010000000000000)
Status of monitored devices = 0xa9fa (0110111111010001)
Status of dimmed devices =    0x570d (1011010000101110)


Now you can create your timers and macros in the .x10sched.conf file

Timers and Macros

The CM-11A can activate a macro on a timer event. Here is a copy my .x10sched.conf file.  The macro "macro sunset on a7,5,8,10,9,12,11;on a14;bright a11 11" turns on 8 x10  modules and dims my Christmas tree to level 11. The timer "timer smtwtfs 01/01-12/31 17:25 17:26 sunset sunset " runs every day of the year at 17:25 and 17:26. So at 17:25 the timer causes the sunset macro to run and at 17:26 the timer runs the sunset macro again. The reason I run the macro twice in because the x10 interface is not fault tolerant. By running the macro twice I can over come problems caused by power line interference.

x10 Signal Phase Coupling

  I recommend adding a phase coupling capacitor across the 220V line. This will allow the x10 signal have the maximum range in your home. I have included the diagram from the x10 web site. It shows a 0.1uF 600VDC capacitor connected across the 220V line. A 0.25A inline fuse in series with the capacitor is recommended. Cut off the power to your house before installing the capacitor. If you are not comfortable doing the work hire and electrician. 
capacitor

x10 Garage Door Closer

  Often the garage door is opened by the kids and then left open. I use the x10 relay module (UM506) to close he garage door. I set a series of timers which start at dusk and run until 11:00 pm. Each timer event causes the relay to close and close the garage door. If the door is already shut nothing happens.  The relay is module  a14 macro close_door in my .x10sched.conf file.

Schematic of the Garage Door Closer


circuit

Operation of Door closer

The Button is the switch which normally operates the garage door. The Reed Switch is mounted on the chain drive. When the door is on the closed position the magnet is positioned over the Reed Switch causing the Reed Switch to be open. The UM506 is activated by the timers starting at dusk and every 30 min until bedtime. If the garage door is open the Reed Switch is closed and the UM506 causes the Door Motor to close the door. If the door is closed the magnet causes the Reed Switch to be open and nothing happens when the UM506 activates.
Set the momentary/continuous switch on the UM506 to the momentary position. Set the Relay switch to sounder and relay. When the UM506 is activated the sounder will beep and the relay will close for about 2 seconds simulating a button press. The garage door will close.
switch
Mount the Reed Switch on the chain drive rail. Mount the magnet on the chain drive carriage. Position the magnet such that the Reed switch is open when the garage door is closed.  Each time the UM506 is activated the contacts will close for about 2 seconds and then open. This simulates pressing the garage door button.  If you do not want the door to automatically close place an object in the infrared beam.
beam

reed switch

Return to homepage