You are on page 1of 13

Project Report

Electronic Number Lock

Introduction
A lock is an integral part of every house. A man can have peace of mind only when he has a proper mechanism to lock his house when he is away. At present mechanical locks are being used. These locks have levers in them that are used to lock or unlock the unit. Keys that have a particular pattern of cuts and notches on them control these levers. Each lock opens only if the pattern of cuts and notches inside it match with the pattern on the key. The main disadvantage of this mechanism is that one cannot open the lock if one has lost or misplaced the key. The house owner will be stranded outside his house if he loses the keys to his front door. This conventional lock-and-key mechanism poses a lot of security problems too. Any number of duplicate keys can be easily made from the original key. These duplicate keys may be used for unauthorized access without the knowledge of the owner. Burglars may find the right key to open the lock by trying different keys one after the other from a bunch of keys. An expert thief doesnt even need a proper key to open a lock. He can merely do it with a hairpin. If everything else fails, the thief can physically break open the lock. As Electronics Engineering students, we have tried to develop an electronic mechanism to overcome these problems. We present here, an Electronic Number Lock system. This lock opens only when the user types in the correct code set earlier. Unauthorized access is impossible since no one can enter without the knowledge of the code. The entry of a wrong code more than twice sets off a buzzer that informs the owner or neighbours of an intruder. Since the locking mechanism is placed inside the house, tampering with the lock is not possible. Multiple access is possible since anyone possessing the code can open the lock. This is not possible with the conventional lock-and-key mechanism unless each user has his own key. The code number to open the lock can be easily changed by the user whenever he wishes. This lock can be used in homes, cars, safes or anywhere where there is a locking requirement. Thus, this innovative project provides a safe and tamper-proof locking solution.

www.projecttopics.info

Project Report

Electronic Number Lock

Description
The Electronic number lock has four main parts- a DTMF keypad, a set of thumbwheel switches, a logic circuit and an electromagnetic locking mechanism. The keypad is installed outside the house along with a switch for opening the lock (Open) and a switch for clearing the memory (Clear/Lock). The thumbwheel switches, logic circuit and the electromagnetic locking mechanism are installed inside the house. Two switches one for opening the lock and another for clearing the memory are also installed inside. The user can set the three-digit code number using the thumbwheel switches. Anyone trying to open the door should, first type the correct code through the keypad. Once the correct code is set he can use the Open switch to open the lock whenever he wishes. An Open LED (Green) informs the user that the correct code has been keyed in. When the user wants to clear the memory of the correct code, he may use Clear/Lock switches either from inside or outside. When this is done, a Locked LED (Red) lights up. Hence, when the user leaves the house, he merely has to press the Clear/Lock switch to lock the door. Locking from inside is done in the same way using the Clear/Lock switch installed inside. Attempts to enter the wrong code more than two times will sets off a buzzer installed in a hidden location. This alerts the owners/neighbours of the presence of the intruder. Only typing the correct code can reset this buzzer. The user can open the lock from inside by just pressing the Open switch installed inside.

www.projecttopics.info

Project Report

Electronic Number Lock

Working
The working of the main parts of the circuit is explained below in detail. THE DTMF KEYPAD: The keypad circuit consists of a telephone dialler keypad, a dialler IC (UM91214) and a decoder IC (KT3170). The principle of DTMF (Dual Tone Multi-Frequency) is used to generate the BCD code of the pressed digit. Each digit in the DTMF code corresponds to a combination of two discrete frequencies one each from a low and a high group of frequencies, which are generated when any switch on the dialler keypad is pressed. Figure shows such a keypad along with the frequencies associated with each row and column. The keypad is used in conjunction with the dialler IC UM91214 to generate the pair of frequencies. The DTMF signals are decoded by IC KT3170 to give the BCD code of the pressed digit. THE THUMB WHEEL SWITCH: The user sets the three-digit code number using the thumbwheel switches. Each thumbwheel switch generates the BCD code of the number selected. Flipping the handle of the thumbwheel switch changes the selected numbers. THE LOGIC CIRCUIT: The logic circuit compares the numbers typed in by the user with the numbers set on the thumbwheel switches. Both the signals from the keypad and the thumbwheel switches are in the BCD format. The number comparisons are done by the XOR gates. Each significant digit of the thumb wheel switch and the keypad outputs are wired to the corresponding pins of an XOR gate. The XOR gate gives a LOW output only when both its inputs are either HIGH or LOW. Hence, there are four XOR gates for comparing each number. The outputs of the XOR gates are wired to two OR gates. If both the numbers match, the outputs of both the OR gates will be LOW. If there is any mismatch, the output of either or both OR gates will be HIGH. The outputs of the OR gates are wired to a NOR gate. If the

