Problems with x10 program

I downloaded and installed the x10 library. I tried to run the x10_blink example, but it seems to crash when it hits the first x10 command ( myHouse.write(A, ON,3);). I came to this conclusion because the Serial.println(“Lights on:”); command will send back “lights on:” in its current placement but nothing after that is sent back from the board and if you place that same command right after the myHouse.write(A, ON,3) command it won’t come back.

I am using the Arduino Duemilanove with the Arduino 16 app in OS X and version 0.3 if the x10 library.

Any ideas?

Just a shot - try deleting the .o file in the X10 lib and restart the IDE or toggle the board type. (FWIW it works for me with REL15)

What device are you using - PL513/TW513 or PSC05/TW523 ? (Slight difference in connections)

That did solve my problem of the program hanging. My X10 transmitter still isn't getting a valid command, but I will try to figure that out. What does that .o file do?

I am using the PSC05.

The .o (.obj) is the compiled lib. It could have been compiled with a different ver of the IDE. Removing it creates a fresh version.

Since you are using the PSC05 you can also receive X10 using this code . . .

I also have a blog on X10 and the Arduino . . .

Good luck

Are there any other special connections needed for that board. I found it needs a pull up resistor on the zero crossing pin and I have one on the transmit pin as well. I just left the receiving pin disconnected.

Yes, I was reading those articles. Thank you for your work.

I just use the internal pull-ups on the two input pins - i.e.

  pinMode(RCVE_PIN,INPUT);              // receive X10 commands - low = 1
  pinMode(ZCROSS_PIN,INPUT);            // zero crossing - 60 Hz square wave
  digitalWrite(RCVE_PIN, HIGH);         // set 20K pullup (low active signal)
  digitalWrite(ZCROSS_PIN, HIGH);       // set 20K pullup (low active signal)

I don't use a pull-up on the Transmit pin.

Sorry for resurrecting this old thread, but I am having the exact same problem described in the original post. I tried deleting the x10.o file, and it did not fix the problem for me. Are there any other solutions to this problem?

I am also using OS X with Arduino 16, and version 0.3 of the X10 lib, and the Arduino Duemilenove with the PSC05.

Thanks for any help!

Edit: And, of course, I found what was hanging it up after posting this. Once I set the zero crossing pin to high for a pullup (digitalWrite(zcPin, HIGH); ), it seems to be working. Nevermind!

I am having this same problem. I have tried using the Arduino provided code and the Brohogan code and both will put out "Lights on" in the serial monitor but it does not send the signal to my psc05. I upgraded to the latest version of the Arduino environment made sure that my pins were connected correctly to the interface. Any more suggestions to make it run continuously and send the signal to my appliance module? Oh and I am using the psc05 and Arduino Duelmilanove Atmega328. Thanks...

