■ SCHEMATIC 1.
The PCBs and programmed chips to go with this
article can be purchased online from the Nuts & Volts
Webstore www.nutsvolts.com or call our
order desk at 800-783-4624.
The chip used is a PIC16F505 which can be programmed
from the board. I use programming pads instead of pins. I
developed an adapter using Mill Max spring-loaded pins.
You can solder a header to the programming pads if
you wish. When programming, make sure that the receiver
alarm switch is open. With the transmitter, make sure that
there are no wires in the terminals and the tilt switch is
parallel to the floor.
Two keys are used for the combination; Key 1 has
eight bits and Key 2 has five bits. The combination codes
are placed in line 81 and line 85. Both the transmitter and
the receiver must have the same code to function. The
input pins to the tilt switch and other switches (if used) are
programmed to use the micro’s internal pull-up resistors.
They are programmed to wake up the micro if there is a
pin change. The micro determines if the wake-up was
caused by a WDT or pin change using line 107.
Once the unit is awakened by a pin change, the
switch results are placed in the first three bits of Key 2.
The transceiver is turned on to transmit, and 16 bits of
information are sent out using bit-banging 1200 baud. It
transmits for about five seconds and then goes back to
To overcome any noise or random signals in the Linx
module, I just made sure that the transmission is high
(indicating a true signal) for a period of time and then
check to see if there is a start signal sent.
Once this happens, the receiver gets the 16 bits of
code and checks the code against its combination. If this
matches, it decodes the first three bits of Key 2 and
transfers this information to be displayed.
■ FIGURE 7.
November 2010 41