Home Security System

Disclaimer: This project is an ongoing 'moving target' as far as documentation and construction are concerned. To date, over 15 modules are now in operation. Please keep this in mind when utilizing the information provided. -- Luhan Monat

Creating a modular, networked, home control system was greatly simplified by using common 4-wire phone cable with stake-on connectors. The cable feeds both power and network signals to the various modules. Each module is made on a single sided circuit board with RJ-11 connectors (for the network/power) along with other connectors as needed. This eliminates the need for placing power feeds (wall worts) for each of the modules. The entire system runs on one power feed.

Since the power feed is at least 12 volts (unregulated), very long cable runs can be used to connect to various modules. Each module has its own 5 volt regulator to run the circuit. It also means that the entire system can be run from a single 12 volt battery if the power is out.

Requirements

To use any of the modules in this system, you need to provide these two modules that support the operation of all of the others

The HUB provides 4 network feeds. One feed can be used for monitoring the network traffic or manually accessing the modules using the PC interface (below). In an expanded system, those 2,3 or 5 way phone splitters (check your local Dollar Store) can be used as necessary to get the phone cable to any number of modules.

The Hub also provides 2 power inputs (diode isolated) for possible battery backup, the master pull-up resistor for the network data line, and fuse protection.

Here are the schematic and layout.

 

 

The PC INTERFACE translates 19.2 K Baud serial signals to and from all of the modules. This is a great tool for debugging the system. The network traffic is all in ASCII and can be viewed with any terminal program. Also, commands can be entered directly into the system to individually check the operation or each module.

Here are the schematic, layout, source file and object file.

 

The 4 wires in the phone cable are designated as follows:

BLACK   power ground
RED     12-16 volt unregulated power feed
GREEN   network ground
YELLOW  network signal

Standard phone cable, connectors, and junction boxes are used where needed. All cable must be 'strait through' with each connector having the colors in the same positions (black,red,green,yellow). Buying the cable in bulk and using a stake-on hand tool is handy for making all cables just the right length and ensuring the the wire order is always correct.

 

Network Communications

Hardware Level

The network communication uses 5 volt logic-level signals of the 'open collector' variety. Each ASCII character is composed of 10 pulses: an attention pulse, a reference pulse, and 8 data pulses...

;-----    -  -   -   - -   - - - -   -----
; ---- -- --- --- - --- - - - ---
; attn rf 1 1 0 1 0 0 0 1


Attention: 4 time units  (gives other units some time to notice incoming data)
Reference: 2 time units  (sets the 'slice' point for zeros and ones)
Zero bits: 1 time unit  (any time less than the reference time is a ZERO)
One bits: 3 time units  (any time greater than the reference time is a ONE)


Since every ASCII data byte comes with its own timing reference, this eliminates the need for crystals on each module. The internal oscillators are more than accurate enough to communicate using this method.

Protocol Level

All communications begin with a forward slash '/'.This separates commands from possible response data coming back from a module.

The second character is the Unit Type character; the third is the Unit Number. Characters that follow are individually defined by each type of Unit. This is a point-to-point protocol (internet style). Any mondule has direct access to any other module.

Here are some examples:

/V2PABD<cr> (Voice Unit #2: play words A, B, and D).

/S1QI<cr> (Sensor Unit #1: Send port bit status)

/D2L<cr> (Door Unit #2: Lock door)

Every command ends with a carriage return <cr>. Every unit echo's back a single line (possibly containing nothing) but always ending in a CR. This lets the sending unit know that the other unit is active and has received the command.

Network Modules

The following is a list of the existing functional network modules. As the documentation for each becomes available, a link will be added to it.

Module Name Functions
Hub (above) Feed power and provide 4 network ports
Tap (above) Bridge PC serial to network
IR send/Receive (3) Send and receive remote control IR codes
Console/Clock Coordinate some inter-unit communications and keep time
Temperature (2) Read 2 room temperatures (each)
Video Generate 20 character by 8 lines of video signal
Video Switcher Switch 4 video sources
X-10 Bridge to X-10 protocol for lighting control
Voice Play 20 word vocabulary thru speaker
Sensor Read doorbell button, door open sense, and smoke detector
Water Control 2 valves for garden watering
PIR Passive infrared motion detection interface
IR Security Detect objects via IR signal bounce
RF Read 433 Mhz remote control signals
Door Lock Interface to electric front door lock
Telephone Interface phone line to netork (incomming and outgoing)