Old Mac, new tricks: Home automation

Predicting the future is always risky, especially when it comes to technology. Remember the paperless office and the flying car? How about the electronic house that runs itself? Alas, paper still rules and cars haven't left the road, but home automation is here, and you don't need a million dollar budget to make it work. With an old Mac, some add-on hardware, and a powerful application called XTension, you can create a house that George Jetson would love.

XTension, from Sand Hill Engineering, takes advantage of the X10 standard. This technology allows you to send signals through your house's electrical system to X10-compatible light switches, outlets, or devices. The possibilities are boundless -- you can control your home's lighting, rig your coffeepot to turn on when you hit the snooze button, and more. For more information about X10, see " The Automated Home " (May 2001). You can also check out our review of XTension 3.2.3.

To help you get started, I've designed two different home-automation projects: lighting a lamp whenever someone walks down a hallway, and turning on the television news every weeknight (see " Video on Demand "). This is only a small sampling of all that X10 and XTension can do, but you can use this information to create projects of your own design. The first project introduces you to the software and hardware. The second is a bit more advanced; it shows you how to use XTension to control equipment that isn't X10-compliant.

Step 1: Choose Your Mac

Before you invest in XTension or any add-ons, you'll have to determine whether your old Mac has what it takes to do home automation. (See the first article in this series, " Old Macs, New Tricks," (June 2001) for tips on how to beef up aging Macs.)

Compatible Models Home automation is a perfect job for most old Macs. If yours is capable of running XTension, it's suitable for most projects. XTension works with Mac OS 7.1 or higher, so it'll run on any Mac except for the original 128K and 512K models. Performance is rarely an issue, as long as you're willing to dedicate your Mac to its new role.

RAM and Disk Space XTension doesn't require much memory or hard drive space. The program and its supporting files take up only about 2MB on your hard drive, and the application runs in as little as 500K of free RAM. For this project, we dusted off a PowerBook 5300 with only 40MB of memory.

Power Requirements XTension works in real time, so you'll have to leave your computer running constantly. (Some devices can run independently, but if you're using XTension, Sand Hill Engineering says you should leave your Mac on.) If your Mac requires a separate monitor, you can conserve energy and save money by turning it off when it's unattended.

Power failures and brownouts are an unavoidable fact of life, especially during the summer, and a powerless Mac won't be able to do its job. PowerBooks have batteries that should keep the computer going for at least a few hours when the electricity stops. If you're using a desktop Mac, consider an uninterruptible power supply. (See " Uninterruptible Power Supplies " for a review of several UPS products for the Mac.)

Step 2: Choose X10 Hardware

X10 commands travel over your home's existing circuits, so you won't have to do any electrical wiring. Commands travel from your Mac's serial port into a computer interface, which relays them to light and appliance modules that control lamps and other electrical equipment around your house. (Certain modules, such as the motion detector that we'll use for our first project, can also send signals back to the Mac through the interface.) For any X10 home-automation project, you'll need one interface and at least one module.

The Right Interface XTension supports three different plug-in interfaces. For our purposes -- and if you're just getting started -- I recommend the CM11a interface, because it's easy to set up and it's relatively inexpensive. The CM11a is sold under several different brand names and plugs into any standard electrical socket. Several online and storefront vendors, including X10 Wireless Technology (800/675-3044, www.x10.com ), Smarthome.com (800/762-7846, www.smarthome.com ), and Radio Shack ( www.radioshack.com ) sell X10 hardware. X10's ActiveHome kit comes with a CM11a interface, a lamp module, and two remote controls for only $50.

The X10 interfaces were all designed to work with Windows PC-style 9-pin connectors, so you'll need an adapter to hook one up to your Mac. Try Palm's $6 Macintosh Serial Adapter, #10116U (800/881-7256, store.palm.com ), if your Mac has a serial port (as do pre-iMac models). If you don't have a serial port, try Keyspan's $39 USB PDA Adapter (510/222-0131, www.keyspan.com ).

