Please login or register.

Login with username, password and session length

Author Topic: Interfacing the CM11A with an Arduino or other microcontroller board  (Read 15487 times)

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818

An alternate project I would like to do (well, it could be an offshoot of the router one) would be an X10 "status monitor" box. Nothing too fancy, of course. A row of 16 LEDs for each Housecode I want to monitor (maybe 2 or 3 housecodes, I don't think I need to monitor all 16 of them), mounted in a project box, somewhere that I can see it easily.
The appropriate LED would turn on or off, based on PLC commands received over the powerline.
I don't have an electronics background, but after doing some research, it looks like the Arduino is a good place to start, for the logic and controlling the LEDs. I have two spare CM11A's in my "extras" box, and I figured it is easier to interface using serial than using USB anyway. (I also have a few spare CM15A's, but I figured the serial port communications might be easier - not sure why).

Other than that, I don't really know where to start. I'm not a programmer, so I can't really write code (although I could adapt code written by other people - I'm pretty confident doing that - sort of). I don't know which of the millions of Arduino flavors would be best for this (serial interface, controlling a bunch of LEDs - maybe as a matrix to reduce the number of wires?, onboard memory to store module status, etc).

Can anyone point me in the right direction to get started?
« Last Edit: November 17, 2011, 02:29:43 PM by Noam »
Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #1 on: November 10, 2011, 01:28:35 PM »

I'm not at all sure what you are trying to do but adding almost any serial device to your LAN can be done with a lot less effort and probably a lot less expense using an Ethernet-to-Serial adapter such as...
It has simple protocols for communication.
« Last Edit: November 17, 2011, 02:30:05 PM by Noam »
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #2 on: November 10, 2011, 02:04:30 PM »

Thanks for the suggestion, but that's not exactly what I'm trying to do.

I have a bunch of parts (CM11A's, CM15A's, the routers, etc), and I'm wondering if there is a "cool" project I can do with them.
A PC-independent web interface for X10 (either using the CM11A or the CM15A) would be neat. The router already has most of the hardware needed to create the web host. I still plan to keep the CM15A running off my Windows PC (and I have a web interface for it using X10 Commander), but playing around with another device might be neat.

The other thing is the "status board." for that, the CM11A would be used to "read" the commands coming down the line, and the controller (be it the router, an arduino, or something else) would change the state of the status lights.

I could do the same thing with a whole lot of Universal modules, but that would be an expensive way to go, and I'd have to find a place to plug in 16 (or more) Universal modules, and run the wires to a display panel.

At the same time, an Arduino might be useful for providing INPUTS, as well. Again, PowerFlash modules could provide this function, but they take up a lot of space. It would also be possible (in theory) to program routines into the Arduino to do different things based on combinations of triggers (kind of like using conditional macros in the CM15A).

I know this may sound like "child's play" to some of the more seasoned electronics gurus here, but it is a whole new world for me, and I might have some fun exploring it (when time permits, of course).
« Last Edit: November 17, 2011, 02:30:16 PM by Noam »
Logged

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #3 on: November 17, 2011, 02:33:06 PM »

I'm not sure if I'm surprised nobody took me up on this one. 
(I split the Arduino project off the "router" thread)

I've seen so many projects that use an Arduino and a TW523/PSC05 to send or receive X10 commands. However, I haven't found any that use a CM11A. Maybe it is just not possible.
However, since I don't have a TW523 or a PSC05, I would have to justify buying one of those, along with the necessary Arduino and other parts to make my LED status board.

Does anyone have any experience interfacing the CM11A with an Arduino or similar "basic" microcontroller board?
Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #4 on: November 17, 2011, 04:05:52 PM »

Does anyone have any experience interfacing the CM11A with an Arduino or similar "basic" microcontroller board?

Yep. I designed the BX24-AHT about 10-11 years ago. It supported the CM11A, TW523, Ocelot, and a few other X-10 capable controllers as well as RF and IR inputs. It used the BX-24, a BasicStamp clone from NetMedia. It did not use the Arduino as the Arduino did not then exist.

Since then I designed another, similar device that added an ethernet interface along with Insteon and UPB and other support and based on the ZX-40 from Elba, Corp. It, however, was stiilborn as the company making the ethernet interface module discontinued it with no notice (patent issue?) leaving me stuck with about $4K in inventory.

At this moment, I am awaiting delivery of some 12 PCB prototypes that will reprise that ill-fated design but using Arduino form-factor PCBs and a modular approach that should provide a great deal of future-proofing. It supports all the above plus a few additions (e.g.CM15A, WiFi) and will have Windows, Linux, OSX, Android and ??? interfaces. You can see all this at...
 
The system boards support some 20+ microcontrollers, including Arduino (you'll have to install their bootloader to the Atmel chip of your choice.)

What, specifically, would you like to know?
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #5 on: November 17, 2011, 09:11:12 PM »

Wow! I REALLY have no clue what I'm doing, huh? ;)

I guess what I'm trying to figure out, as a newbie to all of this, is where I should start.
I had looked into using a MAX232 with an Arduino to get the serial port communications, but when I tried to test my CM11A with Hyperterminal in Windows, all I got was garbage (that didn't look different when I was sending commands down the line from a mini-controller.

So, I think I'll have to bite the bullet and get a TW523/PSC05. (I have other projects I want to try based on the Arduino, so if I buy one and this project doesn't work out, it won't be wasted.)
Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #6 on: November 17, 2011, 10:36:33 PM »

Wow! I REALLY have no clue what I'm doing, huh? ;)
Most of us started there.
I guess what I'm trying to figure out, as a newbie to all of this, is where I should start.
I had looked into using a MAX232 with an Arduino to get the serial port communications, but when I tried to test my CM11A with Hyperterminal in Windows, all I got was garbage (that didn't look different when I was sending commands down the line from a mini-controller.
The CM11A expects to be talking to a PC so you would not need a MAX232 with Hyperterminal but you do need it with a microcontroller. I assume you have the CM11A protocol docs and know what to send and what you should receive. The CM11A is very simple and easy to communicate with but it does get a bit more complex if you want to read/write the EEPROM. I can give you BasicX and/or ZBasic code for communicating with it that you should be able to convert to C or C++ for the Arduino.
So, I think I'll have to bite the bullet and get a TW523/PSC05. (I have other projects I want to try based on the Arduino, so if I buy one and this project doesn't work out, it won't be wasted.)
If you decide to go that way, I worked with the owner of Elba, Corp. to add low-level X-10 functions to ZBasic. Their ZX-328n (an Atmel ATmega328p) will handle a TW523 automatically in the background - all you need do is read/write a bit array.

A disadvantage of the TW523 is that it will not report all of the powerline traffic but only valid X-10 commands and, even those, are delayed by 22 half-cycles so it's impossible to avoid collisions but, an advantage is you can send any bit sequence desired. The CM11A also only accepts/reports valid X-10 commands but it does avoid collisions.

If you want to wait a couple of weeks, I can give you a prototype Zarduino-28 board that you can use with a $10 ZX-328n and either the CM11A, using a ZBasic software UART,  or with the Zarduino X-10 shield and a TW523 - or both for that matter. I will not have a lot of time for hand-holding, however. A bonus is that the Zarduino-28 has a 64KB SPI EEPROM for macros/timers/whatever.
« Last Edit: November 17, 2011, 10:39:46 PM by dhouston »
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #7 on: November 18, 2011, 07:10:03 AM »

Wow! I REALLY have no clue what I'm doing, huh? ;)
Most of us started there.
I guess what I'm trying to figure out, as a newbie to all of this, is where I should start.
I had looked into using a MAX232 with an Arduino to get the serial port communications, but when I tried to test my CM11A with Hyperterminal in Windows, all I got was garbage (that didn't look different when I was sending commands down the line from a mini-controller.
The CM11A expects to be talking to a PC so you would not need a MAX232 with Hyperterminal but you do need it with a microcontroller. I assume you have the CM11A protocol docs and know what to send and what you should receive. The CM11A is very simple and easy to communicate with but it does get a bit more complex if you want to read/write the EEPROM. I can give you BasicX and/or ZBasic code for communicating with it that you should be able to convert to C or C++ for the Arduino.
So, I think I'll have to bite the bullet and get a TW523/PSC05. (I have other projects I want to try based on the Arduino, so if I buy one and this project doesn't work out, it won't be wasted.)
If you decide to go that way, I worked with the owner of Elba, Corp. to add low-level X-10 functions to ZBasic. Their ZX-328n (an Atmel ATmega328p) will handle a TW523 automatically in the background - all you need do is read/write a bit array.

A disadvantage of the TW523 is that it will not report all of the powerline traffic but only valid X-10 commands and, even those, are delayed by 22 half-cycles so it's impossible to avoid collisions but, an advantage is you can send any bit sequence desired. The CM11A also only accepts/reports valid X-10 commands but it does avoid collisions.

If you want to wait a couple of weeks, I can give you a prototype Zarduino-28 board that you can use with a $10 ZX-328n and either the CM11A, using a ZBasic software UART,  or with the Zarduino X-10 shield and a TW523 - or both for that matter. I will not have a lot of time for hand-holding, however. A bonus is that the Zarduino-28 has a 64KB SPI EEPROM for macros/timers/whatever.

Once again, I really feel overwhelmed and under-skilled for this.
I wasn't trying to use the MAX232 with Hyperterminal, I plugged the CM11A right into the serial port on the PC, verified that AHP could talk to it, and then shut down AHP and the x10nets service. I then opened Hyperterminal, opened a connection, and started getting garbage. The garbage didn't change when I sent commands down the line from the Mini-controller, so I'm not sure if there is even a way to do this with the CM11A (I was hoping there was).
Maybe there isn't a way to interface the two (the CM11A and some sort of microcontroller board), which is why I can't find any information on it.
Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #8 on: November 18, 2011, 07:47:19 AM »

Once again, I really feel overwhelmed and under-skilled for this.
I wasn't trying to use the MAX232 with Hyperterminal, I plugged the CM11A right into the serial port on the PC, verified that AHP could talk to it, and then shut down AHP and the x10nets service. I then opened Hyperterminal, opened a connection, and started getting garbage. The garbage didn't change when I sent commands down the line from the Mini-controller, so I'm not sure if there is even a way to do this with the CM11A (I was hoping there was).
Maybe there isn't a way to interface the two (the CM11A and some sort of microcontroller board), which is why I can't find any information on it.
I think you are trying to jump into the deep end of the pool without first learning to swim in the shallow end - AKA the kiddie pool  ;).

Interfacing almost any microcontroller to the CM11A is really fairly simple. In most cases, you can even eliminate the need for a MAX232 by inverting the data (as most microcontroller software UARTs allow).

A large part of the motivation for designing the ZarduinoTM boards was to make it easier for novices and it's the main motivation of the distributor that is helping me get this organized. A simple project with the Zarduino-28TM and CM11A would make an excellent kiddie pool type demo project although I'm not sure that this is the proper place for documenting it.

I'll document it on the Zarduino-28TM web page. If you are interested in being a beta tester, send me a PM with your snail-mail address and I'll send you a board when I receive them. You'll need to supply a ZX-328n, a 5V regulated power supply, a DB-9 connector, a little wire and a soldering iron. Winford Engineering has breakout boards for nearly every type of connector. I'll publish a list with PNs/sources on the web page.    
« Last Edit: November 18, 2011, 08:08:30 AM by dhouston »
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Interfacing the CM11A with an Arduino or other microcontroller board
« Reply #9 on: November 18, 2011, 08:36:18 AM »

Thanks.
I'll send you a PM with my information, and we can take this discussion offline.
Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.