Shop OBEX P1 Docs P2 Docs Learn Events
Will X10 Firecracker Work With BS2 Serial Port? — Parallax Forums

Will X10 Firecracker Work With BS2 Serial Port?

BrianZBrianZ Posts: 28
edited 2012-03-13 13:56 in BASIC Stamp
I have a little X10 "Firecracker" radio transmitter module CM17A (see http://kbase.x10.com/wiki/Firecracker) which plugs into my PC's 9-pin serial port and works with a software interface to turn on/off lights in the house controlled via a transceiver plugged into the AC wiring. I'm wondering if this little serial port transmitter can be plugged into the serial port of a Basic Stamp board and used with commands sent from the BS2? I have seen where others have wired a microcontroller into a handheld remote that sends the same radio signals (http://www.camelspit.org/modified-x10-rf-transmitter/), and the X10 protocol and command codes have been documented (http://ww1.microchip.com/downloads/en/AppNotes/00236B.pdf), though I'm not sure of the Firecracker is any different in its serial commands or whether the hardware is directly compatible with the BS2. I would guess the hardware is compatible since both devices are made to plug into a PC 9-pin serial port.

I would like use use the empty serial port on my BS2 board to plug in the Firecracker for turning off/on the room light each time my BS2 program runs. My program currently delivers two drops of water with relatively precise timing for creating drop collisions to be captured using high speed flash photography (see my setup here: http://flic.kr/s/aHsjysQBPW ). I need to turn off the room lights before photographing the drops to allow the flash to capture the image, however I frequently tweak the input settings for drop size and time between drops as well as make changes with my lighting setup, and I need to turn on the light to see both input switch settings and my other gear so I don't trip over light stands etc in the dark. So I thought since I already have a Firecracker, maybe I could use it to automate the light switch before each photo.

Does anyone know if this should work, or better yet, have examples of the serial commands in PBasic to send to a Firecracker to turn a light off and on? I have found a user article here at http://www.parallax.com/tabid/325/Default.aspx which shows some sample code. They are using the X10 direct power line interface, not a radio transmitter, however it appears to be serial commands, so I wonder if the firecracker could use the same code?

I also wonder how I can see what data the Firecracker software is sending to the PC's serial port when I press a GUI button on my screen to turn a light on or off.

Comments

  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-03-07 12:32
    The Firecracker uses changes on the DTR and RTS pins to determine what to transmit. It is designed to pass "normal" data thru which is why it has male female DSUB connections.

    You might find some useful info and code in my X10 Firecracker project http://forums.parallax.com/showthread.php?137258-X-10-Automation-via-the-WEB
  • BrianZBrianZ Posts: 28
    edited 2012-03-07 16:41
    Thanks, I will check it out.
    I also found some good info here: http://www.flickr.com/photos/linux-works/3399776581/ and here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1217562002
    From what I've read so far, it appears I would need to connect Stamp I/O pins to the firecracker DTR and RTS lines at pins 4 & 7 respectively, so the BS2 port would not work directly, though it seems possible to communicate with the Firecracker with the right programming. Hopefully I will find further help with that in your info, so thanks again.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-03-07 16:54
    BrianZ wrote: »
    Thanks, I will check it out.
    I also found some good info here: http://www.flickr.com/photos/linux-works/3399776581/ and here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1217562002
    From what I've read so far, it appears I would need to connect Stamp I/O pins to the firecracker DTR and RTS lines at pins 4 & 7 respectively, so the BS2 port would not work directly, though it seems possible to communicate with the Firecracker with the right programming. Hopefully I will find further help with that in your info, so thanks again.

    The attached BS2 code in the initial post is pretty straightforward. The code under Send_X10 and below is what you should study.

    Good Luck!
  • BrianZBrianZ Posts: 28
    edited 2012-03-09 08:53
    Thank you very much, Ron! I believe I now have all the info I need thanks to you for posting that link.
    The first link you referenced in your article was also most helpful to get another useful thread where MikeS posted that Firecracker.pdf document, which is a nicely documented article from 12 years ago explaining the Firecracker protocol with sample code, upon which the others appear to be based. MikeS's code in that thread also was easy for me to follow, since it uses just a single X10 house/unit code in the BS2 program.

    Looks like I should be able to easily install a male DB9 port onto my project box with 3 wires to the BS2 board and add some code to my program for turning the X10 lamp module off & on, then just plug in the Firecracker and I'll be ready to go. I may add a switch to have the option to deactivate the Firecracker, or I suppose I could just unplug it if I want to keep the lights on.
    Now I also know how one could set up a web-accessible x10 remote - very cool.
    Thanks again for all the great info.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-03-09 09:39
    BrianZ wrote: »
    Thank you very much, Ron! I believe I now have all the info I need thanks to you for posting that link.
    The first link you referenced in your article was also most helpful to get another useful thread where MikeS posted that Firecracker.pdf document, which is a nicely documented article from 12 years ago explaining the Firecracker protocol with sample code, upon which the others appear to be based. MikeS's code in that thread also was easy for me to follow, since it uses just a single X10 house/unit code in the BS2 program.

    Looks like I should be able to easily install a male DB9 port onto my project box with 3 wires to the BS2 board and add some code to my program for turning the X10 lamp module off & on, then just plug in the Firecracker and I'll be ready to go. I may add a switch to have the option to deactivate the Firecracker, or I suppose I could just unplug it if I want to keep the lights on.
    Now I also know how one could set up a web-accessible x10 remote - very cool.
    Thanks again for all the great info.

    Glad I could help!

    X10 is "old" technology but in the right environment, it still works well.

    - Ron
  • BrianZBrianZ Posts: 28
    edited 2012-03-13 13:20
    I finished this mod and have to say that it was easier than I expected. See photo of the Firecracker and port here:
    http://flic.kr/p/bCigNT
    There is also a link in that photo caption to my program code.
    See here for my overall setup and more info: http://flic.kr/s/aHsjysQBPW
    or here for some of my water drop photos: http://flic.kr/s/aHsjz88Ydc

    I was pleasantly surprised that the program worked fine with the first try, but then the most critical parts had already been written and tested. My only problem turned out to be related to what you said, Ron, that "in the right environment" X10 still works well. Well, I didn't have the right environment in the room where I'm taking photos, because I have 3 or 4 surge-protecting power strips with a bunch of computer-related electronics plugged in, and those power strips eat up the X-10 signals. I verified that by unplugging everything in the room and the X10 module worked fine in the outlet, but plugging any of those strips back in, even with nothing running on it, caused the X10 module to stop responding. They probably have a capacitor across the power line. So, I will likely run an extension cord from the next room when I need to use this feature, or else I would have to install an inductive coil inside my power strips, which apparently isolates the power strip to block it from attenuating the signals, according to what I've been reading.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2012-03-13 13:56
    BrianZ wrote: »
    ...
    I was pleasantly surprised that the program worked fine with the first try, but then the most critical parts had already been written and tested. My only problem turned out to be related to what you said, Ron, that "in the right environment" X10 still works well. Well, I didn't have the right environment in the room where I'm taking photos, because I have 3 or 4 surge-protecting power strips with a bunch of computer-related electronics plugged in, and those power strips eat up the X-10 signals. I verified that by unplugging everything in the room and the X10 module worked fine in the outlet, but plugging any of those strips back in, even with nothing running on it, caused the X10 module to stop responding. They probably have a capacitor across the power line. So, I will likely run an extension cord from the next room when I need to use this feature, or else I would have to install an inductive coil inside my power strips, which apparently isolates the power strip to block it from attenuating the signals, according to what I've been reading.

    There are lots of things which cause X10 signals to go awry. I have many UPS units around the house that cause problems, and having transmitters and receivers on different legs of the 220V main can be problematic.

    Glad you got it working! The pictures are impressive!
Sign In or Register to comment.