Don's Home Automation Secrets

The Secret of Solving X-10 Collision Problems

Collisions are the biggest problem that you can run into when using X-10. The lessons learned page will explain a lot of this but I have discovered a secret on how to design your house.

Since I am a computer scientist by training, I have studied protocols involving bit-errors. Data bits can be corrupted unless there is an error correction system in place. All X-10 messages are binary data sent over AC lines, and X-10 does NOT have an error correction system. When bits get changed due to interference, you are usually out of luck. Lights turn on/off as if the house is haunted.

Most of the time, only one bit gets changed. This could mean that a House Code (A-P) or Unit Code (1-16) that you wanted to control gets missed, and some other device is controlled. If you are trying to control device A5, the result could be nearly any other addressed device.

If we only consider the HC or UC, then a 1-bit error is actually a 25% error in 4 bits.

It takes a LOT to have a 2-bit error, which is effectively a 50% error in 4 bits. It does happen, but not anywhere near as often as a single bit error. Can you imagine how much noise is needed on the AC line to get this high an error rate?

Thus we get an opportunity to use probability to reduce the chance of bit errors.

The House Code and Unit Code of a house can be designed so that most single bit errors just disappear, and odd behavior only happens on those really rare 2-bit errors. How does it work? For X-10, all devices have uses these address codes for a total 8-bit address. Here is the bit-wise mapping:

 

House Code

 

 

Unit Code

 

 

Binary Value

 

 

A

 

 

1

 

 

0000

 

 

B

 

 

2

 

 

0001

 

 

C

 

 

3

 

 

0010

 

 

D

 

 

4

 

 

0011

 

 

E

 

 

5

 

 

0100

 

 

F

 

 

6

 

 

0101

 

 

G

 

 

7

 

 

0110

 

 

H

 

 

8

 

 

0111

 

 

I

 

 

9

 

 

1000

 

 

J

 

 

10

 

 

1001

 

 

K

 

 

11

 

 

1010

 

 

L

 

 

12

 

 

1011

 

 

M

 

 

13

 

 

1100

 

 

N

 

 

14

 

 

1101

 

 

O

 

 

15

 

 

1110

 

 

P

 

 

16

 

 

1111

 

When you examine the binary codes, you can see that both the house code and unit code is made of 4 bits, and when combined that gives us 8-bits. To minimize errors, we need to ensure that the difference for each of the house and unit code used in your house differs by 2 bits.

Through calculation and experimentation, I have found that the following table of house codes and unit codes minimizes the number of errors. Use ONLY codes from this table, and your house won't be haunted -- at least as often.

 

House Code

 

 

Unit Code

 

 

Binary Value

 

 

A

 

 

1

 

 

0000

 

 

D

 

 

4

 

 

0011

 

 

G

 

 

7

 

 

0110

 

 

J

 

 

10

 

 

1001

 

 

M

 

 

13

 

 

1100

 

 

P

 

 

16

 

 

1111

 

By looking at the binary values, you can observe that every one differs from every other value by at 2-bits. This is the secret!! Use these codes, and interference induced errors will be minimized!

One side effect is that this solution reduces the total number of manageable devices to 36, and requires a RF interface for each house code controlled wirelessly. For most homes, this will not be a problem.

After publishing this page I did receive input that the mapping of bits isn't as I've shown above, but in some kind of offset pattern. While this is a most interesting input, it is evident from practice that separation of zones with 2 unused zones between the ones with controllable devices will reduce the potential for problems. I do use intervening house codes for other purposes such as codes to match with smart wireless devices (non-X10) or other program activation's. This has worked well.

Home Page Toyota MR2 Amateur Radio

Last Updated: 2011 January 7