I've got everything set up with my Uno and Tw523, but can't get my lamp module to turn on. :-[ I'm looking at the zero crossing and data lines with a scope and can manually decode the signal so I'm pretty sure that is good.

I think my problem may be the dataPin output of the Uno only goes to 1 volt. My TW523 spec sheet shows the minimum logic 1 as 4 volts and max as 20V. I'm toggling Pin 2 for reference and it goes to 5 volts.

From what I've read I was under the impression I could connect the Uno directly to the TW523. I've also plugged in a 500mA, 12VDC power supply to the Uno which didn't help.

Any comments or suggestion would be much appreciated.




Like anything having to do with comm, in the beginning there are a bunch of variables that will totally keep it from working. Comm stuff never seems to "almost work".

I know you checked your connections 1,000 times, but read through this thead if you haven't . . . There's some little hints there.

I assume - you set the House and Unit code on the lamp module to match the code. - the switch on the lamp is ON, and the bulb is good.

If you switch on the lamp (manually) it should come on. The lamp modules use a triac so you won't hear a click like the Appliance modules

By dataPin you mean the output that goes to pin 3 of the x10? Is that what you're scoping? I don't know how many volts P2P you should get, but 1V seems low and maybe points to it being attached to the wrong pin. Unplug the TW523 and scope it again.

You're using the X10.lib and X10_blink example?

It's probably going to turn out to be a forehead slapper. John


Thanks for getting back to me. I checked and rechecked my wiring. Questioned what was an input, what was an output. Turns out I commented out two line of code and all was good. I now have a very nice 5V signal going to my TW523 and my light turns on and off. :slight_smile: Seems to behave with or without a 10K pull up resistor.

pinMode(zcPin, INPUT);
// pinMode(dataPin, INPUT);
// digitalWrite(dataPin, HIGH);
digitalWrite(zcPin, HIGH);

Do you have any idea why this works on the zero crossing output and not on the transmit line?

Thanks again,


Glad to hear you got it working.

You're using the X10.lib and X10_blink example?

  • no response, so I don't know what you were using for a code example or wiring diagram.

Assuming wiring from here . . . that diagram is OK only for the TW513 one-way X10 controller, but if you want to use the receive ability on the TW523 you need to wire it differently. The diagram in that link has a 10K pullup on the "dataPin". That may be OK but wherever you got your code from also sets an internal pullup. So you had 2.

But what's worse, is that wherever you got the code from sets the "dataPin" (xmitPin) as INPUT and you need to output to that pin. That's why it works after commenting it out.

FWIW, I don't use any external pullups and I only set the internal pullups for the Zcross and "receivePin" (a pin you may or may not be using.).

Good luck with your project.

I am using the X10.lib and a modified verision of X10_blink.

My wiring digram did come from

The code I copied was from your #7 post above. But now I see the errors of my ways! I need to pay a little more attention to what are the inputs and output.

The code now reads....

pinMode(zcPin, INPUT); pinMode(dataPin, OUTPUT); // Pin to SEND X10 code from the Arduion to TW532 // digitalWrite(dataPin, HIGH); digitalWrite(zcPin, HIGH);

It works fine if I don't set the dataPin to OUTPUT (must default to OUTPUT).

As far as the TW523, I'm not going to worry (confuse) myself with receiving X10 commands until I get a little more proficient with sending and the Arduino in general.

Thanks again for all your help. Both here an your other resources.


p.s. My goal is to use the Arduino and various modules to replace my current home control system. My current setup is Circuit Cellar HCS II, with a X10 PL-Link module, IR-Link, LCD-Link, ADIO-Link, etc. Anyway it's out of date and no longer supported so I'm trying something new.


Thanks for getting back on this.

My goal is to use the Arduino and various modules to replace my current home control system.

That was mine too, and it was accomplished with the Nex10 gizmo I made. Being able to receive x10 and process them with the Arduino was key for me. When you get to that point, there are now several libs that will help you do this (as mentioned in my blog). Good luck with you project and let me know if I can help. :-X


I'm having some issues with Arduino and X10 also.

Trying to controle some A10 (Xanura) micro modules. Using a Marmitek X10E (yeah 50hz) and a Xanura PMIX35 programmer / measurement interface to monitor the powerline.

I've been testing the contents of the zip from while is currently unreachable for me.

I've noticed some settings need to be redefined for 50Hz usage

define OFFSET_DELAY from 500 to 800

define HALF_CYCLE_DELAY from 8334 to 10000

which i did.

If i'm not mistaken the folloing definition should be correct: Black - Zero crossing Red - Ground/Common Green - Receive (from powerline to arduino) Yellow - Send (from arduino to powerline)

I am able to send some commands, but the program halts until i disconect the black whire. Then some X10 commands are sent out to the X10E, but not very stable.

Need to connect/disconnect the ZC to be able to send some more x10 commands.

The colors of the wire for an RJ11 do not mean anything. At least in the US, telephone cables are often a crossover - so the order of wires depends on which connector you cut off. Use the pin #'s coming your X10E.

I am able to send some commands, but the program halts until i disconect the black whire. Then some X10 commands are sent out to the X10E, but not very stable.

Just read that. So it is working sometimes?

It’s a straight wire, pins 1-4 black/red/green/yellow, holding the pins upwards.

Yes i am (was) able to send x10 commands sometimes.

I’ve just added a 10k resistor between black (ZC) and 5+ and removed a 10k resistor between yellow (send) and 5+ which seems to help.

Does anyone has the send/receive combined package from ?

Site has been down for quite some time