Thursday, June 23, 2011

Code lock: Schema and production



  

Description:

The code lock can be used both to trigger an alarm and cut that to open a door lock. The code can be changed anytime after entering the correct code.

Two functions are available:
  • relay switches on for 3 seconds after typing the code.
  • The relay is turned on and off every time one enters the code.

Keyboard:

The keyboard is a set of buttons, arranged in a matrix xy. It looks like this:












Column 0 Column 1 Column 2 Column 3
Line 0 1 2 3 A
Line 1 4 5 6 B
Line 2 7 8 9 C
Line 3 * 0 # D



Column 3 is not mandatory, it simply allows an increase in opportunity for the code.
You can build yourself using buttons and then buy a keyboard as pictured above, which costs about € 5.




Nomenclatures







Code Value
IC1 PIC16F84 PIC16F84A-10 or
IC2 78L05 5V regulator
Q1 Npn bipolar transistor BC301 or similar Ic (min) = 500 mA
D1 Diode 1N4001, 1N4004 or 1N4007
LED1 Led 3mm Green.
R1 Resistance 1 kOhm 1/4W
R2 Resistor 220 ohms 1/4W
C1 22 pF ceramic capacitor
C2 22 pF ceramic capacitor
C3 100 nF ceramic capacitor
C4 100 nF ceramic capacitor
X1 Quarter-10MHz
BUZZER Piezo Buzzer
Keypad 3x4 or 4x4 keyboard with xy matrix outputs
K1 5v Relay

The installation will be powered with 12V.

Component side artwork
 
Solder side artwork

The program (the *. hex)

To trigger the relay for 3 seconds after entering the code:






: 100000006C2800000000000009001108820760341D
 : 100010003134323433346134343435343634623448
 : 1000200037343834393463342A3430342334643444
 : 100030001530840089018316081483120808800093
 : 10004000840A890A19300402031D1B280800153090
 : 1000500084008901000888008316081208155530AD
 : 100060008900AA30890088148312000000008316DA
 : 10007000081E34288312840A890A19300402031DD9
 : 100080002A2808008D0050308E008E0B45288D0BDD
 : 100090004328080090008615033042208611033063
 : 1000A0004220900B4B280800910104309200FE3052
 : 1000B0006500A0304220060E940004309300910A9F
 : 1000C000940C031C0528930B5F2803148316850DDD
 : 1000D0008312920B592800348501030165008601C3
 : 1000E000F0306600831681138312F0304A20182006
 : 1000F000860197201530D620031D78282A3011025A
 : 1001000003198B280430860096308F00C8304220B7
 : 100110008F0B862878280230860097201530EA2039
 : 1001200097201530D620031D75282720782899019F
 : 10013000030165000608F039F03A031D9828F030F5
 : 100140004220060808308B0063005420FF399100DC
 : 1001500003199828F030422004301902031DC328E7
 : 10016000CF20031DB72840304A20110808001B305B
 : 100170008400000884038000840A840A1E3004027C
 : 10018000031DB9289903CF200319972840304A202E
 : 100190001A301907840011088000990A9828233022
 : 1001A0001102031908002A30110208009E0099016B
 : 1001B0001A301907840000089F001E0819078400E0
 : 1001C00000081F02031D0800990A04301902031DCC
 : 1001D000D82808009E0099011A30190784000008E9
 : 1001E0009F001E08190784001F088000990A043028
 : 0801F0001902031DEC280800B0
 : 02400E00F23F7F
 : 0C4200003100320033003400350036007D
 : 00000001FF 


To turn over every time we enter the code:





: 020000040000FA
 : 100000006C2800000000000009001108820760341D
 : 100010003134323433346134343435343634623448
 : 1000200037343834393463342A3430342334643444
 : 100030001530840089018316081483120808800093
 : 10004000840A890A19300402031D1B280800153090
 : 1000500084008901000888008316081208155530AD
 : 100060008900AA30890088148312000000008316DA
 : 10007000081E34288312840A890A19300402031DD9
 : 100080002A2808008D0050308E008E0B45288D0BDD
 : 100090004328080090008615033042208611033063
 : 1000A0004220900B4B280800910104309200FE3052
 : 1000B0006500A0304220060E940004309300910A9F
 : 1000C000940C031C0528930B5F2803148316850DDD
 : 1000D0008312920B592800348501030165008601C3
 : 1000E000F0306600831681138312F0304A20182006
 : 1000F0008F010F0886009B201530DA20031D792818
 : 100100002A30110203198E2804300F068F00860052
 : 100110007928C83042208F0B8928792802300F04B3
 : 1001200086009B201530EE209B201530DA20031D21
 : 100130007528272079289901030165000608F03900
 : 10014000F03A031D9C28F0304220060808308B004E
 : 1001500063005420FF39910003199C28F03042209D
 : 1001600004301902031DC728D320031DBB284030CB
 : 100170004A20110808001B30840000088403800016
 : 10018000840A840A1E300402031DBD289903D3206B
 : 1001900003199B2840304A201A301907840011089F
 : 1001A0008000990A9C2823301102031908002A3084
 : 1001B000110208009E0099011A30190784000008F6
 : 1001C0009F001E081907840000081F02031D080075
 : 1001D000990A04301902031DDC2808009E009901C9
 : 1001E0001A301907840000089F001E0819078400B0
 : 1001F0001F088000990A04301902031DF028080026
 : 02400E00F23F7F
 : 0C4200003100320033003400350036007D
 : 00000001FF 

Operation:

Enter the correct code and press the # key to validate it. By default, the initial code 1 2 3 4. To activate the relay, then type:
1 2 3 4 #
To change the code, type the initial code and then the * key if the code is correct, the LED lights. Then type the new code twice. For example:
1 2 3 4 * 3 0 0 0 # 3 0 0 0 # 1234 this will change the code by 3000.
(Good luck)

No comments:

Post a Comment

Thematic Links :