Apress - Smart Home Automation with Linux (2010)- P5 ppt

5 274 0
Apress - Smart Home Automation with Linux (2010)- P5 ppt

Đang tải... (xem toàn văn)

Thông tin tài liệu

CHAPTER 1 ■ APPLIANCE CONTROL 3 ■ Note Some types of light (such as fluorescent and power-saving bulbs) cannot generally work on lamp modules and must be used with appliance modules. Each X10 message consists of three parts: • A start message block (a nibble of 1110) • An address (a house code and/or unit code) • A command code (for example, “switch on”) There are several different commands, fitting mainly into two groups—house code messages directed toward all devices and unit code messages targeting a single appliance. As mentioned earlier, each X10 module is built to accept or ignore specific messages, usually according to whether it’s designated a lamp or appliance module; however, appliance modules will also ignore the “all lights on” message but honor the “all units off,” which is suggested by the subtle wording of the commands differentiating between lights and units. It is interesting to note that their inverse variants (“all lights off” and “all units on”) do not exist. This is intentional. One of the intentions of “all lights on” was to act as a security feature. An accidental invocation of an “all units on” command might start a teakettle dry boiling or something similarly dangerous. Conversely, “all units off” provides a quick closedown procedure for the house. Once the message has been sent, nothing else happens. Ever! The receiver does not generate an acknowledgment of the message, and the sender doesn’t query the state of the recently controlled device to confirm its arrival. This is because the transmitting circuits are more complex and expensive than the receiver and because adding a message facility would add cost and bulk to the simplest of light switches. Some two-way switches do exist, providing a way for you to query their state, but they are more expensive. However, in an attempt to ensure data validity, the message is sent twice, and both messages are compared for equality since electrical noise on the power line could have corrupted part of the signal. Consequently, it takes around 0.64 seconds for an X10 message to be received. Although this is an accepted facet of the protocol, it is not particularly friendly when guests are staying at your house, since when they try to turn on the light, it appears to have not worked so they press the switch again and in doing so turn it off! To overcome this, many devices have a local switch that affects the light directly, without sending an X10 message to do so. This is mostly true for X10 light switches that act like a normal in-wall switch but not an in-place X10 socket that is controlled by an existing (that is, normal) light switch. Another problem that can occur with X10 is that of dead spots, where all messages can (and sometimes do) get swallowed because of the electrical noise generated by certain appliances. The power supplies for some MacBooks are known to have this issue. It is therefore sometimes necessary to move X10 devices to different sockets for them to work. X10 signals are also lost when there is a transformer in the circuit or you have a split phase system. Again, you may need to move both the transmitter and the receiver to the same side of the problem device. CHAPTER 1 ■ APPLIANCE CONTROL 4 ■ Note Before committing to an X10 installation, experiment with a couple of devices to ensure there is a location in the house that is capable of issuing an X10 message that can get heard in the vital majority of other areas. General Design Before buying and installing any devices, you must first consider what devices you want to control and how you want to control them. The important part of that question is not how many devices you will use but how they will be controlled. This can be as simple or as complex as you like. And there need not be a computer involved at all. Simple Case In this situation, your appliances will be controlled either by their local switches or by one or more wired controllers plugged into the mains. A wired controller is necessary here because you always need some way of introducing the X10 signals to the power line. There are some wired controllers (SD7233), which include timing circuits so they can automatically turn the lights on or off at particular times of day— sometimes within a randomized time frame to confuse potential burglars. These work well and provide a cheaper alternative to running a computer all day, every day. Other than the basic timer functions, this setup can only be controlled by a human making physical contact with the controllers. It is the cheapest way to begin an exploration into X10, but appliances cannot be controlled remotely via web sites or e-mail or wirelessly from handheld controllers. If aesthetics are important, there are some controllers (for example, TMD4, shown later in Figure 1-11) that will fit into a wall outlet, allowing you to use the existing light switches to control multiple lights without a Star Trek–like controller on the coffee table. However, this requires the purchase of both an X10 switch (to send the message) and an X10 light fitting (to respond to it) and is usually overkill for such simple setups. Standard Case The next step after the simple case shown earlier is to utilize wireless controllers. Most of the equipment on the market uses radio frequency (RF, at 433MHz), allowing devices to be controlled from the garden, through walls, through floors, and through ceilings. The precise range varies according the materials through which the signal is traveling, the other devices operating in the 433MHz range such as TV senders or RFID readers, and the strength of the transmitter, with some mid-price devices having a 25- meter range when unobstructed. Since RF has no connection to the power lines, it also requires the use of an RF-to-X10 gateway, which plugs into a wall socket, picks up the RF signals sent by any suitable controller, and places the data message onto the X10 power line. Although such devices have a configurable house code, their unit code is invariably hard-coded to one, so be sure to avoid using such a code for any devices if you plan on migrating from a simpler environment. Adopting an RF-to-X10 gateway in this way provides a lot more scope for automation, because controllers are wireless and no longer need to be situated next to a power socket, enabling them to appear in bathrooms where such sockets contravene domestic housing regulations in many countries by being within 1.5 meter of a water tap, as is the case in the United Kingdom, for example. There are RF controllers that stick to walls, sit on desks, and even fit on key rings! CHAPTER 1 ■ APPLIANCE CONTROL 5 The primary issue with RF remote control is that rogue transmissions are very difficult to filter out, 1 meaning someone outside could conceivably control your inside lights. Fully Automated The big difference between this and the standard automated example is the inclusion of a computer interface, generally the CM11, covered later and shown in Figure 1-14. This doesn’t have an X10 address, but it passively monitors the messages on the power lines and passes them back to the computer via the serial or USB port. Similarly, the computer can use the device to place new messages onto the power lines, which will be picked up by the devices you already have. Once a computer is involved, the possibilities open up. I’ll be covering these possibilities later in this chapter when covering the range of available X10 devices. It is perfectly possible to have a fully automated solution using the computer that doesn’t use RF wireless or suffer its problems. Instead of RF, you can use a more secure transport and protocol such as HTTPS through a web browser that could be on an iPod touch, iPhone, or other suitably connected handheld device such as a mobile phone to send the message to the computer, which is turn places suitable data on the power line. Assigning Addresses Since every automated device in your house needs an address, it makes sense to assign them something sensible and memorable at the start of the process. The most important thing to remember here is that your X10 configuration can grow as your budget increases, and you’re more likely to add a couple of new appliances in your house than you are to add a couple of new rooms! Determining a house code is simple enough. If you have a neighbor, or neighbors, with an X10 setup, then pick any letter that isn’t used by them. It might sound obvious, but you should talk to them about whether they have one and what codes they’re using. Just because you’re not seeing any irrational behavior at the moment doesn’t mean there won’t be a conflict in the future. I would also avoid using P, since some devices (the TM13UAH, for example) considers P as “accept message on any house code,” which could be confusing and problematic. My only other advice here is to avoid A, which is the default for most equipment. This has two benefits. First, it ensures that anyone “playing” with X10 devices in the neighborhood won’t accidentally stumble onto your network and cause mischief. The second is that by switching away from the defaults, you can be sure that the system was successfully reprogrammed and is not working temporarily by a happy coincidence. Producing assignments for the unit codes is a matter for your own judgment, but you cannot go far wrong by creating a pattern. I began by numbering my devices at 2 and worked around the rooms in my house in a counterclockwise order, starting upstairs and ending in the kitchen. I assumed two devices per room. My reasoning and thought processes were as follows: • Start at 2 because 1 is used by the RF-to-X10 gateway. • Two devices per room means each room starts at 2, 4, 6, 8, and so on, which is easy to remember. 1 A Faraday cage works but is not generally practical in a home environment! CHAPTER 1 ■ APPLIANCE CONTROL 6 • The only time I need to know the numbers by heart is when fumbling with the remote in the dark. This is when I’m in bed looking for a light switch. Since the master bedroom is upstairs, I start counting upstairs. And when lying in bed, I’m facing the rest of the house, with the second bedroom directly in front of me, and the third to its left, which makes a counterclockwise motion more natural. • If the split between upstairs and downstairs hadn’t occurred on unit code 8, I would have left a gap so that it did. • I split the lounge/dining room into two logical rooms, even though it’s one space. This means I can have up to four devices in the one space, which is likely to happen with larger open-plan areas. • The kitchen is more likely to gain devices over time, so I kept that last in the list. If you browse the selection of controllers available, you will notice that most have a selector switch that reassigns the buttons from 1–4 to 5–8, for example, or from 1–8 to 9–16. An alternate approach is to have the first bank (1–4, say) controlling only the lamps in the house, with the second (5–8) being used to control the appliances in the equivalent room, making it switch between “lamps and appliance” rather than “upstairs and downstairs.” This ensures that although the first bank is selected, it’s impossible to accidentally turn off an appliance when you mean to control the lights, and vice versa. The final consideration concerns the physical size of the controller modules you plan on using, since many support only eight devices. If your most convenient numbering system happens to use devices 9–16, then you will either have to rethink your pattern or buy only larger controllers. Using Multiple House Codes It is possible to have two or more house codes within a single property, bringing the total number of household devices up to a maximum 256. That’s enough for the largest of mansions! The only consideration with such setups is that a control message such as “all lights off” can be applied only to a single house code. For computer-based control, you can easily adapt the software to send two (or more) messages of the “all units off” variety, which affect all devices on the specified house code. However, if you’ve elected to use only stand-alone remote controls, such as the desktop controllers you will learn about later, this can require some fiddling as you switch off each house code in turn. In this case, you would probably want to split up the house codes into the first floor, second floor, and so on, and have a separate controller for each floor. Device Modules I’ll now cover the multitude of devices available on the market that can be controlled by X10, in other words, those that contain a receiver. These break down into three categories: Internal: Where the X10 receiver and the thing it controls are within the same physical form factor. An example is motorized curtain rails. Local control: The X10 receiver processes the message but controls the power to something directly wired into it. An example is light switches. Plug-in modules: These fit into a standard power socket, and an external device is plugged into them. The X10 logic determines whether to allow the flow of current between them. An example is appliance units. CHAPTER 1 ■ APPLIANCE CONTROL 7 Controlling Lights This is by far the most common type of device, and accordingly there are several different devices to choose from, all known in X10 parlance as lamp modules. However, it should be noted that some lights cannot be attached to lamp modules at all. These include the fluorescent lighting strips found in most kitchens and their compact fluorescent lamp equivalents (often known as energy-saving bulbs) now making their appearances in homes around the country. To make matters worse, these bulbs can also introduce spikes on the power line that can turn off nearby X10 lights. 2 The primary functional difference between the various lamp modules is whether the device in question supports dimming. When a light is dimmed, the alternating voltage is not reduced in amplitude. Instead, small portions of the power sine wave are removed, which effectively turns off the lamp for short periods of time. Consequently, the bulbs filament is charged and discharged many more times a second than usual, which creates a changing electromagnetic field. This can result in the filament starting to vibrate and creating an audible hum. This is not usually a problem with lightbulbs (and you can always buy rough service bulbs that hold the filament steadier to prevent this movement), but it is dangerous to other appliances that are not built for it. Note that many countries are phasing out the old incandescent lightbulbs. Lamp Module (LM12U) This is a simple affair that requires zero installation. You simply plug it into a free wall socket, set the address using the dials on the front, and plug your lamp into the socket on the front, as shown in Figure 1-1. Figure 1-1. The LM12U lamp module, 122 × 52 × 42mm 2 You can witness the noise introduced by observing the oscilloscope traces shown at http://jvde.us/x10/x10_cfls.htm. . the transmitter, with some mid-price devices having a 2 5- meter range when unobstructed. Since RF has no connection to the power lines, it also requires the use of an RF-to-X10 gateway, which. affects the light directly, without sending an X10 message to do so. This is mostly true for X10 light switches that act like a normal in-wall switch but not an in-place X10 socket that is controlled. unit code is invariably hard-coded to one, so be sure to avoid using such a code for any devices if you plan on migrating from a simpler environment. Adopting an RF-to-X10 gateway in this way

Ngày đăng: 03/07/2014, 20:20

Mục lục

  • Prelim

  • Contents at a Glance

  • Contents

  • About the Author

  • About the Technical Reviewers

  • Acknowledgments

  • Introduction

  • Appliance Control

    • Making Things Do Stuff

    • X10

      • About X10

      • General Design

      • Simple Case

      • Standard Case

      • Fully Automated

      • Assigning Addresses

      • Using Multiple House Codes

      • Device Modules

      • Controlling Lights

        • Lamp Module (LM12U)

        • Bayonet Lamp Module (LM15EB)

        • Wall Switch (LW10U)

        • MicroModule with Dimmer (LWM1)

Tài liệu cùng người dùng

Tài liệu liên quan