Interfacing with the X10

Hi,

I just bought the PL513 X10 powerline interface and the PLM03 lamp module. I'm trying to follow the X10 library sample codes verbatim, but I'm having issues. I have my lamp plugged into my lamp module into the wall, and my X10 PSC04 plugged in to the wall with the RJ11 telephone jack coming out of it. I stripped it and plugged the yellow wire into pin 9 (zcPin) and the black one into pin 8 (dataPin). I upload the code to my arduino and nothing happens to the incandescent light I have plugged in. I tried it on two different wall sockets.

Have I missed a step/am I doing something wrong? I made sure the house code is matching on my lamp module and code. The library is in the proper directory. I'm using the x10_fade, and x10_blink as tests.

Any advice would be greatly appreciated. Thanks.

Ernie,

You didn't mention that you connected the 2 grounds from telephone jack to the Arduino ground pin. (See the 2 middle pins in this diagram on this page - http://www.arduino.cc/en/Tutorial/X10)

Another thing to check is the cable. Some phone cables cross over the pins and some do not. If you hold the two ends of the cable together you can tell.

Thanks for the quick reply. I have my other two wires into the 2 Gnd pins on the opposite side of the Duemilanove, where it says POWER. What exactly do you mean by cables crossing? The 4 wires are color coded so I’m matching up what I see on the side with the plug and the bare wires on the other end.

Ernie,
Sorry - I didn’t notice that you removed the RJ11 on one side of the cable - in that case, checking if the cable is crossed over or not doesn’t matter.

I’m trying to follow the X10 library sample codes verbatim,

Actually, the example code uses pin 2 for zcPin and pin 3 for the dataPin. I’d try that. Pin 2 is an interrupt pin and (maybe) should be used for the zero crossing. (Looking at the lib, it doesn’t seem to be, but it’s a quick test.)

Wire colors may vary, but I think you should wire it:
RJ11 pin 1 - BLK - zcPin - PIN 2
RJ11 pin 2 - RED - Gnd - Arduino ground
RJ11 pin 3 - GRN - Gnd - Arduino gnd (ONLY IF USING PL513 - used for receive on the PSC05/TW523)
Rj11 pin 4 - YEL - dataPin (xmit) - PIN3

If you have some type of X10 controler it would be good to test if you could turn the lamp on and off from that. Maybe the switch is off!

Otherwise, I don’t know. The example works, and it’s been around for years.

Which makes me wonder . . . - try this:

  • close the IDE
  • go into your Arduino folders - hardware|libraries|x10
  • delete x10.o
  • restart the IDE & try again

Ah nothing worked :|. Tried every combination of the pins. Used the 9, 8, the 3, 2, deleted x10.o files, started it with the light switched on, light switched off, etc etc etc. I guess its just not wanting to work for me.

Any last ideas? Thanks for the help again.

One more thought. X10 doesn't always work reliably across both phases of your mains. So try plugging the PLM03 and the PL513 into the same power strip or socket.

If that doesn't work think about how you could debug your code. With an LED and resistor you might be able to see a dimmer amount of light when it's connected to the zero-cross line. You might be able to see a flicker when it's connected to the data line.

Again, if you had or could borrow an X10 transmitter (keypad) that would help you troubleshot.

I bet it's something simple.