0% found this document useful (0 votes)
16 views

Micro Controller Based Code Locking System With Alarm

The document describes a microcontroller based code locking system with alarm. The system uses a keypad for entering access codes, a display for showing messages, and a door controller and alarm. An 8051 microcontroller controls the hardware components through a C program. The system aims to increase security by only allowing access to those with the correct code.

Uploaded by

krish13092004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Micro Controller Based Code Locking System With Alarm

The document describes a microcontroller based code locking system with alarm. The system uses a keypad for entering access codes, a display for showing messages, and a door controller and alarm. An 8051 microcontroller controls the hardware components through a C program. The system aims to increase security by only allowing access to those with the correct code.

Uploaded by

krish13092004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/260789643

Microcontroller Based Code Locking System with Alarm

Article in IOSR Journal of Electrical and Electronics Engineering · January 2014


DOI: 10.9790/1676-09120917

CITATIONS READS

4 6,531

3 authors, including:

Diarah Samuel Reuben


Bowen University
17 PUBLICATIONS 81 CITATIONS

SEE PROFILE

All content following this page was uploaded by Diarah Samuel Reuben on 14 March 2014.

The user has requested enhancement of the downloaded file.


IOSR Journal of Electrical and Electronics Engineering (IOSR-JEEE)
e-ISSN: 2278-1676,p-ISSN: 2320-3331, Volume 9, Issue 1 Ver. II (Jan. 2014), PP 09-17
www.iosrjournals.org

Microcontroller Based Code Locking System with Alarm


