Shop OBEX P1 Docs P2 Docs Learn Events
X10 Object — Parallax Forums

X10 Object

darcodarco Posts: 86
edited 2009-11-13 21:08 in Propeller 1
Just in case anyone else is interested... I noticed that there wasn't an object on obex for sending X10 codes with a PSC05 X10 powerline interface, so I wrote one and uploaded it.

obex.parallax.com/objects/461/

With this object you can use a PSC05 to send X10 codes to turn on/off lamps, appliances, etc. I don't yet have receive support implemented (as I don't immediately have the need), but I may do so sooner if other people are interested.

I wrote this for an ethernet-to-X10 bridge program that I am writing for the ybox2.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

darco
www.deepdarc.com/
[url=mailto:xmpp:darco@deepdarc.com]xmpp:darco@deepdarc.com[/url]

Comments

  • JonnyMacJonnyMac Posts: 9,195
    edited 2009-05-26 19:47
    That's interesting. I wrote X10 output and input drivers for the SX -- will have to try to port them to the Propeller now. Thanks for the head start.
  • MikeSMikeS Posts: 131
    edited 2009-06-05 01:29
    darco,
    I am trying to implement your X10 object into my project. I have a PL513 which is basically the same module as the PSC05 except for being able to receive codes. My question is how did you connect the PSC05 to the Prop? The I/O pins for the PSC05 and PL513 are +5 volts and when using these modules with a STAMP the Zpin requires a pull-up to +5v.

    Has anyone else used the Prop for X10 control via a power-line module?

    Thanks,
    MikeS
  • darcodarco Posts: 86
    edited 2009-06-05 05:47
    The PL513 looks to be the same device as the PSC04, which you should be able to drive just fine with my X10 object.

    I've had no problems using 3.3v on the PSC05 instead of 5v. 3.3v seems to drive the opto-iolators inside of the PSC05 just fine. You still need the pull ups. Just have a look at at page ten of the PSC05/PSC04 technote for the suggested wiring. Since I'm lazy, I didn't use a transistor or the diodes. Works great.

    As long as you don't have a super-long cable between your prop and the PSC05 (or equivalent) then it shouldn't be a problem. My cable is around 2 meters and works fine at 3.3v.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    darco
    www.deepdarc.com/
    [url=mailto:xmpp:darco@deepdarc.com]xmpp:darco@deepdarc.com[/url]

    Post Edited (darco) : 6/5/2009 5:55:09 AM GMT
  • MikeSMikeS Posts: 131
    edited 2009-06-05 13:39
    Thanks darco, I'll give it a try

    Mikes
  • MikeSMikeS Posts: 131
    edited 2009-06-06 02:18
    narco,

    I have it hooked up as you indicated. Would you look at my code and see if I'm implementing it correctly?
    {{X10 demo
    connect propeller to PL513 interface to control lights
    began 6/4/2009
    }}
    con
     _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    zcPin = 13 ' ZERO CROSS OVER
    inPin = 14 '  INPUT NOT USED
    outPin = 15 '[noparse][[/noparse]MODULATION PIN
    house_b =   %1110
    unit_03 = %00100
    cmd_on = %00101
    cmd_off = %00111
    
    var
    
    
    obj
    x10 : "X10"
    
    
    PUB START
    X10.start(zcPin,inPin,outPin)
               
      X10.send_to_unit(house_B,unit_03,CMD_on)   'turn on House B, Unit 3
    repeat 5
     
      waitcnt(clkfreq + cnt)             
    
    X10.send_to_unit(house_b,unit_03,CMD_off)    'turn off House B Unit 3
    
    
    
    




    thanks,
    MikeS
  • darcodarco Posts: 86
    edited 2009-06-07 00:14
    Looks OK to me. Is that working for you?

    Did you know that you can use constants which are defined inside of other objects? IE: You can do this:

    X10.send_to_unit(X10#HOUSE_B,X10#UNIT_03,X10#CMD_OFF)
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    darco
    www.deepdarc.com/
    [url=mailto:xmpp:darco@deepdarc.com]xmpp:darco@deepdarc.com[/url]
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-06-07 04:59
    Darco, glad to see you here.
    I will have to look at the X10 module.
    Glad you are back.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • datsun2literdatsun2liter Posts: 5
    edited 2009-06-12 03:25
    What i need is to recieve x10 with the YBox2, so i can tell what units are on..

    anyone gotten the "box" to receive x-10..

    redface.gif
Sign In or Register to comment.