Smart Lock Schematic
The circuit is based on two 12C508 chips (one for the lock and the other one for the key). It functions in the following way:
The base sends a data sequency (the password) which is recognized by the key. The key checks the sequency and -if it recognises it -sends to the base another data sequency, as an answer to the password. At the time when the base gets a correct answer (which means that the key has been introduced), the relay is put into action, and it can command a number of consummers.
Data communication is done asynchronous, in compatible RS232, 300bps, 8N1 format. The password is made of 14 ASCII characters, and so is the answer.
How to build it
I made the key inside of a DB9 male connector (the 9 pin connector used on your PC COMs). A PCB wasn't necessary, the PIC was soldered directly on the connector's pins, then fixed on it's case with glue or PATTEX. You can use, of course, any other kind of connector.
The base was made on a 5X3 cm PCB. I used a PCB relay; the connector was a female DB9. The values of the passive components are not critical and the transistor can be replaced with any other, low power, able to sustain a minimum 12V voltage.
When powering on the base, the pin3 (LOCK) is in the logical "low" state and the pin 6 (NLOCK) is in the logical "high" state. After few seconds from the introduction of the key, the status of the two pins is reversed and remains so until the removal of the key. The NLOCK signal polarises the base of the transistor, the coil of the relay is fed and the LED lights. Of course, as you have the source code, you can modify the action as you wish, but mind the mistakes, because the 12C508 can only be programmed once.
The sources of the code that must be written into the PICs are smartkey.asm for the key and smartbas.asm for the base. You can find them here. You will have to introduce your own passwords (see the commentaries in the sources) and then to assembly the sources using MPASM assembler which you can take for free from MICROCHIP and then to programme the two PICs using a programmer, specially made for this purpose. If you don't have the programmer you can build a very simple and perfectly functional one ( I use it successfully) using these plans.
Return to the Schematic Archive