The alarm will switch off when the 4 keys connected to "A,B,C,D" are pushed in the right order.The circuit works because each gate 'Stands' upon its predecessor.If any key other than the correct key is pushed, then gate 1 is knocked out of the stack, and the code entry fails. Pin 1 is held high by R4. This 'Enables' gate 1; and when button 'A' is pressed, the output at pin 3 will go high. This output does two jobs.It locks itself 'ON' through R2 and it 'Enables' gate 2, by taking pin 5, high. Now, if 'B' is pressed, the output of gate 2, at pin 4 will go high. This output does two jobs. It locks itself 'ON' through R3 and it 'Enables' gate 3 by taking pin 12 high.
Now, if 'C' is pressed, the output of gate 3 will lock itself 'ON' through R5 and, by taking pin 8 high, 'Enable' gate 4. Pressing 'D' causes gate 4 to do the same thing; only this time its output, at pin 10, turns Q4 'ON'. This takes the base of Q5 to ground, switching it off and letting the relay drop out. This switches the alarm off.
Any keys not connected to 'A B C D E' are wired to the base of Q1. Whenever 'E' or one of these other keys is pressed, pin 1 is taken low and the circuit is reset. In addition, if 'C' or 'D' is pressed out of sequence, then Q2 or Q3 will take pin 1 low and the circuit will reset. Thus nothing happens until 'A' is pressed.Then if any key other than 'B' is pressed, the circuit will reset.
The diagram should give you a rough guide to the layout of the components, if you are using a stripboard. The code you choose can include the non-numeric symbols.In fact, you do not have to use a numeric keypad at all,or you could make your own keypad.
author: Ron J
web site: http://www.zen22142.zen.co.uk