Plug-In Modules We'll use an X10 lamp module to control the floor lamp in our project. It accepts any conventional, two-pronged electrical plug, so it'll work with most standard lights. (Lamp and appliance modules look almost identical, but they're not interchangeable.)

If you want your Mac to control more than one device, you must assign a unique address for every module in your house. To specify an address, set the rotary switches on the front of the module to determine its house code (A though P) and its unit code (1 through 16). (See "X10 Codes.") In most installations, all modules usually share the same house code but have different unit codes, so you can activate each one individually.

Bodies in Motion Two more gadgets round out our project: a wireless motion detector (the MS14A) to sense when someone's walking down the hallway, and a transceiver (the TM751) to pass the information from the motion detector to your Mac through the interface. When the motion detector senses nearby movement, it transmits a radio signal to the transceiver, which then transfers it to your Mac through your home wiring. You can buy both components from X10 for about $35.

Step 3: Put it All Together

Now it's time to start bringing all the pieces together. First, set up the Mac and interface in a convenient spot. It's a good idea to keep the motion detector, transceiver, and lamp module nearby to make sure that they all work properly before you move them to their permanent locations.

Plug the interface into any wall outlet near the Mac. Next, insert the connector on the cable into the jack on the bottom of the interface, and connect the other end of the wire to the Mac's serial port using the Palm adapter (see "Plugged In").

Remove the screws on the front of the motion detector to open the battery compartment, and insert two AAA batteries. The detector ships preset to transmit code A1 whenever it senses motion; if you don't have any other modules with this code, you can leave it as is. Otherwise, you'll have to reprogram it with a different code (see "Push-Button Programming"). For our example, we'll use code N5. First, press the left button 14 times, then the right one 5 times. Make sure to hold each button on the last press for a few seconds.

The house code on the transceiver must match the one on the detector, so set it to N. Plug the transceiver into a wall outlet and extend the antenna on the side to maximize its reception range. Finally, set the lamp module to code N2 and plug it into another wall outlet. For testing purposes, plug any incandescent wall or table lamp up to 300w into the module and make sure it's turned on.

Step 4: Program XTension

Now it's time to turn your attention to your Mac and install and configure the XTension software. You can purchase XTension for $80 by downloading it directly from Sand Hill Engineering (407/349-5960, www.shed.com ). If you're old Mac isn't Internet-capable, you can order XTension on CD for $120 or on floppy disk for $100. When you order or download, make sure that you specify whether you need the 68K or the PowerPC version of the application, as well as which X10 interface you'll be using. In addition to the software, you'll find a wealth of information about home automation on Sand Hill's Web site, so take your time and look around.

Program the Software Launch XTension and make sure that it's communicating properly with the computer interface by selecting Test Communications from the ActiveHome (CM11A) menu. If there's a problem, check the communications settings in XTension's Preferences dialog box and try again. (For example, XTension can't use a serial port that's already devoted to AppleTalk.)

Next, you have to tell XTension what modules and detectors you've installed. Begin by programming the lamp module. Choose New Unit from the File menu and enter the information for the floor lamp, including its name, X10 address, and a brief description of what it does (see "Office Lamp Module").

Setting up the motion detector is a bit trickier, because you'll have to do some simple programming. First, enter the detector's name, address, and description in the New Unit dialog box (see "Detector Details").

Next, click on the left Edit button and enter a script to turn on the lamp module when someone triggers the detector after dark (see "Motion Script"). Type the script exactly as it appears here.

Programming mavens will feel right at home with XTension's AppleScript-based scripting language -- if you're new to programming, be prepared to invest some time to learn the concepts before you write your own scripts. If you get stuck, Sand Hill's Michael Ferguson maintains an electronic mailing list where you can post questions about XTension and home automation -- see the company's Web site for instructions on how to subscribe.

Testing, Testing When you're ready, move your hand near the detector -- the light should come on. If nothing happens, it may be too early: remember, we programmed XTension to turn on the lamp only after sundown. If you'd rather not wait, you can modify the script to remove the time constraint. Another way to verify that everything's working is to open XTension's Log window. When you activate the motion detector, two new entries should appear: "Received ON command for Hallway Motion Detector," followed by "Sending ON command for Office Floor Lamp."

Final Setup Once you're certain that everything functions properly, look for an accessible -- but safe (that is, away from kids, pets, and so on) -- place to install the Mac and interface, just in case you need to program new functions or troubleshoot problems. If your old Mac is on a network, you can control it from another computer in your house or even over the Internet -- see the XTension manual for details.

Install the motion detector on a wall in the hallway near the office (see "On the Wall"). An LED in the detector flashes whenever it senses motion, so experimenting is easy until you find a spot that works consistently.

Where you plug in the X10 transceiver is less critical, as long as it's close enough to the motion detector to receive signals from it reliably.

The Last Word

As any aficionado will tell you, home automation isn't a hobby -- it's a way of life. The simple projects I've outlined only hint at what you can accomplish, but they're a good way to get your feet wet without breaking the bank. Once you're hooked, you'll want to move on to more demanding applications, and you'll soon have your old Mac running your house.

Contributing Editor FRANKLIN N. TESSLER has been working with X10 hardware and software since 1985. He snapped all the photos in this story.

X10 Codes: You can set the module's house code (bottom) and unit code (top) with a paper clip or small screwdriver. This module is set to N2. Plugged In: To use the interface, you'll need an adapter to mate the cable to the Mac's serial port. Push-Button Programming: Buttons in the battery compartment let you program the motion detector's house and unit codes. Office Lamp Module: The New Unit dialog lets you define a unit that represents the floor lamp in the office. Detector Details: Like every other addressable X10 component, the motion detector has to be defined as a separate unit in XTension. Motion Script: This script turns on the office floor lamp for ten minutes past sundown. To remove this restriction, delete the first and third lines. IR Light: The Powermid extender cable plugs into a jack on the base of the receiver. An adhesive pad lets you fasten the emitter in an unobtrusive spot near the TV.
Related:
1 2 Page 1
Shop Tech Products at Amazon