Shop OBEX P1 Docs P2 Docs Learn Events
X10 power line interface to BS2 Question! — Parallax Forums

X10 power line interface to BS2 Question!

Engineer09Engineer09 Posts: 16
edited 2009-03-11 22:01 in BASIC Stamp
I am working on a home automation system for a college EE design project. The idea is to dispense different fragrances depending on a person's mood. The first step was to test the X10 modules I ordered. The power line interface is: PSC04 and is said to be functionally identical to the PL513, which the Stamp reference manual recommends for use with the BS2. I connected this module using the reference manual schematic using RJ11 phone cable. I connected this to the outlet and connected an x10 module with a lamp to the outlet. I used the sample code in the reference manual to see if the x10 module would respond. The appliance does not respond. Also, the x10 modules seem to be in "default-on" mode, meaning the appliance is on when connected to the x10 module. I tried sending an OFF command but no response as well. Also, I tested to see if the BS2 was connecting to the interface module by putting a DEBUG command after it. The reference manual stated that if the BS2 fails to establish contact with the power line interface, the program will stall. After a second or two, the debug message appears. I know it not a wiring quirk of my house as I have tested in two houses. IS the interface module I am using now - the PSC04 - incompatable with the BS2?· Also, the x10 modules I am using are AM486.· Also, has anyone tested the schematic in the referencer manual? Because I did find one error in the command section for ALLOFF.·Any help is greatly appreciated as this project is on a tight deadline.· ·


Erik

