Wired Two-Station Home Security system.

The technical information contained in this ZIP file should provide enough information to assist
an experienced computer science hobbyist, student, or teacher in building a fully functional two-station wired alarm system that involves two companion circuit boards that communicate with each other through a three-wire serial (full duplex) communication link.

 

The microcontroller on each of the two main circuit boards is a PIC16F690 by Microchip, Inc. (www.microchip.com).

 

The example software included in this ZIP file is designed to compile using a PICBASIC PROTM version 3 compiler which is licensed from microEngineering Labs, Inc. (www.melabs.com).

 

Note that connector X2 on the main circuit board serves two purposes:

  1. In-circuit programming connector when programming the PIC16F690.

  2. Pins 1 and 3 of X2 are connected to the MODE switch during normal operation.

 

Note that the three-pin OPTION connector S1 requires a two pin shunt to be installed. On one circuit board the shunt must connect pins 1 and 2 of S1. On the other circuit board the shunt must connect pins 2 and 3 of S1. This does NOT set an ID for each of the circuit boards. The software on each of the two circuit boards looks at the jumper setting of S1 in order to determine what its communication timeout should be. The timeouts must be different on each circuit board or communication can eventually fail due to both circuit boards transmitting at the same time. The serial communications is NOT driven by a hardware UART. The software on the circuit boards can either transmit or receive; each circuit board CANNOT transmit and receive at the same time. However, the “long-haul” driver and receiver (optical couplers) could be wired to the integrated UART ports of the PIC16F690, and with a few software modifications the hardware UARTS may be used for communications between the circuit boards.

 

Note that the Mode switch is NOT the same as the OPTION connector S1. The Mode switch is used to put the system into one of two possible modes:

 

  1. STANDBY mode in which the system ignores security breach event inputs from the sensors (e.g. door switches and photoresistors).

  2. NORMAL mode in which the system responds to security breach event inputs from the sensors by sounding the alarms. Note that the system waits a few seconds after mode switch is flipped to NORMAL before Normal mode is enabled. This is meant to allow a person time to close the doors and to leave the room before the alarm system is armed.