Controlling Your Computer with X10: Adding Text-To-Speech

Sign in to queue


  This article is continuation in Controlling Contolled Home Automation series. It shows how to control your computer from light switches, motion detectors, alarm switches, and any other X10 transmitting device
Tony's Blog

Difficulty: Intermediate
Time Required: 1-3 hours
Cost: $50-$100
Software: Visual Basic or Visual C# Express Editions
  • Video Tutorial Part 3


    Download Video

    In the first two videos, I showed you how to control your lights from remote light switches and from your computer. In this video, I'll show you how to control your computer from light switches, motion detectors, alarm switches, and any other X10 transmitting device. If you haven't watched the first two videos, watch them before this video. They provide important background on X10 technologies and show you how to connect your computer to an X10 home power-line network.

    To complete this project, you will need at least one X10 transmitter and a CM11a. The CM11a interfaces between your computer and your home power-line network, however, I couldn't find an .NET Framework library that would interpret incoming serial signals from the CM11a. So, with the help of a serial port sniffer, I created my own .NET Framework library that can receive (but not send) X10 signals. Incidentally, nothing would thrill me more than if someone extended or improved my X10 library, or simply borrowed my code to write something better.

    With the help of my library and a tool such as Microsoft Visual Basic 2005 Express Edition or Microsoft Visual C# 2005 Express Edition, your computer can respond to real-world events. Anything that can trigger an X10 transmission can trigger a response from your computer. Examples of events include:

    • Flipping a light switch
    • Detecting motion
    • Opening a door
    • Opening a window
    • Flooding in your basement
    • Temperatures dropping below freezing

    As proof-of-concept, I created a project (available in both C# and Visual Basic) that verbally speaks Engadget headlines when I flip the light switch in my office. Don't limit yourself to my example: you can use the technologies in this project in limitless ways, including developing a custom security or environmental monitoring system. To trigger events when someone opens a door or window, or during flooding or freezing, connect a security or environmental sensor to an X10 PowerFlash interface.

    Besides X10, my example uses two interesting technologies: Really Simple Syndication (RSS) and speech synthesis. RSS is an application-friendly way to retrieve headlines and newsfeeds from websites such as Download Squad, MSDN, and our very own Coding4Fun. With RSS and Jerry Maguire's RSS Framework, you can add news-processing capabilities to an application with just a few lines of code.

    Speech synthesis is provided by Microsoft's own speech library, Interop.Speechlib.dll. With this library, a single line of code makes your computer talk:

    Voice.Speak("Hello, world!"")

    It's that simple, and when you understand the basics of writing code for the .NET Framework, you can combine these technologies in unique ways that meet your needs more perfectly than any software development company could imagine. Get started now by downloading either Microsoft Visual Basic 2005 Express Edition or Microsoft Visual C# 2005 Express Edition, and then watching my video.

  • The Discussion

    • User profile image
      NZ Academic Developer Student Blog

      Summer is just around the corner, with lots of free time to explore new ideas. Here are some fun ways

    • User profile image

      You can also easily add "text to color" with the SDK and ambient light system from

      Comes with light alert for events under Windows too!!

    • User profile image


      I am looking for some thing through which i can lock and unlock a room door or open and close it can you please tell me if you have any solution.

    • User profile image

      This is cool.  A friend of mine had this stuff set up so he could control his music with his voice.  

    • User profile image

      your stuff is so cool i am just starting out learn i can see alot of use for this stuff

    • User profile image

      how to hook bed room lights to alarm to come on at alarm time

    Add Your 2 Cents