Security Alarm and Control System

(115KB zipped files, 78KB exe)

The purpose of making this program available is to share programming methods to control all the features used in this security system. It took a lot of digging to find the methods used in this program. The programming language used is Power Basic verion 3.2. Some people will remember it as Borland Turbo Basic. The present owner wrote it and originally sold it to Borland and then bought it back when Borland went bankrupt. It is a very complete programming language which produces compiled modules. The DOS operating system (DR DOS 6.0) is used because it is easier to program, is more stable than Windows 95/98, takes much less memory and reboots more consistently during power outages. The unit does have a UPS installed for short term outages.

The programming methods, including code snippets:

Port programming the Metrabyte isolated relay input/output board, which includes port bit manipulation.

A/D programming the CIO-DAS08 A/D converter board, which also requires port bit manipulation to read the LM335 temperature sensors. (snippet 2)

X-10 input and output from a PC thru the parallel port.

VGA Memory manipulation, used to view the console screen from a dial in connection.

Using the game port to read thermistors which thru calibration algorithms indicate temperature.

A stand alone program which can be run to emulate a security system with out the hardware.


Short Description of the System

This security system combines a home alarm and control system. The DOS program runs a 486 with minimal memory and resources. The PC has two additional ISA boards installed. The primary one is a Metrabyte 8 channel isolated relay input/output interface board PDISO-8. For details, see the 183KB pdf spec sheet. This is a low tech I/O board also available from other vendors, such as the CYDAS 8 or the CIO-PDISO8 also sold at Jameco, see the (catalog item). This board responds to input from house alarm sensors and controls the audible alarms and night time lights. These are all hard wired functions interfaced by an exterior control box. This box supplies power to the sensors and alarms, has manual activation/deactivation switches for the sensors and shows status LEDs.

The alarm system is two tiered to prevent false alarms, since it is wired to a Radio Shack dial out box. To be fully activated an intruder must not only break into the house, but also must physically enter. This provides several levels of security. Since the alarm has been upgraded to a two tier system, there has never been any false alarms in 6 years of continual use.

The other ISA board used is a Measurment Computing low end 12 bit A/D converter board CIO-DAS08/JR, also available from Jameco, see the (catalog item). For details, see the 246KB pdf spec sheet. This board supplies A/D conversion for temperature monitoring with LM335 temperature ic's. This augments the thermistor temperature monitoring done thru the analog game port, which has proved to drift, requiring frequent recalibration.

The system also controls X-10 switches thru the parallel port using a Micromint PLIX evaluation board. This unit controls the X-10 units thru an X-10 Power Line Interface, TW523. There are many ways to control X-10 modules from a PC, this was the cheapest. The system also allows me to read X-10 signals from other X-10 transmitters.

The computer code is written so that most debugging can be done without the external interface box or the sensors. The program simulates most all alarm and control functions internally. This is essential because physically, the security computer is not easily accessible (for security reasons) for testing. The temperature sensors are all calibrated externally on another computer. The program aslo has a 'auto mode' where the daily control cycle for lights and fans is performed in about 2 minutes. When the alarm 'simulation mode' is run in conjuction, the alarm events are also speeded up.

The security computer also is a server on an obsolete but very good DOS lan (Sitka 10net ver 5) and is connected to another 286 computer with a DOS communication program (HyperAccess 5) for dial in capability. A DOS computer in another room allows me to write code and transmit it to the security computer remotely.

Other features include; two remote serial status displays driven by the two serial ports, several log files to record events and temperatures, the ability to view the console display remotely (dial-in or locally), randomized light control, seasonal variation for the light control, and temperature controlled fans. If another printer port is installed or if the X-10 unit is not used, a printer can be used to realtime print out events and alarms. Help files are built into the program. Other auxiliary programs were written to check port usage, calibrate the game port to correct for drift, run calibration algorithms and store calibration data.

The zipped file includes the main program, a 'List.exe' program to read the log files, a temperature 'Temp.ini' file for the game port (Plug in a joy stick and read fake temperature values), a 'Seemenu.exe' program to remotely view the menu*.log files. The multiple 'menu*.log' files are console screen captures of any event, but only saved when the door is locked.. When the program is running, the output files will be house.log, temp.log, and menu*.log files. . The testport.exe is only used to find available ports (11111111 in 'showbits' output) if the program doesn' t work on your PC. Unused ports needed are hex380 and hex330. The source code is included for all exe files.

On a Windows machine, the program will run in a DOS window. If you worry about your windows machine, run the program on an old DOS machine. All files should be in the same directory or folder. Any questions can be addressed to the webmaster at this site. Below are screen captures of the display console.

[Download here]

Normal with house locked and no alarms, with hardware connected.

Simulate Mode, hardware not used.

Simulate Mode, door unlocked, motion in living room, and light on.

Simulate Mode, alarm system tripped with window open and movement in living room.