www.projecttopics.info

Project Report

Electronic Number Lock

numbers match, then the output of the NOR gate will be HIGH. Any mismatch causes the output of the NOR gate to become LOW.

Thus each NOR gate output becomes HIGH when the number on the thumbwheel switch corresponding to it and the typed in number match. A 3-bit ring counter is set up so that Q3 is always HIGH when the Clear/Lock switch is pressed. This switch also clears all the flipflops F1-F3. The clock for the ring counters is provided from the DTMF detect signal from IC KT 3170. When the first number is typed on the keypad, RQ1 becomes HIGH and the AND gate A1 is enabled. If the numbers match, then the output of NOR gate N1 will be HIGH. Since both the inputs of the A1 are HIGH, its output is HIGH. The output of A1 is wired to the clock of the D flip-flop (F1). The D input of F1 is always held HIGH. Due to the arrival of the clock signal from A1, the output of F1 goes HIGH (FQ1). Similar stages are connected for the second and third numbers. The outputs of these flip-flops: FQ1, FQ2, and FQ3 are wired to the inputs of an AND gate. Hence only if the outputs of all the flip-flops are HIGH, will the output of the AND gate A4 be HIGH. This happens only if all the three typed in numbers match with the numbers on the thumbwheel switches. Once the correct code is set, the output remains HIGH till the Clear/Lock switch is pressed. Hence the relay can be driven by pressing the OPEN switch S1. As long as the code is set, the user can use S1 to open the lock and enter. To clear the memory, i.e., lock the door from outside, the Clear/Lock switch S3 is to be pressed. The output of A4 is used to light a green LED and it is inverted and used to light a red LED. When the code is set, the green LED lights up and when it is cleared, the red LED lights up. The lock can be opened from the inside anytime by pressing the OPEN switch S2 since it directly switches the relay. The memory can be cleared

www.projecttopics.info

Project Report

Electronic Number Lock

from inside by pressing the Clear/Lock switch S4. This enables locking from inside. IC 7490 is wired as a decade counter. The DTMF detect signal is used as a clock. Hence 7490 counts each keypad entry. The MSB of the output of 7490 is connected to a buzzer. Thus, no one is allowed to make more than two wrong entries. If any such attempt is made, the buzzer, which is kept in a hidden location, will be set off. The buzzer can be reset only by keying in the correct code number since the reset pin of 7490 is wired to the output A4. The entry of the correct code causes the output of A4 to go HIGH, which causes 7490 to be reset to zero. The relay is driven by the transistor SL100, which is switched by BC148. When the switches S1 and S2 are open, there is no signal at the base of BC148 and it is in the OFF state. This results in SL100 being in the ON state and a current flows through the relay coils. When either switch S1 is pressed after typing the correct code or S2 is pressed, a signal at the base of BC148 causes it to turn ON. This results in the base of SL100 being grounded. Hence SL100 turns OFF. This current flow through the relay coils cease and the relay switches. The Electromagnetic Locking Mechanism: This mechanism is placed on the door. The electromagnet consists of a solenoid that is wound on a hollow cylindrical core. It draws power from a 220V dc source. A metal shaft is inserted inside the core. This shaft is attached to the electromagnet unit by a spring. When the magnet is not energized, the spring is in its relaxed position and the shaft is held tight inside the doorjamb, effectively locking the door. When the magnet is energized by switching the relay, the shaft is attracted to the centre of the core. Thus, the shaft moves out of the jamb, releasing the lock. When the Open switch is released, the tension in the spring brings the shaft back to the default position, thus locking the door again.

www.projecttopics.info

Project Report

Electronic Number Lock

Telephone dialler keypad switch matrix

DTMF Signal Output Codes

www.projecttopics.info

Project Report

Electronic Number Lock

Block Diagram

www.projecttopics.info

Project Report

Electronic Number Lock

Power Supply
The unit is powered from the ac mains. A 6-0-6 transformer is used to step down the supply voltage to 12V. This is rectified using a bridge rectifier and filtered to obtain a 12V dc. A 12V regulator IC 7812 regulates this voltage. This regulated 12V dc supply is used to energize the relay. The unregulated 12V dc supply is also fed to a 5V regulator IC 7805. The regulated 5V dc from this IC is used to energize all the digital ICs. Heat sinks are fitted on the regulator ICs to prevent overheating. The electromagnet is powered by a 220V dc voltage. This is obtained from the ac supply after rectification and filtering. This supply reaches the solenoid through the relay.

Initial Problems and Solutions