Diarah Reuben Samuel, OsuekeChristian.O, Egbune Dickson
(Electrical and Information Engineering, College of Science and Engineering/ Landmark University Omu-Aran,
Nigeria)
(Mechanical Engineering, College of Science and Engineering/ Landmark University Omu-Aran, Nigeria
(Electrical and Information Engineering, College of Science and Engineering/ Landmark University Omu-Aran,
Nigeria)

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






 
 
 
 
 
 









 

 

 

 

 








2.2 DISPLAY UNIT:


the display unit consists of 16*2 liquid crstal display that dispays the position of the intruder as well as the
condition of the alarm system. The lower data bus of the LCD is connected to port 2 of the microcontroller
while RS and EN pins are connected to port 3_0 and port 3_1 respectively.

2.3 Key pad unit


Keypads are assembled in a matrix form as illustrated below:

Fig 2.3 4x3 matrix key pad

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.

2.4 Microcontroller unit:


The AT89C51 is a low power, high performance cmos 8-bit microcontroller with 4Kbytes of flash
programmable and erasable read only memory (PEROM). The device is manufactured using Atmel`s high
density nonvolatile memory technology and is compatible with the industry standard MCS-51 instruction set
and pinout. The on-chip flash allows the program memory to be reprogrammed in system or by a conventional
nonvolatile memory programmer. By combining a versatile 8-bit CPU with flash on a monolithic chip, the
Atmel AT89C51 is a powerful microcomputer, which provides a highly flexible and cost effective solution to
many embedded control application.The AT89C51 is designed with static logic for operation down to zero
frequency and support two software selectable power saving modes. The idle mode stops the CPU while
allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power down
mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next
hardware reset.
.

www.iosrjournals.org 12 | Page
Microcontroller Based Code Locking System With Alarm

Fig. 3.22: Pin configuration of AT89S51


Features of AT89S51
 Programmable serial channel
 Compatible with MCS-51TM product
 4Kbytes of in-system Reprogrammable flash memory - Endurance: 1,000 write/Erase cycles
 Fully static operation:0Hz to 24MHz
 Three-level program memory lock
 128 x 8-bit internal RAM
 32 programmable I/O lines
 Two 16-bit timer/counters
 Six interrupt sources
 Low-power idle and power-down modes.

2.5 Alarm unit


This consists of an LED, which connects from the P0.7 of the micro controller, which in turn connects
to 1K resistor, which finally connects to the VCC. The LED indicates on the alarm is set to slow.
P3.7 of the micro controller connects to the resistor (1K), through the base of the transistor (NPN C945) and
the collector to the ground, while the emitter terminal is connected to the negative terminal of the alarm speaker,
and the positive to the Vcc. The remaining terminal of the resistor to Vcc, as shown in the figure 3.4

1k

P2.7 28

vcc
MICRO- CONTROLLER AT89C51

VCC

VCC

Buzzer
4.7k

2k
P2.6 27 C945 or NPN Transistor

GND

Fig. 3.4 Micro controller interface with alarm unit


www.iosrjournals.org 13 | Page
Microcontroller Based Code Locking System With Alarm

2.5.1 Door control segment:


The door control segment consists of an H-Bridge driver IC that guarantee’s the clockwise and the anti
clockwise movement of the electric motor attached to the door system. The H-Bridge driver IC L293D is
designed to control 2 DC motors. There are 2 input and 2 output pins for each motor. The 2 pairs of input
determine the behavior of electric motor attached to it. The chip has two enable pins that must be high (+5V) for
operation.

The behavior of motor for various input conditions are as follows:


A B
Stop Low Low
Clockwise Low High
Anti clockwise High Low
Stop High High
Table 3.5: H-bridge motor control

II. Design Process:


A micro-controller based project design process is characterized by the following;
 Definition of task
 Requirements
 Factor that influence choice
In defining a task, every design comes from an idea or a problem that requires a solution. Questions may be
generated on what exactly that is required to be achieved and the feasibility of the ideas as regards to the
implementation.
If these questions are analyzed critically with tangible solutions to the problem, a development of this idea into a
reality is the next step.
Requirements for design process have to be considered once an idea has been established. The need to
determine whether or not the idea requires a PC or not, depending on the complexity of the circuitry, or whether
the circuits to be designed needs to make a complex decision or deal with complex data.
The compare these factors with topic with IC’s (AND gates) which two inputs when high logic changes
outputs. Preferably, a micro-controller will be the best option based on the circuits to be designed with less
hardware connections and flexibility. Writing a program that performs a desired function accesses the ability of
the micro-controller. However, it came to our thought that among all the components used here the one that
consumes the highest power is the Light Emitting Diodes (LEDs), which need as much as 15-volt to glow and
draw as maximum as 2-ampere of current. As a result if this, I decided to use 15-volts, 2-ampere rated
transformer for this design. After the voltage is stepped down 15-volts using a transformer, a full wave rectifier
circuit was designed using four Diodes (IN4001). This value of Diodes is used here because from the
specification of voltage/Diode rectifying data book, this value is adequate for lower voltages, say 0-24 volt. The
load current of the rectifier is given as follows;
Idc = 21m/3.1

When 1m = maximum current = 2 amp


Idc = load current which is in dc form after recification.
Hence idc = 2*3 / 3.14 =4/3.14, idc = 1.27 amps
Therefore 1.27amps is the maximum load current that can be drawn in the whole system. Also it is known that
after rectification, the same voltage (15-volts) continues to flow into the filter. As a result the load voltages 15-
volts
Thus Vdc = Load voltage = 15volts.
And Vdc = 21m*RL / 3.14
RL = Load resistance
RL = 47.13/4
RL = 11.78* 3.14 = 1.78
From this, it is obvious that V = IR = 1.27 * 1.27

www.iosrjournals.org 14 | Page
Microcontroller Based Code Locking System With Alarm

III. System Block Diagram

Figure 4.1 Block Diagram of Microcontroller Based code based locking system

4.2 System Flowchart

Fig 4.2 system flow chat

www.iosrjournals.org 15 | Page
Microcontroller Based Code Locking System With Alarm

4.3 CIRCUIT DIAGRAM

Fig 4.3 circuit diagram

IV. Software Design


Software, are computer programs; instructions that cause the hardware, the machines to do work.
Software as a whole can be divided into a number of categories based on the type of work done. The two
primary software categories are operating systems (system software), which control the workings of the
computer, and application software, which addresses the multitude of tasks for which people use computers.

Fig .5.1 Software Design

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 */

code unsigned char


digit[16]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0,0x10,0xff,0x03,0x46,0x21,0x06,0x0e};
LCD_row1(); LCD_puts("access blocked!!");
LCD_row2(); LCD_puts("pls enter puk!!");
.
.

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

View publication stats

You might also like