Micro Controller Based Code Locking System With Alarm
Micro Controller Based Code Locking System With Alarm
net/publication/260789643
CITATIONS READS
4 6,531
3 authors, including:
SEE PROFILE
All content following this page was uploaded by Diarah Samuel Reuben on 14 March 2014.
Abstract : The need for strict security measures has been necessary since the beginning of time. Access to
certain places and items need strict restrictions to only the privileged few. This restricted zone can vary from
strong holds and safes in financial institutions to doors leading to restricted areas. The various innovations in
security access system include; code based lock, keycard lock, thumb print scan, retina scan. They come in
handy in security systems. Code based locking system is best suited in most applications because of its
simplicity and reliability. Since the code based locking system is always resident in the area to be protected,
there are fewer chances of security breaches unlike the keycard lock system in which the access card can fall
into unauthorized hands. Furthermore, in the issue of maintenance, the access code can easily be changed at will
with lesser cost unlike in the case of keycard system where a new set of access cards are required. The design
and operational principles of a microcontroller based code locking system is the subject of the thesis.The project
is made of a keypad unit for entering the access code, a dynamic display unit that displays different messages at
specific time, a door controller section made up of a H-bridge driver IC that controls the movement of the motor
attached to the door and an alarm system that triggers when the conditions are bridged. The whole system is
controlled by an 8051 based microcontroller (89s51).
Keywords :Debugging,Hardware, Microcontroller, programming, software.
I. Introduction
www.iosrjournals.org 9 | Page
Microcontroller Based Code Locking System With Alarm
www.iosrjournals.org 10 | Page
Microcontroller Based Code Locking System With Alarm
www.iosrjournals.org 11 | Page
Microcontroller Based Code Locking System With Alarm
The above diagram shows 4x3 keypad – 12 switches in a default state (all switches open) there is no connection
between the rows and columns. When the switch is pressed a connection between the switch’s columns is made.
KEYPAD DECODER
Many keypads are built with an onboard decoder that scan the keypad, and if a key is pressed, returns a number
identifying the key.
The decoder has 7 inputs; the 4 x inputs are connected to the 4 keypad columns while the y inputs are connected
to the 3 keypad rows.
How the keyboard is scanned.
The steps are
Scan row 1
Scan row 2
Scan row 3
Scanning a row is achieved applying 0V to the port pin for that row and 5V to the other three rows, then
scanning each individual column to see if one of them is low. If it is, then the key at the junction between the
current row and column being scanned is the pressed key.
Clear row 1, set other 3
Scan column 1
Scan column 2
Scan column 3
Clear row 2, set other 3
Scan column 1
Scan column 2
Scan column 3
Clear row 3, set other 3
Scan column 1
Scan column 2
Scan column 3
For example, let’s say the key being pressed is key 6. When scanning the first row, P1.0 will be cleared while
the other 3 rows (P1.1, P1.2, and P1.3) are set. Since no key in this row is closed, there is no path for current
through any of the pull up resistors and all 3 columns (on P1.4 to P1.6) are high. Therefore the key pressed was
not found while scanning row 1.
- Scanning row 2 (with 6 still closed) in this case, column 3 is connected through the closed switch to row 2.
Since row 2 is low, column 3 is low
The keypad is initialized in the main program all rows are cleared. Therefore when a key is pressed, since all
rows are LOW, then one of the columns (the one containing the key that has been pressed) will be connected to
0V.
www.iosrjournals.org 12 | Page
Microcontroller Based Code Locking System With Alarm
1k
P2.7 28
vcc
MICRO- CONTROLLER AT89C51
VCC
VCC
Buzzer
4.7k
2k
P2.6 27 C945 or NPN Transistor
GND
www.iosrjournals.org 14 | Page
Microcontroller Based Code Locking System With Alarm
Figure 4.1 Block Diagram of Microcontroller Based code based locking system
www.iosrjournals.org 15 | Page
Microcontroller Based Code Locking System With Alarm
www.iosrjournals.org 16 | Page
Microcontroller Based Code Locking System With Alarm
5.2 Program
#include "at89x51.h"
#define LCD_en P3_1
#define LCD_rs P3_0
#define LCD_DELAY 2000 /* Delay for 1 ms */
#define LCD_clear() LCD_command(0x1) /* Clear display LCD */
#define LCD_origin() LCD_command(0x2) /* Set to origin LCD */
#define LCD_row1() LCD_command(0x80) /* Begin at Line 1 */
#define LCD_row2() LCD_command(0xC0) /* Begin at Line 2 */
alarm();
//delay(2000);
}
}
}
}
}
}
V. Conclusion
This paper microcontroller based code locking system with alarmhas successfully presented a functional
and an easy way to combat crime and theft using a low cost device, and can be remotely applied everywhere
security is needed.
REFERENCES
[1]. Belone Schilling, Electronic Circuits: Discrete and Integrated, McGraw-Hill, New York,1979.
[2]. B.L Theraja and A.K Theraja, A Textbook on Electrical Technology, 2003, 23rd Edition, Pp 1887 – Pp 1888.
[3]. Paul Horowitz and Windfield Hill, The Art of Electronics, 1989, 2nd Edition, Pp 7- Pp 8, Pp 55 – Pp 58, Pp 614 –Pp 622.
[4]. Atmel Corporation Data Sheet on AT89C51, 0285D-B-12/97
[5]. NTE Electronics Inc., ECG Data Book, January 2002, 10 th Edition.
[6]. Giorgio Rizzoni, Principles of Electrical Engineering, 2003, 3rd Edition
www.iosrjournals.org 17 | Page