We encountered many problems while developing this circuit. Problems that arose due to careless oversight were easily rectified. Meanwhile, certain logical hurdles presented formidable challenges. Ultimately we were able to develop a hassle-free working circuit. The various problems encountered by us at various stages and how we solved them are explained below. Initially we had used multiplexers and demultiplexers for the logic part of the circuit. But we found that these ICs consumed too much power. Hence we replaced these ICs and used XOR gates instead. The next problem arose with flip-flops. Three flip-flops are wired as storage elements. These flip-flops showed random outputs when the power was switched on. This problem was solved when a provision was made to clear these flip-flops. Another three flip-flops are wired as a ring counter. This requires the output of the first two flip-flops to be LOW and the output of the third flip-flop to be HIGH. This was solved by connecting the Clear pins of the first two flip-flops and the Preset pin of the third flip-flop to the Clear/Lock switch. The buzzer part also presented some problem. We used the MSB of the decade counter IC 7490 to set off the buzzer. The clock to the counter was obtained from the DTMF detect signal of IC 3170. The buzzer was set off when the decade counter counted up to 8 (1000) as planned. But the counter still continues counting and two more hits on the keypad leads to a count of 0 (0000). This turns off the buzzer. This problem was solved by
www.projecttopics.info

Project Report

Electronic Number Lock

gating the clock signal to the counter through an AND gate which is enabled as long as the MSB of the counter is 0 and is disabled once the MSB becomes 1. The reset pins of the counter were wired to the output of the four-input AND gate so that the count is reset when the correct code is typed. Another problem arose due to a residual HIGH in the third storage flip-flop from a number keyed in earlier. This caused the third flipflop output to go HIGH when the Clear/Lock switch was pressed. This was solved by wiring the flip-flops so that flip-flop 3 is cleared as soon as a HIGH is formed at the output of the first AND gate. The final problem occurred in the relay part. We found that when the power supply was switched on, a current suddenly flowed through the relay and switched it. This caused the energisation of the electromagnet. This was overcome by isolating the electro magnet from the relay by a switch till the relay has switched.

Modifications
The number of digits in the code number can be easily increased by adding more stages of comparators and thumbwheel switches. The number of entries and exits can be displayed by installing a counter. Another keypad can be installed inside the room if both entry and exit are to be restricted. Instead of an electromagnetic locking mechanism an actual powerful electromagnet can be used to lock the door.

www.projecttopics.info

Project Report

Electronic Number Lock

Parts List
ICs
UM91214 KT3170 DM74LS86 DM74LS32 DM74LS02 DM74LS08 DM74LS00 74HC21 DM74LS74 DM74LS90 MC 7805 MC 7812 DTMF Encoder DTMF Decoder Quad 2-input XOR Quad 2-input OR Quad 2-input NOR Quad 2-input AND Quad 2-input NAND Dual 4-input AND Dual D Flip-Flop Decade Counter 5V Regulator 12V Regulator

Resistors
150 1K 120K 10K 100 4.7 K X X X X X X 1 15 1 1 2 5

Capacitors
100 F 0.1 F 0.47 F 220 F 2200 F X X X X X 1 2 1 2 1

Transistors
BC 148 SL 100

Crystal (3.578 MHz) LED Diode (1N4007)


www.projecttopics.info

x x x

1 2 9

Project Report

Electronic Number Lock

Further developments
The Electronic Number Lock has a lot of scope in security applications. Consider a company, where the Electronic Number Lock is installed. Primarily, it can be used to restrict access to authorized people only. Various types of input mechanisms can be used to recognize the authorized people. In addition to the code number, palm-pattern readers, retina-scanners or voice recognition can be used to operate the locking mechanism. Hence an intruder has no chance of opening the lock. When the presence of an intruder is detected, a loud alarm may be set off. For additional security, a transmitter can be set up so that the police are automatically alerted of the presence of an intruder. Smoke detectors can be set up so that the door is automatically opened in the event of a fire. A transmitter can be set up to inform the Fire Station in such an event. The circuit can be modified to accept signals from a remote control. This totally eliminates the need for a keypad. The remote control can be then used to lock and open the door.

www.projecttopics.info

Project Report

Electronic Number Lock

Conclusion
In this age of increasing crime, it is of utmost importance that we replace the conventional methods of security. Electronics has made rapid advances and it is time that we make use of the technology available to make our lives more secure. In many foreign countries the whole home security is controlled by electronics. The security system of each house is connected to a control centre and any security breach is immediately communicated to the nearest police station. This simple Electronic Number Lock is a small step towards such an integrated security system. The day-by-day advances in technology should be used to make our world more secure.

www.projecttopics.info

Project Report

Electronic Number Lock

Reference
Electronics Lab Manual K.A.Nawas Electronics For You (March 99) Calling Line Identification

Fairchild Semiconductor Website [http://www.fairchildsemi.com]

www.projecttopics.info

You might also like