|
Turn Out the Lights Remotely
Wireless automation of electrical devices is no longer a futuristic notion. Learn how to use Java to interface with low cost, home-automation X10 equipment
by Kulvir Singh Bhogal and Michael Abernethy
December 15, 2004
Are you feeling too tired to get up off of the couch and turn off the lights after you've spent hours trying to meet that impossible coding deadline that your manager imposed? Wouldn't it be nice to turn the lights out without even getting up? Or without clapping? Better yet, wouldn't it be nice to be able to turn your lights off through your laptop? Do you think that sounds crazy? The notion isn't crazy; it's home automation!
Home automation is the science of being able to control electrical devices in your home through your PC or remote controls. Let's take a look at how to use Java to interface programmatically with low cost, home-automation equipment offered by X10 Wireless Technology Inc. We will also show you how to create a setup that leverages IBM WebSphere Application Server to be able to control your lights from a Web-based interface. Just think, you'll be able to turn your lights on and off from halfway around the world!
X10 Wireless Technology Inc. (see Resources) has been providing products in the home automation space for a number of years. The company provides myriad home automation devices that allow a person to control every light in the house from one switch, from a remote control, or by motion-detector triggering.
The term X10 also refers to a language protocol used by X10 equipment to communicate with wall switches and other modules. X10 Wireless Technology invented the language protocol, naming itself after the protocol. The transmission of the language works through existing power lines, making the concept of home automation particularly enticing; one does not have to consider ripping up their walls for a home automation endeavor. The X10 language tells wall switches and plug-in modules to turn the electrical equipment (for example, lights) they are connected to on and off. Depending on the target device, even light-dimming commands can be sent through the X10 language.
Supporting Hardware
For our purposes here, we are going to assume that you are using the X10 FireCracker unit (see Resources) to perform your home-automation programming experiments. These FireCracker devices are also readily available on eBay. The FireCracker kit includes an active home remote, through which you can send X10 commands (see Figure 1).
Of course, while the remote control is neat, it is not the point of this discussion. Instead, we are going to show you how to make X10 calls programmatically from your PC. In the FireCracker kit, you get a PC interface module that connects to your serial port. This PC interface module sends X10 commands from your PC to X10 devices.
The FireCracker kit also includes a transceiver module. The transceiver module listens for X10 commands. You can plug a lamp directly into the transceiver module. Alternatively, you can plug a lamp into the lamp module. The transceiver module relays X10 requests to the lamp module. Figure 2 shows a topological overview of the interaction among the X10 FireCracker kit components. You can learn more about the FireCracker kit on various Web sites (see Resources).
X10 signals are low-voltage signals that travel over home electrical wiring and that are transmitted while current alternates its phase at 60 times per second (see Figure 3). The X10 signal can be dissected into a binary series of commands consisting of start codes, letter codes, number codes, and command codes. (see Resources to learn more about the X10 signal structure.)
You can assign a unit number to modules that consists of a letter code and number code. A command code like ON, OFF, DIM, BRIGHT, ALL ON, or ALL OFF is sent along with the letter code and number code to direct a module to control an electrical device such as a lamp.
Back to top
|