Introduction to X10 Home Automation Technology

by Tony Northrup, co-author of Home Hacking Projects for Geeks

Every geek dreams of the elusive smart home, a place that automatically turns off that light you forgot in the basement when you went to bed, monitors your house for intruders while you sleep, and reads you the weather report in the morning so you know how to dress. Good news: smart home technology is no longer science fiction. Bad news: it's not for everyone. You need to fall into one of the following two categories:

  • Filthy rich
  • Geek

If you're filthy rich, stop reading, call up your favorite contractor, and give him (or her) a blank check. If you're a geek, spend a few minutes learning about X10 technology.

X10 is just one of many home automation technologies used in my latest book, Home Hacking Projects for Geeks. The book will guide you step by step through the process of adding common smart home features to your home.

What Can You Do with X10?

X10 is a powerful, flexible, and (mostly) inexpensive technology. With X10 technology and a little creativity, you can accomplish the following things:

  • Add a light switch to any wall without running any wires.
  • Control a lamp or built-in light with your computer (described in Project 2, "Automate Your Porch Light," in Home Hacking Projects for Geeks).
  • Use a television at your home or a computer on the Internet to monitor multiple, inexpensive video cameras around your home (described in Project 3, "Remotely Monitor a Pet," and Project 12, "Watch Your House Across the Network").
  • Turn off the power outlets in your kid's bedroom between 4 p.m. and 6 p.m. to make sure he or she is studying and not playing a game or watching TV.
  • Build a custom security system that sounds an alarm if an intruder opens a window, or sends an email to your mobile phone if there is a water leak in your basement (described in Project 13, "Build a Security System").

What Is X10?

X10 is a communications protocol, similar to network protocols such as TCP/IP. However, X10 works across home power lines and is extremely low-bandwidth. X10 devices send about one command per second, and the commands are as simple as "Device A1: turn on." These commands require less than 1/1000th of the bandwidth of a dial-up connection. Like a broadcast network, every command is sent through every wire in your house; it's up to each individual device to decide whether it needs to respond to a particular command. With X10, devices that can be plugged into the wall can communicate with each other and with your computer. There are hundreds of X10 devices available, and most are fairly inexpensive--less than $40. Figure 1 shows some of the most common types of X10 devices: a two-way, hard-wired X10 wall switch, a wireless transceiver, and a battery-operated wireless wall switch.

Figure 1
Figure 1. A hard-wired X10 wall switch, an X10 wireless transceiver, and a wireless X10 wall switch

The simplest way to use X10 is to turn a lamp on and off from an X10 remote. To do this, configure an X10 transmitter (such as an X10 remote or wall switch) and an X10 receiver (such as a lamp module) to the same X10 address. Plug a lamp into the X10 receiver, as shown in Figure 2, and then turn the lamp on. Voila! You can now use the X10 remote to turn the lamp on and off.

Electronics stores and large hardware stores usually carry a handful of common X10 parts; in fact, you can buy all of the parts you need for simple projects at the Home Depot, Lowe's, or Radio Shack. However, I prefer to buy the parts on the Internet because prices tend to be lower and there are many more parts to choose from. I do most of my shopping at SmartHome.

Figure 2
Figure 2. An X10 lamp module turns a lamp on and off when an X10 signal is sent from an X10 transmitter

X10 Addressing

To identify individual devices and groups of devices, X10 uses an addressing scheme that provides up to 256 unique addresses. House codes are written as a single letter in the range A-P. Unit codes are a decimal number between one and 16. Examples of valid house codes are A1, J13, and P16.

Note: If you're a network geek, think of the house code as the network portion of an IP address, and the unit code as the host portion.

Unlike the IP addresses used on the Internet, X10 addresses do not have to be unique. You should give a single address for each group of X10 devices that you would like to respond to the same command. For example, if you want to turn on two lamps with a single switch, connect an X10 lamp module to each lamp and configure both modules with a single address. If you want all of the lamps in a room to be controlled by a single command, they should all be assigned a single address.

Related Reading

Home Hacking Projects for Geeks
By Eric Faulkner, Tony Northrup

While most X10 devices are one-way (because they are only capable of either sending or receiving), some devices are two-way. For example, one-way X10 light switches can receive X10 commands to enable them to be turned on and off remotely. You can also use the one-way light switch to control the light locally, just as you control a conventional light switch. However, when you flip the switch, a one-way X10 light switch does not transmit a signal. Therefore, while flipping the switch can turn the light on and off, it cannot turn on other X10 switches.

Two-way X10 light switches can receive X10 commands, and can also transmit an X10 command when you flip the switch. This allows you to use the switch to control both the light and another X10 device simultaneously. For example, if I replace the switch that controls my kitchen's under-cabinet lighting with a one-way X10 switch, and then replace the switch that controls my kitchen's overhead lighting with a two-way X10 switch, I could turn on both the overhead light and the under-cabinet light by using the overhead light switch.

For More Information

The greatest things about X10 are its flexibility and the large number of X10 components available. These factors also make it a bit challenging to learn. A good way to dip your toe into the water is to buy a home automation starter kit, and then automate a light or two.

When you feel comfortable with the hardware, start to explore the ways you can control X10 devices from your computer. Buy a CM11A Serial X10-computer interface. (Whatever you do, don't get the USB or the Powerlinc II models!) Immediately throw away the software that comes with it, and download one of these free X10 home control applications:

  • MisterHouse (my favorite)
  • Java Home Automation
  • X10 Controller

If you have scripting or programming skills, it'll probably be easier for you to write your own applications to control your X10 devices than to use other people's tools. X10 scripts are extremely easy to write, thanks to the Perl tools created by Bill Birthisel. If you don't feel comfortable writing scripts, grab a copy of Home Hacking Projects for Geeks--I provide many ready-to-run scripts and tools that you can edit for your own purposes.

Tony Northrup , a Boston-area network security consultant and technology author, developed his interest in home automation after renting an apartment where every light was controlled by pulling a string. Tony's wife, Erica, ensures his home hacking projects are user-friendly and reliable, while his cat, Sammy, mangles every project within paw's reach.

Return to the O'Reilly Network.