Dan's Previous HA Systems

My HA system is currently in its third generation. This page describes the first two generations. To read about my current system, click here.


HCS II

I started with an HCS II system from Circuit Cellar. This is a stand-alone single board computer aimed at the home automation market. It had 16 digital inputs (DI's), 8 digital outputs (DO's) and 8 analog inputs (AI's). It supports an rs-485 network connection which allows additional IO units, LCD interfaces, IR interfaces, etc. to be easily added using only 2 twisted pairs of wire (1 pair for power, 1 pair for the rs-485). Speech, phone and other interfaces are also available. The HCS is programmed using a simple, Basic like language.

For a complete description of its features and options check out the Circuit Cellar Web Page.

In addition to the main processor (HCS2-DX) I had an LCD-Link module, a PL-Link module and a BUF-Term module.

The LCD-Link sits on the rs-485 network and provides you with a user interface to the system. It supports most 80 character LCD's. These are usually configured as either 2 lines x 40 characters (2x40) or 4x20. It also supports 4 push buttons and 3 LED's. With a slight modification, I was able to get my LCD-Link to support a 4 line by 40 character (4x40) display (I just didn't think a 4x20 or 2x40 was going to be big enough).

The PL-Link also sits on the rs-485 network. It provides the X-10 interface by connecting to a TW-523 module plugged into a nearby outlet.

The BUF-Term option provides isolation for the 16 DI's and the 8 DO's. It also has handy screw terminals for all 24 IO points to facilitate connections.

As far as functionality goes... it did the following:

I was very happy with the HCS2-DX, but I wanted to add some features that just weren't available for it yet. Mainly, these are voice recognition and voice mail capabilities. So, I decided that for the ultimate in flexability, I would use an IBM compatible pc and write my own code to do what I wanted.


Second Generation


Main Features


Computer Hardware:

My HA pc was put together with almost all used components. I scoured several local used computer stores to find the necessary parts.


Other Hardware:


Hardware Configuration


X-10 Configuration


Software

Alex runs under Windows 3.1. It is comprised of 5 different programs, all of which I wrote using Borland C++ 4.02. I only use C, not C++. The programs communicate with each other using global Windows messages, no DDE or OLE. The global messages are sent using the Windows SendMessage function. Some of the messages are replied to using the Windows ReplyMessage function.

I use Turbo Commander Pro for my serial port driver. This is needed so that the 4 ports on the multi-port serial card can share 1 IRQ. This sofwtare is really cool because it lets you monitor all comm port activity.

I use Voice Assist for voice recognition and Text Assist for text to speech.

The 5 programs that make up Alex are:


Alex description

Alex is the main program. It basically just "listens" for messages from the other 4 programs and then acts accordingly. Alex does not interface directly with any of the HA hardware. Instead, it sends a message to one of the other programs and then that program accomplishes the task. For example, when the workshop keypad combination is entered a bit changes on DI port 1. The Alex-IO program sees this change and sends a Windows message stating which port changes and what the new byte value is. Alex receives this message, examines the byte to determine what has happened, then sends a message to Alex-IO to set the electric door strike DO bit, sends a message to WIX to send an H2 ON command (workshop lights), then waits 1 second and sends a message to Alex-IO to turn off the electric door strike DO bit.

Alex also has several timers that allow for doing things at regular intervals. And, it monitors the time of day so that various events can be scheduled to occur at certain times.

Alex is the program that I change and re-compile when I want to change/add/delete features. All of the other programs remain unchanged.

Alex-IO description

Alex-IO monitors the digital input ports on the 32 bit DIO card. It is configured to scan each port every 100ms (10 times per second). It also controls the DO port. Alex-IO both sends and receives messages. It sends a message when a DI byte changes. The message includes the port and the byte value. It receives messages in order for Alex to set/clear DO bits and to request the status of the DO and/or DI ports.

Alex-485 description

Alex-485 communicates over the RS-485 network to the LCD-Link. It can be expanded to talk to other devices on the 485 network, but the LCD-Link is the only 485 device I have so far.

The LCD-Link provides an interface to a LCD screen, 4 DI's for push buttons and 3 DO's for LED's.

Alex-485 is configured to poll the LCD-Link every 500ms (1/2 second) in order to get the status of the buttons. The LCD-Link returns the status as a BCD number (each button has a value of 1,2,4 and 8). If the button status is 0 then no buttons were pressed since the last query (polling). If the status is 4 then button 3 was pressed, if the status is 5 then buttons 1 and 3 were pressed, etc.

Once it is determined that a button was pressed, Alex-485 sends a message with the status value.

Alex-485 also receives messages in order to display text and to turn on and off the 3 LED's. Text messages are sent to Alex-485 by sending a pointer to the string that you want to display. This allows Alex to display any string it wants simply by sending a pointer to the string to Alex-485.

Here is a quick overview of how the LCD-Link works and how I use it:

The LCD panel I use is a 4x40 type I bought from an electronics mail order store. It is driven by an LCD-Link board that is part of the HCS-II home automation system from Circuit Cellar Ink. I mounted the LCD panel in a custom enclosure I made myself out of wood and then painted the same color as the kitchen walls - it looks really nice. It is about 3/4 inch thick and mounts right on the wall, it is not recessed. It holds only the LCD panel, LED's and buttons. The electronics are housed in a separate plastic project box that is about 12 inches away and is mounted on the basement stairway wall almost directly behind the LCD enclosure. Here is a drawing of the LCD enclosure.


   |-----------------------------------------------|
   |                                               |
   | L  ----------------------------------------   |
   |    |Monday, Jan 20  9:25              Day |   |
   | L  |            LCD Panel  (4x40)         |   |
   |    |                                      |   |
   | L  |Menu 1   HOME/away  bed/AWAKE  Play   |   | 
   |    ----------------------------------------   |
   |         B1      B2        B3       B4         |
   |-----------------------------------------------|

The L's are LED's and the B's are buttons. The top row displays the date and time and the current mode - Day or Night. The middle 2 rows are used to display status info. The bottom row displays the menu. I have shown Menu 1, or the Main Menu. It defines what function the button directly below each menu item will perform. If I push B4 then messages will be played from my voice mail program. If I push B3 then bed mode will be initiated (turning off lights, etc. and the menu for B3 will change to 'BED/awake' (capitalization change) to show that the mode is now BED. Pressing B1 changes its caption to 'Menu 2' and displays new captions for B2 B3 and B4. It goes up to menu 4 and then it cycles back around to menu 1.

The LCD-Link interface is really easy. It has a unique ID on the network of 'TERM0'. I think the protocol supports up to 4 lCD-links, but I'm not sure. Every .5 seconds (I could go faster) I send out a command 'TERM0 Q' which is a query command for the button status. If no button was pressed then a zero is returned. Each button has a value of 1,2,4 or 8, so it is easy to tell which button(s) was pressed. If I get a value back of 1 then I know the menu button was pressed and I update a variable in my software so I know which menu is active and then I send the following string:

TERM0 S="Menu 2    Caption 1   Caption 2   Caption 3   Caption4"

which updates the text on the LCD to the menu 2 text. Thus, my software keeps track of which menu is active and then takes a different action for each button press depending on the active menu. There is another simple command to turn on and off the LED's.

I did use a trick to get the LCD-Link to talk to my 4x40 display, since the LCD-Link is only meant to support a 2x40 or 4x20 (80 characters max) display. I basically use a DO from my digital output card to decide which part of my LCD is active - top 2 rows or bottom 2 rows. Then each command I send (TERM0 S="some text") only goes to the selectd half of the display. The LCD-Link also supports cursor positioning commands so you can put the text wherever you want.

A simpler solution would be to use the new AnswerMan chip or the Basic Stamp to implement something similar, but neither was available when I made this. The AnswerMan can be found at Micromint and there was an article on it in the Jan '97 issue of Circuit Cellar INK.

The HCS-II HA system has many other devices that are compatible with this 485 network and can all be a node.

WIX description

WIX stands for Windows Interface to X-10. WIX's job is to interface to the LynX-10 card. The LynX-10 card provides an interface between a pc, via a serial port, and a TW523 interface module. The LynX-10 is constantly listening for X-10 commands. When it "hears" one, it sends a message over the serial port to the pc. This in turn generates a Windows message that tells WIX to read the serial port and then decypher the command.

Once WIX has de-coded the X-10 command, it sends a global Windows message indicating the house code, unit code and command.

WIX also receives messages in order to send X-10 commands.

MWPhone description

MWPhone stands for MWave Phone. MWPhone currently functions as an answering machine, a caller id logger and announcer, and it reports various phone related events. However, MWPhone is under development and only the caller id function is presently used all the time.

The caller id function displays each caller's name and number and time of call in a listbox. This also serves to keep a history of the most recent callers (set to 50 for now). Each caller is also announced by playing a WAV file with the callers name. If the caller's number is not found in the database, then a WAV file saying "stranger" is played. WAV files saying "blocked" and "unavailable" are also played for those 2 types of calls.

The sound WAV file is distributed around the house by sending the line level speaker output from the ACE 5000 to amplified speakers on the HA pc, to a Radio Shack pocket amplifier in the kitchen and to the Ramsey FM transmitter. The FM transmitter allows me to use any FM radio to listen to caller id info, if I'm going to be out of hearing range of one of the speakers.

MWPhone sends messages to indicate ringing, on/off-hook, button presses, caller id info and more. It also receives messages so that Alex can control various phone functions. For example, a button on the LCD-Link acts as the PLAY button. Pressing it causes MWPhone to play all the messages you got while you were out.

Eventually MWPhone will be able to screen calls and play different messages depending on who is calling. It will also be able to weed out the junk calls we all get offering us credit cards, new long distance service, asking for money, etc. It will also allow you to control your house from any phone in the world.


Functionality


Features under construction


Back to the Home Automation Index

dhoehnen@infinet.com