Professional Documents
Culture Documents
CBTP Phase 4 Paper
CBTP Phase 4 Paper
June 30 ,2022
Jimma University, Ethiopia
NO Name ID NO
SIGNATURE
1 MAMO TSEGAYE RU 3580/11
2 SAMUEL GEBEYEHU RU 3552/11
3 HANAN AHIMED RU 3735/11
4 METI ALEMU RU 3850/11
As an advisor of this group, I declare that I have advised their work thought the course of this
project and all works included in this document is their work and no plagiarism is takes place. I
assure all this with my signature as follows. Sign date
Sign date
I
Acknowledgment
For our document of CBTP phase 4 project to arrive at this stage, many individuals give us their
forwarding contribution since the beginning. We express our deep sense of gratitude and sincere thanks
to school of electrical and computer engineering for giving such an opportunity. We would like to
express our special thanks of gratitude to Mr. Zemenu, for his valuable recommendations and gave us
the golden opportunity to do this project on the topic student locker security system. Last but not least,
we want to thank our friends who treasured us for our hard work and encouraged us and finally to God
who made all the things possible for giving help and patience in going such hard time.
II
Abstract
Security is a prime concern in today’s modern world. Every one want to be as much secure as
possible.an access control for locker doors forms a vital link in security chain because doors are
the very end outer protections of every valuable thing. Earlier doors were kept private with
mechanical drivers or keys, which everyone can access having them and they are vulnerable for
several problems. So, to solve this problem, we want to design a locker security system using RFID
and GSM technology. The main goal of this project is to design such technology which can be
organized for dorms locker, bank, secured offices and homes. But, our project focuses on dorms
locker. In this system, only authenticated person can open that locker. We try to do a locker security
system based on RFID (Radio –frequency identification) and GSM technology containing door
locking system using RFID and GSM technology which can activate, authenticate and validate the
user and unlock the door. The main advantage of using passive RFID and GSM is that they are
more secured than other systems. This system consists of Microcontroller, RFID reader, GSM
modem, keyboard and LCD. The RFID reader reads the id number from passive tag and sends to
the Microcontroller where it checks whether it is of valid person or not. And also, all information
of those locker owners in that dorm is registered on database and when the owner open its locker
there is sign on the database that can serve as an attendance for Procter’s without moving around
the dorm. If the id number is valid then the controller orders the user to insert password, then the
Microcontroller, will verify the passwords entered by the keyboard (by person present in front of
locker) and the one registered on database .If these two passwords are matched then locker will be
opened otherwise it will remain in locked position .if wrong password is entered there is a buzzer
that give us alarm and also our system sends a message via GSM to the locker owners or Procter’s
optionally according to our commands. Generally, in this project we design a system that can be
used for two purpose.one for security purpose and the other one is as an attendance system.
III
Table of Contents
Declaration ..................................................................................................................................................... I
Acknowledgment .......................................................................................................................................... II
Abstract ........................................................................................................................................................ III
List of Figure................................................................................................................................................. V
Acronomy .................................................................................................................................................... VI
CHAPTER ONE ........................................................................................................................................... 1
INTRODUCTION ........................................................................................................................................ 1
1.1 Background ......................................................................................................................................... 1
1.2 Statement of Problem and Proposed Solution..................................................................................... 2
1.3 Objectives ........................................................................................................................................... 2
1.3.1 main objective .............................................................................................................................. 2
1.3.2 Specific objectives ....................................................................................................................... 2
1.5 Scope of the Project ............................................................................................................................ 3
1.6 Limitation of the project ..................................................................................................................... 3
1.7 Organization of the project ................................................................................................................. 4
CHAPTER TWO .......................................................................................................................................... 5
LITERATURE REVIEW ............................................................................................................................. 5
2.1 Literature Review................................................................................................................................ 5
CHAPTER THREE ...................................................................................................................................... 8
METHODOLOGY AND SYSTEM ANALYSIS ........................................................................................ 8
3.1 System Model ..................................................................................................................................... 8
3.2 System Components and Operations .................................................................................................. 9
3.3 Block diagram ................................................................................................................................... 14
3.4 SOFTWARE PROGRAM TESTING ............................................................................................... 15
CHAPTER FOUR....................................................................................................................................... 16
RESULTS AND DISCUSSION ................................................................................................................. 16
4.1 Result ................................................................................................................................................ 16
CHAPTER FIVE ........................................................................................................................................ 19
CONCLUSION AND RECOMMENDATION .......................................................................................... 19
5.1 Conclusion ........................................................................................................................................ 19
5.2 Recommendation .............................................................................................................................. 20
References ................................................................................................................................................... 21
Appendix ..................................................................................................................................................... 22
IV
List of Figure
Figure 3. 5 keypad....................................................................................................................................... 12
V
Acronomy
AT Atmel
GND Ground
RF Radio Frequency
VI
CHAPTER ONE
INTRODUCTION
1.1 Background
In this present age, safety has become an essential issue for most of the people. Some people will
try to cheat or steal the property of other individual. To overcome the security threat, a most of
people will install bunch of locks or alarm system. There are many types of alarm systems available
in the market which utilizes different types of sensor. The sensor can detect different types of
changes occur in the surrounding and the changes will be processed to be given out an alert
according to the pre-set value. By the same time this system may not be good for all the time.so
we can say that security sector is experiencing diversification as it has never seen before. This has
brought about the need to review the reliability of already existing systems and look into the
possibility of creating better systems that are smarter and more secure. In this paper, we have done
projects on safety of the student’s locker by using RFID and GSM technology which will be more
secure than other systems. The Controlling unit has an application program to allow the
microcontroller read the incoming data and control the engine motor as per the requirement. The
performance of the design is maintained by the controlling unit. This project uses 8051
microcontrollers as the central processing unit with Programs written in C language burnt inside
the microcontroller to perform as it is ordered by the written code.
Basically, RFID system consists of an antenna or coil, a transceiver (with decoder) and a
transponder (RF tag) electronically programmed with unique information. There are many
different types of RFID systems in the market. These are categorized on the basis of their frequency
ranges. Some of the most commonly used RFID kits are low-frequency (30-500 kHz), medium-
frequency (900 kHz-1500MHz) and high-frequency (2.4-2.5GHz). The passive tags are lighter and
less expensive than the active tags. Global system for mobile communication (GSM) is a globally
accepted standard for digital cellular communication. GSM is a common European mobile
telephone standard for a mobile cellular radio system operating at 900 MHz in the current work,
SIM300 GSM module is used. The SIM300 module is a Triband GSM/GPRS solution in a compact
plug in module featuring an industry-standard interface. It delivers voice, data and fax in a small
1
form factor with low power consumption [1].in this paper we have designed a locker security
system based on RFID and GSM technology. In this system, only authentic person can access
his/her items from the locker with two password protection method.
The comfort of being able to take control of property from one particular location has become
imperative as it is much easier than other mechanism over a security system. Knowing your locker
security is protected provides peace of mind both when you are away and when you are home.
Security is important even if you have outstanding public safety agencies in your area. There are
many reasons and problems which motivate us to seek for solutions in the area of security system.
Some of those problems that initiate us to propose this projects are keeping the security of
compound is not protecting us from the thief. Especially during exam there is no student around
the dorm and using this as a chance some individual may try steal the property of students. Due to
such security problem, the student on exam themselves do not take their exam by being
concentrated.so to overcome this problem we propose this idea because knowing the security of
property from the distance is the most attractive.
1.3 Objectives
1.3.1 main objective
The main objective of this project is to design student locker security system based on RFID and
GSM technology.
2
1.4 Significance of the project
Locker security system using RFID and GSM technology delivers several opportunities that we
cannot access in case when we do use this proposed idea. This proposed idea has the following
significance:
We can control the security of our property even if, we are not around the dorm.
As our microcontroller is connected with database and full of our information is
registered on database, Procter’s can use this system as an attendance as there is a sign on
database when we access our locker.
This kind of systems control locker security and other systems, in order to improve
Comfort.
It requires Network access which means the proposed system only works in the places of
good reception of signal.
3
1.7 Organization of the project
This project is composed of five chapters covering introduction, literature review, methodology
and system analysis, results and discussion and the last chapter is conclusion and recommendation.
Chapter one explains introduction of the focus study of the project. Chapter two describes the
literature review that we have used in this proposed idea. Chapter three explains the specific
methodology for the project by presenting and emphasizing the details of methods applied. Here,
the block diagrams and flowcharts related to each objective or scope are also elaborated and
revealed. chapter four gives every detail of the results based on the simulation of the system model.
Chapter five is all about the conclusion and recommendation.
4
CHAPTER TWO
LITERATURE REVIEW
2.1 Literature Review
Now-a-days there is a huge advancement in the area of security system. Security is a prime concern
in today’s modern world and every one want to be as much secure as possible.an access control
for locker doors forms a vital link in security chain because locker doors are the very end outer
protections of every valuable property. Everyone in this world has a unique odour. Identification
of Odour and security question is an extra level security system [2]. the distinctive odour helps the
system to distinguish and identify a person. every time when the user has to access the locker
he/she must under its step. The system questions the user and if the answers are right then the
odour test is followed. The system compares the odour pattern of the user with the already stored
pattern in the database. A device called electronic nose is used for this test. Electronic nose is based
on the technology of e-sensing that reproduces the human sense of sensing smell. The electronic
nose has sensors such as MOSFET, Conducting polymers and quartz crystal microbalance. But
the main drawback of this project is that such kind of idea needs to be supported by a complex
technology.
Face recognition technology [3] is used in this security to find the bank holder. When a person
enters the strong room, the camera in the room captures the picture. The image of the person is fed
as the input to one of the face recognition algorithm. Skin color is used to recognize the person
among the other facial features. This system has few drawbacks due to difference in facial
expression, image orientation and it also has to maintain huge database.
Earlier doors were kept private with mechanical drivers or keys, which everyone can access having
them.in [4] was developed a locker opening and closing system using RFID. This system consists
of microcontroller, RFID reader, GSM modem and LCD. The RFID reader reads the id number
from the passive tag and send it to the microcontroller. GSM mode sent a message to a user phone
when another person try to open his locker which means it sends a message when wrong password
is entered. in addition to this the buzzer give us alarm.
5
In [5], security system using finger print and Iris scan is designed.in this tactic there is a three-
level security system. the first level uses RFID, second level uses finger print scanner and the third
level uses IRIS identification. When the user swipes the tag at the initial stage, if the tag is valid
as the second step is placing the finger on the finger print scanner. if the finger print is accepted,
the user has to go through the third level of IRIS scan. IRIS scan is one of technologies which uses
pattern recognition technique to identify the pattern of human retina and the eye pattern thus
captured is compared with the pattern already stored in the data base. If the pattern is found to be
a match, then the user is allowed to access the locker. This technique consumes time at initial stage.
This system has few drawbacks, as it scans IRIS there is problem in human retina through a time.
In [4] their studies on Arduino based bank locker security system using RFID and GSM, the RFID
reader reads a data from tag and it also send to the Arduino uno microcontroller. If the card
authentic then display shows the eight-digit number of the card read by this Arduino uno
microcontroller. Then the authenticated person needs to enter the password by the keypad, if the
password is valid then it sends the SMS to account holder’s mobile number.
In [5] was designed and implemented a digital security system using passive type RFID which be
able to activate and authenticate the user and open the door for secure access in actual time.
In this research, constructed RFID based automated bank locker system. major drawbacks of
manual locker system are lack of security and the wait time of the customer. This can be overcome
by any automatic locker system. in this project, RFID tags are used which holds the user
information like locker number, username, phone number etc. this RFID tags which read by the
RFID reader will automatically open and close the locker.
Motion sensors has a vital role in security systems. Motion sensor [6] is a device which detects the
motion or different movements around it. The sensor sends signals, thus altering the control panel
whenever an intruder is trying to open the locker. In [7] Active sensors emit signals such as infrared
signals, sound signals and microwave signals. A few sensors use vibrations and ultrasonic waves
to detect motion.
6
There are two security levels in this system. In [8] PIR sensor and IR proximity detection are used
in the first and second levels respectively. Programmable system on chip technology is used to
interface these two detection algorithms’ sensors used to detect infrared light waves emitting from
objects around it, whereas IR proximity detection detects the nearby objects.IR proximity sensor
detects objects closer to the sensor [9]. The main component in IR sensor is, IR LED which radiates
infrared radiations that are reflected when an object is in vicinity of sensor. The main drawback is
that there are some colors and objects that absorbs infrared rays and hence there is no reflection.
After going through many research papers which were related to field of security system, we have
decided to proceed with our project on locker security system by using RFID and GSM technology.
Because we think that our proposed idea removes all the drawbacks raised above and give us good
security service.
7
CHAPTER THREE
START
SCAN YOUR ID
IS SCANNED ENTER
INVALID ID CARD
NO ID VALID? YES PASSWORD
ALARM LOCKER
OPENED
Figure 3.1 flowchart of the design
8
The GSM modem provides the communication media between the user and the system by means
of SMS messages. Finally using GSM networks, locker security system has been proposed and
simulated. The above flowchart shows full description of the system beginning from when we start
to scan our identification card up to when the locker is opened step by step.
9
GSM Module
GSM module SIM300 is being used in the project here. It is just like a cell phone with all the
facilities of sending and receiving a message, sending and receiving calls. It has a communication
that can be programmed using AT commands. The signal names for the GSM modem
communication port include the following; audio input and output pins (for connecting external
hands free audio devices), mute control pin, flash programming signal pins, external power pins,
and receiver and transmitter pins.
Here the RX and TX pins are used for the serial communication with the microcontroller. There
are various AT commands to check the signal strength and connection and SIM status etc. [6].
Here the Hyper Terminal is used to initially interface with the computer to check the module. It
also has an antenna to receive the GSM signal from the user’s phone. The basic AT commands are
loaded into the program of microcontroller for it to interface with the GSM module. The figure
given below shows a GSM module.
Specification:
10
RFID
11
Figure 3. 4 element of RFID system
Matrix Keypad
Keypad is most widely used input device to provide input from the outside world to the
microcontroller. a matrix keypad consists of a set of pushbuttons which are interconnected. In this
project, a 4X3 matrix keypad in which there are 4 rows and 3 columns is used. It is interfaced to
microcontroller to enter the password.
Figure 3. 5 keypad
Microcontroller
The microcontroller incorporates all the features that are found in microprocessor. The
microcontroller has built in ROM, RAM, Input Output ports, Serial port, timers, interrupts and
clock circuit. A microcontroller is an entire computer manufactured on a single chip.
Microcontrollers are usually dedicated devices embedded within an application. For example,
microcontrollers are used as engine controllers in automobiles and as exposure and focus
12
controllers in cameras. In order to serve these applications, they have a high concentration of on-
chip facilities such as serial ports, parallel input output ports, timers, counters; interrupt control,
analog-to-digital converters, random access memory, read only memory, etc. The I/O, memory,
and on-chip peripherals of a microcontroller are selected depending on the specifics of the target
application. Since microcontrollers are powerful digital processors, the degree of control and
programmability they provide significantly enhances the effectiveness of the application. 80C51
is a low-power, high-performance CMOS 8-bit microcontroller with 4KBytes of in-system
programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile
memory technology and is compatible with the industry-standard 80C51 instruction set and pin
out. 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 in system
programmable Flash on a monolithic chip, the Atmel AT89c51 is a powerful microcontroller
which provides a highly-flexible and cost-effective solution to many embedded control
applications.
Specification:
13
3.3 Block diagram
Our methods of work are organized and accomplished through a sequence of stages. Prior to all,
we have reviewed related literature's. Then we have made the general block diagram for our system
that enables as to easily analyze each above components of the system as shown in the following
figurative expressions.
Power Supply
LCD
GSM
Micro
controller Motor
RFID Motor
Reader driver
Buzzer
Keypad
As it is shown in the above block diagram interconnection of those individual devices result locker
security system which is based on RFID and GSM technology.as we see from the diagram
components are connected with microcontroller and power is supplied to the microcontroller.
14
3.4 SOFTWARE PROGRAM TESTING
The software program is written in c or assembly language and compiled using keil software. After
compiler operation, the hex code is generated and stored in the computer. The hex code of the
program is burnt into the AT80C51 by using Top Win Universal programmer.
Keil micro vision5
The Micro-Vision IDE is a Windows-based software development platform that Combines a
robust editor, project manager, and makes facility. Micro-Vision integrates all Tools including the
C compiler, macro assembler, linker/locator, and HEX file generator. It helps expedite the
development process of your embedded applications by providing the following:
Full-featured source code editor
Device database for configuring the development tool setting
Project manager for creating and maintaining your projects,
Integrated make facility for assembling, compiling, and linking your embedded
Applications,
True integrated source-level Debugger with high-speed CPU and peripheral
Simulator.
GDI interface for software debugging in the target hardware and for Connection to
Keil ULINK,
Flash programming utility for downloading the application program into Flash ROM,
Links to development tools manuals, device datasheets & user’s guides.
The Micro-Vision IDE offers numerous features and advantages that help you quickly and
successfully develop embedded applications. They are easy to use and are guaranteed to help you
achieve your design goals.
15
CHAPTER FOUR
RESULTS AND DISCUSSION
In this chapter, we cover every detail of the results based on the simulation of the system model.
4.1 Result
Now days in order to design new system or to improve the performance of existing system
sometimes simulation is commonly used. So, in this project to validate our design we use proteus
platform for our circuit and Keil micro vision5 for coding. By using the inter connection of
different component the overall circuit diagram of the system is as shown below. The general
circuit of the system is shown in figure 4.1.
16
The power supply is provided first and through voltage regulator, the circuit components receive
their proper supply voltage. After that, the LCD displays the required BCD code. The code is
received by the module and checks the code availability. For correct code(password), LCD
displays the “valid password” as follows‟ at same time the motor is turned on and the locker is
opened successfully.
The above figure is description of the system when valid (the password the match with the one
on the database) password is entered.
As it is shown in the bellow figure, for wrong code (pass word), LCD displays INVALID
PASSWORD. At the same time the sounder (buzzer) make sound and GSM send message as
there is a problem. Now in this case the Procter or owner of the locker can take an action.
17
Figure 4.3 Simulation result for invalid password
18
CHAPTER FIVE
CONCLUSION AND RECOMMENDATION
5.1 Conclusion
The knowledge and application of new techniques in electronics and telecommunication has made
our life more secured and comfortable. The project is meant for security systems whose access is
only for respected authorities. This paper can be designed as a locker security system using RFID
and GSM technology for students. Using RFID reader, the identification card is scanned, next to
this using a microcontroller the password entered is checked with the stored password and then
does the corresponding operations. Here we use a 6 digit passwords.
Our project is a low cost, low in power consumption, compact in size and standalone system. The
authenticated customer’s information (such as name, id, phone number and password) can be
stored in microcontroller’s memory and database system. The memory capacity can also be
increased if the customer limit exceeds.
As we use GSM modem device in our project it serves us as a communication media between the
user and the system by means of SMS message. which means this device allow us to control the
security of our system from the area we want.
When we completed this project, we had learned and understand the process of designing the
locker security system. We also know and understand the microcontroller 8051 and how to
implement it on our project. Designing code lock and RFID based security system is very
interesting for us where we can get involve in programming environment seriously. Our digital
code lock performed as expected.
We feel that this digital code lock RFID and GSM based security control system is very marketable
because it is easy to use, comparatively inexpensive due to low power consumption and highly
reliable. This digital code lock and RFID based security control is therefore particularly useful in
applications such as hotel room door locks, residential housing and even office buildings.
19
5.2 Recommendation
The proposed system in this paper can perform locker security system. The project we have
undertaken can be used as a reference or as a base for realizing a scheme to be implemented in
other projects of greater level. So, for anyone who want to use or modify this project we
recommend that, he/she will add image processing in his/her project as it gives good security
service and for further control.
20
References
[1]. Kumar Chaturvedula .U.P, “RFID Based Embedded System for Vehicle Tracking and Prevention of
Road Accidents”, International Journal of Engineering Research & Technology (I JERT), Vol. 1 Issue 6,
August– 2012, ISSN: 2278-0181.
[2] SanalMalhotra, “Banking Locker System with Odor Identification & Security Question Using RFID
GSM Technology”. International Journal of Advances in Electronics Engineering – IJAEE Volume 4: Issue
3
[3] Roshiny Thomas, Sanjana Mathews, SonaOjus, SonaRoselin Joseph, “Bank Locker Security System
Using Face Recognition”. International Journal of Engineering Research in Electronics and Communication
Engineering (IJERECE) Vol 1, Issue 5, April 2015.
[4] Abhilasha A Sayar ,Dr. Sunil N Pawar,“Review of bank locker system using embedded
system’’.International journal of advanced research in computer and communication engineering.
[5] Mr.Dilip Chandra E, Ms.GeethaHanumanthu, “Wireless Identification Of RFID, Fingerprint & IRIS”
.International journal of innovative research and development.
[6] Malik Sikandar Hayat Khiyal, Aihab Khan, and Erum Shehzadi. “ SMS Based Wireless Home
Appliance Control System (HACS) for Automating Appliances and Security”, Issues in Informing Science
and Information Technology. Vol. 9. pp. 887 – 894. 2009.
[7] Al-Ali, A.R. Rousan, M.A. Mohandes, M. “GSM-Based Wireless Home Appliances Monitoring &
Control System”, Proceedings of International Conference on Information and Communication
Technologies: From Theory to Applications, pp 237-238, 2004.
[8] Seshapu Prasad, D.Suneel, “ MOTION SENSOR BASED SECURITY LOCK AND THEFT
DETECTION”. International journal of Science Technology and Management.Vol No.4, Issue No.01
[9] Islam, N.S. Wasi-ur-Rahman, M. “An intelligent SMS- based remote Water Metering System”. 12th
International Conference on Computers and Information Technology, 2009, 21-23 Dec. 2009, Dhaka,
Bangladesh. International Conference on Robotics, Vision, Information and Signal Processing 2007
(ROVISP2007), Penang, 28 – 30 November 2007.
21
Appendix
lcd_cmd(0x80);
#include<reg51.h>
lcd_str("JIMMA INSTITUTE ");
#include<string.h> lcd_cmd(0xc0);
void delay(unsigned int i); lcd_str("OF TECHNOLOGY ");
void lcd_cmd(unsigned char a); delay(65000);
void lcd_data(unsigned char b); while(1){
void lcd_init(void); lcd_cmd(0x01);
void lcd_str(unsigned char *str); lcd_cmd(0x80);
void sendser_char(unsigned char b); lcd_str(" Waiting For ");
void sendser_str(unsigned char *str); lcd_cmd(0xc0);
void sms_send(unsigned char s); lcd_str(" RFID Tag ");
void delay_ms(unsigned int i); for(i=0;i<10;i++){
void clear(void); while(RI==0);//suc 1 char recived
void gsm_link(void); RI=0;
void keypad(void); a[i]=SBUF;//a[0]='1',a[1]='0'}
sbit rs=P3^2; a[10]='\0';
sbit en=P3^3; if(0==strcmp("1234360R",a)){
sbit m11=P3^4; lcd_cmd(0x01);
sbit m12=P3^5; lcd_cmd(0x80);
sbit buzz=P3^6; lcd_str(" ID CARD : 1");
sfr ldata=0x90;//port1 lcd_cmd(0xc0);
sbit r1=P2^0; lcd_str(a);
sbit r2=P2^1; delay(65000);
sbit r3=P2^2; clear();}
sbit r4=P2^3; else {
sbit c1=P2^4; lcd_cmd(0x01);
sbit c2=P2^5; lcd_cmd(0x80);
sbit c3=P2^6;// lcd_str(" INVALID ID CARD");
sbit r=P2^0; lcd_cmd(0xc0);
sbit e=P2^1; lcd_str(a);
unsigned int i; delay(65000);
unsigned char a[100];// clear();}}
unsigned char a[100],mesg_rec,pwd[5],p; buzz=0;
unsigned int i; m11=0;
void ser_int() interrupt 4 { m12=0;
if(RI==1) { TMOD=0x20;//timer1 mode2 -auto reload
RI=0; mode
a[i]=SBUF; TH1=0xfd;//9600 baud rate
i++; SCON=0x50;//8bit data ,1start bit,1stop bit
mesg_rec=1;} IE=0x90;//EA=1,ES=1...
if(TI==1) { TR1=1;
TI=0;}} gsm_link(); //sms_send();
void main(){ while(1){
TMOD=0x20;//timer1 mode2 -auto reload mode lcd_cmd(0x01);
TH1=0xfd;//9600 baud rate lcd_cmd(0x80);
SCON=0x50;//8bit data ,1start bit,1stop bit lcd_str(" STUDENT LOCKER ");
TR1=1; lcd_cmd(0xc0);
lcd_init(); for(p=0;p<7;p++){
lcd_str(" WELCOME TO "); pwd[p]='\0'; }
lcd_cmd(0xc0); p=0;
lcd_str(" our PROJECT "); while(p<6)//"123456\0" {
delay(65000); keypad(); }
lcd_cmd(0x01); pwd[6]='\0';
22
if(0==strcmp(pwd,"123456")) { if(r1==0)//r1 is pressed {
delay(65000); lcd_data('1');pwd[p]='1';p++;
lcd_cmd(0x01); //pwd[0]='1',pwd[1]='2',pwd[2]='3',pwd[3]='4',pwd
lcd_cmd(0x80); [5],pwd [6]}
lcd_str(" ENTER PASSWORD "); if(r2==0)//r2 is pressed {
lcd_cmd(0xc0); lcd_data('4');pwd[p]='4';p++; }
lcd_str(" Valid password "); if(r3==0)//r1 is pressed{
sms_send(0); lcd_data('7');pwd[p]='7';p++;}
delay(65000); if(r4==0)//r2 is pressed {
lcd_cmd(0x01); lcd_data('9');pwd[p]='9';p++; }
lcd_cmd(0x80); if(r5==0){
lcd_str(" LOCKER IS OPENING"); lcd_data('11');pwd[p]='11';p++;}
lcd_cmd(0xc0); if(r6==0) {
lcd_str(" "); lcd_data('*');pwd[p]='*';p++; }
m11=1; else if(c2==0)//c1 is pressed {
m12=0; r1=r2=r3=r4=r5=r6=1;
delay(65000); delay(65000); c1=c2=c3=0;
lcd_cmd(0x01); if(r1==0)//r1 is pressed {
lcd_cmd(0x80); lcd_data('2');;pwd[p]='2';p++; }
lcd_str(" LOCKER OPENED"); if(r2==0)//r2 is pressed {
lcd_cmd(0xc0); lcd_data('5');pwd[p]='5';p++; }
lcd_str(" "); if(r3==0)//r1 is pressed {
m11=0; lcd_data('8');pwd[p]='8';p++; }
m12=0; if(r4==0)//r2 is pressed {
delay(65000); delay(65000); lcd_data('0');pwd[p]='0';p++;}}
lcd_cmd(0x01); else if(c3==0)//c1 is pressed {
lcd_cmd(0x80); r1=r2=r3=r4=1;
lcd_str(" LOCKER CLOSING"); c1=c2=c3=0;
lcd_cmd(0xc0); if(r1==0)//r1 is pressed {
lcd_str(" "); lcd_data('3');pwd[p]='3';p++;}
m11=0;
m12=1; if(r2==0)//r2 is pressed {
delay(65000); delay(65000); lcd_data('6');pwd[p]='6';p++; }
lcd_cmd(0x80); if(r3==0)//r1 is pressed{
lcd_str(" LOCKER CLOSED"); lcd_data('9');pwd[p]='9';p++; }
lcd_cmd(0xc0); if(r4==0)//r2 is pressed {
lcd_str(" "); lcd_data('#');pwd[p]='#';p++; }}}
m11=0; void sms_send(unsigned char s){
m12=0;} lcd_cmd(0x01);
else{ lcd_cmd(0x80);
lcd_cmd(0x01); lcd_str(" SMS SENDING");
lcd_cmd(0x80); delay_ms(650);
lcd_str(" ENTERED PASSWORD "); sendser_str("AT+CMGS=");
lcd_cmd(0xc0); sendser_char(0x22);//"
lcd_str(" IS INCORRECT "); sendser_str("0987875643");
delay(65000); sendser_char(0x22);//"
buzz=1; sendser_char(0x0d);
delay(65000); if(s==0){
buzz=0;}}} sendser_str(" LOCKER IS OPENED
void keypad(void){ SUCCESSFULLY");}
delay(65000); else{
c1=c2=c3=1; sendser_str(" LOCKER IS NOT OPENED ");}
r1=r2=r3=r4=r5=r6=0; sendser_char(0x1a);//sms sent
if(c1==0)//c1 is pressed { lcd_cmd(0x01);
r1=r2=r3=r4=r5=r6=1; lcd_cmd(0x80);
c1=c2=c3=0; lcd_str(" SMS SENT");
23
delay_ms(650);} SBUF=b;
void gsm_link(void){ while(TI==0);
loop: i=0; TI=0;}
sendser_str("AT"); void sendser_str(unsigned char *str){
sendser_char(0x0d); while(*str){
lcd_cmd(0x01); sendser_char(*str++);}}
lcd_cmd(0x80); void clear(void){
if(a[2]=='O'&&a[3]=='K'){ unsigned int i;
lcd_str(" GSM LINK IS UP");} for(i=0;i<100;i++){
else{ a[i]=0;}}
lcd_str(" GSM CHECKING");
goto loop;}
clear();
delay_ms(650);
loop1: i=0;
sendser_str("AT+CMGF=1");
sendser_char(0x0d);
lcd_cmd(0x01);
lcd_cmd(0x80);
if(a[2]=='O'&&a[3]=='K'){
lcd_str(" GSM TEXT MODE");}
else{
lcd_str(" GSM NOT IN TEXT");
goto loop1;}
clear();
delay_ms(650);}
void lcd_init(){
lcd_cmd(0x38);
lcd_cmd(0x0c);
lcd_cmd(0x01);
lcd_cmd(0x80);}
void delay(unsigned int i){
unsigned int j;
for(j=0;j<i;j++);}
void delay_ms(unsigned int i){
unsigned int j,k;
for(j=0;j<i;j++)
for(k=0;k<1275;k++);}
void lcd_cmd(unsigned char a){
rs=0;//cmd
ldata=a;
en=1;
delay(5);
en=0;
delay(5);}
void lcd_data(unsigned char b){
rs=1;//data
ldata=b;
en=1;
delay(5);
en=0;
delay(5);}
void lcd_str(unsigned char *str){
while(*str){
lcd_data(*str++);}}
void sendser_char(unsigned char b){
24