HTINews Article
- Feb98 -
[HTI Home Page]

[Click Message To Learn More]

The Complete Home Automation Controller - Examples
by Jeff Vogel


Examples:

Application example:

Now, your applications using the CHAC are endless. However, this example will employ every media on the CHAC. Refer to the Application Example diagram.

Example Problem Statement:

Employ a home automation system to provide the following:

Task 1:

Upon a doorbell ring:

Task 2:

Upon receipt of the 'Evening Time' infra-red command

Task 3:

Upon receipt of the 'Bedtime X-10' command:

Task 4:

Upon a reset button input, reset the 'all secure' condition

First thing we need to do in our design is to assign all our inputs and outputs to CHAC protocol messages: Refer to the Example Diagram

Inputs:

Outputs:

Refer to the Basic Program listing below for implementation using Microsoft Quickbasic:

  • CLS
  • OPEN "com1:9600,n,8,1,BIN" FOR RANDOM AS #1
  • COM(1) ON
  • ON COM(1) GOSUB RECEIVE
  • LINE INPUT #1, DISCARD$
  • DO
  • LOOP UNTIL INKEY$ = CHR$(27)
  • CLOSE #1
  • END
  • RECEIVE:
    • COM(1) OFF
    • LINE INPUT #1, CHACIN$
    • PRINT CHACIN$
    • COM(1) ON
    • GOSUB TRANSMIT
    • RETURN
  • TRANSMIT:
    • COM(1) OFF
  • REM**************************************
  • REM IF DOORBELL, THEN PORCH AND FOYER ON, PULSE DOORBELL
  • REM RELAY, AND MUTE THE TELEVISION
  • REM**************************************
    • IF RIGHT$(CHACIN$, 3) = "D00" THEN
      • PRINT #1, "WA1A2AJ"
      • PRINT #1, "OAP"
      • PRINT #1, "Q" + CHR$(11) + "4"
  • REM**************************************
  • REM IF Evening Time (IR 'R1') is received, then
  • REM Turn off all the lights,
  • REM Turn on the living room light to 50%
  • REM Pulse the Door Lock Relay
  • REM Set the 'all Secure Indicator"
  • REM and Turn ON the Television
  • REM**************************************
    • ELSEIF RIGHT$(CHACIN$, 2) = "R1" THEN
      • PRINT #1, "WAHA1AJAL6"
      • PRINT #1, "OBP"
      • PRINT #1, "OE1"
      • PRINT #1, "Q" + CHR$(11) + CHR$(4)
  • REM**************************************
  • REM IF THE bedtime X­10 COMMAND 'XBH' is received
  • REM TURN OFF ALL INSIDE LIGHTS
  • REM TURN ON ALL OUTSIDE LIGHTS
  • REM TURN OFF ALL AUDIO EQUIPMENT
  • REM TURN ON BEDSIDE LIGHTS TO 20%
  • REM**************************************
    • ELSEIF RIGHT$(CHACIN$, 3) = "XBH" THEN
      • PRINT #1, "WAHA3A4AJA1AL8"
      • PRINT #1, "Q" + CHR$(11) + CHR$(4) + CHR$(9) + CHR$(4)
  • REM**************************************
  • REM IF THE RESET ALL SECURE BUTTON IS PRESSED 'D10'
  • REM RESET THE ALL SECURE INDICATOR
  • REM**************************************
    • ELSEIF RIGHT$(CHACIN$, 3) = "D10" THEN
      • PRINT #1, "OE0"
  • REM**************************************
    • ELSE CHACOUT$ = ""
    • END IF
    • PRINT RIGHT$(CHACIN$, 2)
    • PRINT CHACOUT$
    • COM(1) ON
    • RETURN

 

Construction / Testing / Programming / Parts List