X10 Web Server

First written in 2004: A lot has changed since then. We could update this to use ESP32 Wifi web server, or Raspberry Pi Zero W.

This project is a web server that can control appliances and devices through the mains electricity wiring using tried, proven and safe X10 technology. It can send signals to, and read signals from, X10-enabled devices. You can use this project to switch lights and appliances on/off via a web page, or to check the on/off status of an appliance. Being a web server, you can access it wirelessly via your WiFi network, allowing you to control stuff all around your property using just your PC, Smartphone/Dumbphone, iPhone, iPad or whatever other web-browsing device you like.

Circuit Description

The project is based on a few simple components. To avoid re-inventing the wheel, to speed up development, and also for safety reasons when sending signals through the mains, I've used some pre-built modules. For the web server I use a module known as a SitePlayer SP1 (from NetMedia). This is the green circuit board on the right in the picture.

For the X10 signaling, I use a standard X10 module known as a CM12 (not pictured). This module is a computer interface for X10 and has a serial RS232 port. The current one appears to be a CM15A, but it uses USB instead of RS232, so there's probably a whole different way to communicate with it. Maybe you can find one of the older serial ones on eBay, or maybe it's just one of those serial-USB interface bridges so you could use the same i.e a FTDI232, if the comms protocol is the same. That describes each end at the physical level. For the "glue" in between, I use a PICAXE 18X chip. This is a simple microcontroller that has a built in BASIC interpreter. PICAXE's are cheap, very easy to use, and are readily available. The PICAXE essentially just relays messages between the SitePlayer and the X10 module. There is one catch though, the X10 module requires that the data packets you send to it are formatted correctly, which the PICAXE takes care of. A MAX232 chip (far left) is used to adjust the serial port levels to RS232, for communicating with the CM12. A 74HC04 chip inverts the SitePlayer line before it goes into the MAX232 for buffering, then into the PICAXE. You can't see the 74HC04 in the picture because it's mounted underneath the SitePlayer module. Circuit Schematic - click for readable size

Screen shot of the web page in Mozilla. I made it narrow so it would fit on my wife's PDA screen (a Hewlett Packard iPAQ, anyone remember those? Way before iPhones), so we can control devices wirelessly through our WiFi network

Software and Operation

The software is written in PICAXE Basic. It reads data from the Siteplayer serial port, formats it, then sends it to the CM12. A key part of this is correctly communicating with the CM12 interface. To figure out the communications protocol for communicating with the CM12, I had to see what the interface was doing. I did this by connecting the CM12 to a PC via a serial protocol analyser. The PC was running the standard X10 PC software (called "Active Home") that came packaged with the CM12. This allowed me to see the data movements between the PC and the CM12 as I ran it through its various features. The resulting PICAXE software just emulates these "conversations".

Contact Me

My name is Greg Newton and I'm in Sydney, Australia. If you want to contact me, or you want more information, you can email me at: greg dot newton dot oz at gmail dot com (written like that to avoid spam bots).