Showing posts with label ESP8266. Show all posts
Showing posts with label ESP8266. Show all posts

Thursday, December 28, 2017

Controlling X10 with Alexa

 I thought it would be fun to control the X10 modules in my house with an Echo Dot .

I am unapologetic about using this 1980's technology for much of my HA.  It's cheap and it works for me.

A quick search revealed that there is an Arduino library written by  Tinkerman that interfaces an ESP8266 to Alexa. (It mimics Belkin WeMo switches.)

Once you have the ESP8266 responding to Alexa, the world is your oyster!

Since I have already written the code to control the CM17A X10 module in Arduino, it was just a matter of combining the two functionalities.

In use, the chain of events is as follows ...
I tell Alexa, "turn tree on". Alexa sees a WeMo switch device named "tree". The Arduino sketch receives that event and calls the corresponding house and unit command for the CM17A. The CM17A transmits the code wirelessly to a TM751 transceiver (or the like) which puts the signal on the powerline. The signal is picked up by an X10 module which turns on the device.

Hardware-wise you need some kind of ESP8266 dev board, an optional I2C OLED display, a CM17A module (AKA X10 Firecracker),  an X10 wireless receiver, a lamp or appliance module. You also need a level shifter.



The level shifter is needed because the ESP8266 is a 3.3V device and the CM17A requires ~5V to operate. Also, since the CM17A is powered by the difference between RTS and DTR,  strong pullup resistors (330Ω) must also be used on the high side of these signals. Here's a rough diagram ...


I have the source code pretty much finalized for this project. If you are interested, you can download what I currently have here,

Enjoy!


Sunday, November 22, 2015

Network Control of X10 - take 2

I posted an earlier version of this, but it was based on the Atmega328 and an Ethernet module.

This version is based on the ESP8266 which provides the microprocessor and connection to the network via WiFi.

I've been having a ball with the ESP8266. It's cheap, programs with the Arduino IDE, and it just works. I've already created a product with it that connects my Geiger Kits to the internet.

So what is it?
The ESP8266 puts up a webpage (like the above) on your local network. The page has buttons for the X10 devices that you want to control. When a button is pressed the ESP8266 drives a CM17A and turns your device on or off. The page also displays any sensor readings that are connected to the ESP8266. So if you are into X10 home automation, this is a cool gadget.

Hardware-wise it's an ESP12 variant of the ESP8266. It's connected to the CM17A through a level shifter. The level shifter is needed because the ESP8266 is a 3.3V device and the CM17A requires 5V to operate. (Since the CM17A is powered by the difference between RTS and DTR strong pullup resistors must be used on the high side - 330Ω.)






You can also attach an I2C OLED display to the ESP8266 which will show the X10 commands that were received.





Here is the complete setup. I used the ESP8266 development board I created for the GK-WiFi kit (available here).






The software is finished (as far as I'm concerned) and is available here.