Comments

  • remmi870remmi870 Posts: 79
    edited 2009-02-24 10:25
    is the outlets that your connecting your module to on the same circuit phase? you can test this by plugging a extention cord in one outlet, the outlet the appliance module was plugged in, then run it over to the outlet your pluging your line module in and test the voltage(with the propper volt meter that can handle at leats 250vac) across the two smaller plugs, these are the hot, you should not get more than a half a volt at best, if you get something between 220-240, then your off one phase and may not be getting the signal to the appliance module.
  • allanlane5allanlane5 Posts: 3,815
    edited 2009-02-24 15:16
    Personally, I prefer the "Firecracker" RF module, to interface the BS2 with X10 stuff. Benefits are it's reliable, it doesn't require wired connection, and it's pretty low power. And it's pretty cheap -- for $20, you can get a kit with the module, the RF-link box, an RF-remote for testing, and an AC module for testing. Oh, and you can plug it into a PC for testing as well.

    I believe there's an already existing set of BS2 code to work with the Firecracker, too.

    The PLS513 stuff tends to require VERY close timing to get it to work.
  • LilDiLilDi Posts: 229
    edited 2009-02-24 17:35
    There is a very good chance the RJ11 cable you need to use is not a standard phone cable, but a custom pinout cable. Also, I would not use a standard phone cable because the wires inside the cable are wound around a center nylon cord for strength and flexibility. The wires wrap around and around and around the entire length of the cable like a spring around the nylon core. Could cause unwanted inductance, and capacitance, not to mention the true length of the wire is severeral times longer than the length of the cable, in case there are cable length restrictions.
  • MikeKMikeK Posts: 118
    edited 2009-02-26 00:07
    If you've got a 4-wire straight-through RJ11 cable, then the pinouts on the RJ11 jacks will be reversed left-to-right if you're looking at both jacks from the same direction (that is, pin1 on one jack will be on the left, but on the other jack it will be on the right). It took me a while to figure that out when I built an X-10 controller to talk to the power line interface. Be sure you've actually got the correct wires connected to each other through the cable.

    Mike
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-02-27 15:11
    This Subject prompted me to pull out my PL513 (X10 powerline interface.)· Worked like a charm.· I'm successfully controlling an AM466, 3-pin grounded appliance module, set as "A-1",·using the attached program.

    (You can't use a "lamp module" with a C-F-L.· The lamp modules accept dimming codes, but C-F-Ls aren't dimming-compatible.)

    One end of my cable is the RJ11 and the other is terminated in a SIP jack.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-02-27 15:50
    Found a problem.
    It works right after the BS2 gets programmed and each time with the reset button.· However, it didn't work from a cold start (BoE slide switch.)· [noparse][[/noparse]Insert Sam Kinison scream here.]
    Got it to work right from the get-go by adding a PAUSE at the beginning of the program.
    Zpin    PIN  0      ' Zpin = P0
    Mpin    PIN  1      ' Mpin = P1
     
    HouseA  CON  0      ' House Code A = 0
    Unit1   CON  0      ' Unit Code  1 = 0
     
    OUTPUT 7            ' P7 = on-board confirmation LED
    OUT7 = 0
     
    [color=red]PAUSE 500[/color]
     
    Main:
      XOUT Mpin, Zpin, [noparse][[/noparse]HouseA\Unit1]  ' Attn
      XOUT Mpin, Zpin, [noparse][[/noparse]HouseA\UNITON]
      OUT7 = 1
      PAUSE 5000
      XOUT Mpin, Zpin, [noparse][[/noparse]HouseA\Unit1]  ' Attn
      XOUT Mpin, Zpin, [noparse][[/noparse]HouseA\UNITOFF]
      OUT7 = 0
      PAUSE 5000
      END
    

    Post Edited (PJ Allen) : 2/27/2009 3:57:08 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-02-27 17:19
    Well, that wasn't it either.
    It's something about using END.· I saw that the PL513's LED was blinking.· So, I said, "A-ha, that's an END, low-power-mode thing."· When I changed that to STOP then there was no further problem and the program as originally posted works right from a cold start.

    Post Edit -- Something else: the Z_pin pull-up resistor.· I think that it should be 2K.· I had switched to a 2K before I had my "a-ha moment."· Going back to the 10K made for trouble again.

    Post Edited (PJ Allen) : 2/27/2009 8:52:17 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-02-28 19:33
    I guess Engineer09's attentions are elsewhere.·

    Howbeit, I wanted to post that I'm really having a good ol' time with this X10 deal.·

    The Stamps' XOUT feature is unique to this product line (SX doesn't have it, neither does the Propeller.)

    The required PL513 powerline interfaces are only $20.· The modules (both lamp and appliance) are < $15, good hi-current SSRs cost more than that.· There are packages where they really drive the prices down, too.·

    They ship quickly.
  • MikeKMikeK Posts: 118
    edited 2009-03-01 20:35
    Check E-bay for X-10 modules. A couple of years ago I picked up 5 PSC-04 modules for $20, including shipping.
  • stampsterstampster Posts: 2
    edited 2009-03-10 04:44
    PJ - thanks for following up, even though it appears Engineer09's EE paper (and thus interest) has passed... I am also working with X10 and BS2. I too had a similar experience to Engineer09, where I am fairly certain I had everything correct (I built the board the BS2 sits on, which also includes an RTC, external EEPROM, and various other components, so I'm pretty sure I can confirm something as simple as my RJ-11 cable was good.) Anyway, when I thought I had it wired correctly, the red light was lit, and when I send commands it flickered - but I got ziltch from the X10 appliance controller it was supposed to trigger. Meanwhile a manual X10 controller plugged into the same outlet as the PL513 turned the same module on and off flawlessly. I debugged the **** out of the command, and I'm as sure as I can be that the house/device code is set correctly, but it still won't work.

    As a last ditch attempt to fix the problem, I decided to test if I had the pins reversed, and reversed the connection at the CPU. (Stupid, should have verified the voltages first.) Anyway, with the controller pins reversed, I got solid LED off on the PL513 (which I took for not good right away, and pulled the plugs). Since then, even with the pins reversed back to what I'm fairly certain is correct, the PL513 is pretty much brain dead, as soon as any RJ45 cable ending in a receiver chip it is plugged in the LED goes off, and on examination the box has the all to familiar smell of burnt-IC.

    MY real question, though, is this: have you ever seen this issue, in accidentally reversing the P0 & P1 pins on a PL513? If that's the result of screwing up I'm happy to shell out another $20, but if this thing isn't ultimately ever going to work then I don't want to waste any more time on it. Any feedback is appreciated.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    GLOSSERY:

    Infinite Loop:
    ··· See Loop
    Loop:
    ··· See Infinite Loop
    Recursion:
    ····See Recursion
  • JonathanJonathan Posts: 1,023
    edited 2009-03-10 15:28
    Stampster,

    I have a Powerhouse brand PL513, and it has worked fine for me in the past. I gave away the aquarium is was used in and have not yet re-employed it so I can't easily test it ATM. And no I won't hook it up backwards and see if it blows up. [noparse]:)[/noparse]

    However, I *think* I have accidently hooked it up backwards. Or at least I'd be suprised if I hadn't. [noparse]:)[/noparse]

    I used, IIRC, a 4.7k pullup on mine. I also seem to recall that I had to send the commands more than once to get it to work reliably. They do indeed work, I'm not sure what is going on for you. One thing I found is that running some loads were a problem. For example, the main light for my aquarium (a 500W CF unit) would turn on when commanded, then turn itself back off. I had to use a relay to switch it without problems.

    Anyway, as far as I know, the PL513 works with the Stamps.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-10 17:08
    I recently purchased some PSC04s.· Everything is good with them, too.· Same, same; never a command more than once.·

    I haven't hooked any up "backwards".·

    I'm working appliance modules, on/off (clunk, clunk.)· I have a lamp module, it on/offs the same, no programming changes, swapping units out,·but I haven't done any dimming with it.
  • Engineer09Engineer09 Posts: 16
    edited 2009-03-10 17:23
    I figured out what was wrong·with the X-10 control by BS2.· Also, terribly sorry for not checking in more often; once I solved it, I forgot to post.· It's actually an embarassingly simple mistake I should have noticed earlier; the sample code provided in the Basic Stamp Reference Manual does not work with the provided schematic.· MPin, the modulation pin, or output pin to interface, is given as Pin 0, but the schematic has the output pin as being Pin 1.· Likewise, the sample code has the Zpin, or zero-crossing detect pin, as Pin 1, whereas the schematic has it as being Pin 0.· Bascially, they are switched around.· Pins 2 & 3 - the middle two - are fine as both go to ground.· I tested with my current interface - the PSC04 (i think it is the updated version of the recommended PL513) and it works great.· Was able to control a couple of lamps to test that it works.·

    So, to be clear, looking at the bottom of the interface, from left to right, 1 to 4:
    1. zero crossing detect
    2. common
    3. common
    4. input from bs2

    Thanks for suggestions - if you are still having problems, ill be checking back more often.
  • Shawn LoweShawn Lowe Posts: 635
    edited 2009-03-10 17:39
    As an exercise I looked up the connections on the web. Engineer09 is correct:

    PSC04
    1. Zero Crossing Detect
    2. Zero Crossing Common
    3. X10 Common
    4. X10 Data Input from OEM

    PL513
    1. ZERO CROSSING
    2. ZERO CROSSING COMMON
    3. RX
    4. TX

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    When all else fails.....procrastinate!
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-10 19:21
    In the IDE 2.2 and·2.3·(PBASIC Help) examples it's: Z_pin, P0, pulled-up, to PL513_p1; M_pin, P1, to PL513_p4; PL513_p2,3 to GND.· The schematic and example program are consistent.·

    My program works it that way, too.·

    The IDE examples in 2.3 and 2.4·list:

    Mpin PIN 1
    Zpin PIN 0
    

    That's "counter-intuitive", having·1 then 0.


    I would prefer that they'd listed it (as·it is in·2.2):
    Zpin PIN 0
    Mpin PIN 1
    


    Perhaps that's the source of the "mis-cue."
    ·
    Post Edit -- The PL513 and the PSC04 are the same; same functions, same pinouts.· Neither the PL513 nor the PSC04·has a RX on its pin_3, that is on the TW-523.·

    http://www.x10pro.com/pro/pdf/ademco_plc_wiring.pdf

    N.B. -- If anybody is ever looking for a UL-listed zero-crossing detector, that's what the signal on the PL513/PSC04 pin_1 provides.

    Post Edited (PJ Allen) : 3/11/2009 1:29:15 AM GMT
  • stampsterstampster Posts: 2
    edited 2009-03-11 22:01
    Thank you all for your input and assistance as well.· Based on your feedback I went ahead and bought another module (PSC04 this time, from a different source than actual X10 website) and with absolutely·NO changes at all to either my code, my circuit, or the cable I was using before, it works like a champ.· Must've got a dud PLC513 from X10.· Oh well, problem solved.· (And working very reliably @ single command / 5 cycles)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    GLOSSERY:

    Infinite Loop:
    ··· See Loop
    Loop:
    ··· See Infinite Loop
    Recursion:
    ····See Recursion
Sign In or Register to comment.