Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 18

DEPARTMENT OF ENGINEERING PROJECT REPORT TITLE:- 8051 BASED DIGITAL CODE LOCK

Submitted To:
Er. MIRDULA MALHOTRA MAM Department of ECE (LPU)

Submitted By :
MANISH KUMAR PRAKASH KUMAR MANISH KHAKHA

RAJEHWAR YADAV

Acknowledgement
I sincerely feel that the credit of this Project could not be narrowed to only one individual as the whole work is outcome of integrated efforts of all those concerned with it through whose cooperation and effective guidance I could achieve its completion. I wish to place my profound indebtness and deep sense of obligation to Er.,MIRDULA MALHOTRA MAM Senior lecturer Lovely Professional University for providing me with the opportunity to work onsuch an interesting Project. I also want to pay my gratitude and sincere thanks to my esteemed Miss.for being supportive and lenient during the entire tenure of this Project.When emotions are involved words fail to mean. My heart full sincere gratitude to my parents,who have supported, encouraged and helped me throughout my life and academic career. 1. MANISH KUMAR(A52) 2.PRAKASH(A48)
3.MANISH KR. KHAKHA(A49) 4.RAJESHWAR(A50)

TABLE OF CONTENS: ABSTRACT EXPLATION BLOCK DIAGRAM FLOW CHART INTRODUCTION OF SOFTWARE
KEIL PROTEOUS

INTRODUCTION OF COMPONENT LCD KEYPAD MICROCONTROLLER SCHEMATICS OF PROJECT

PROGRAMING RESULT ANALYSIS CONCLUSION APPLICATIONS REFRENCES

ABSTRACT
Security is a prime concern in our day-today life. Everyone wants to be as much secure as possible. An access control for doors forms a vital link in a security chain. The microcontroller based Door locker is an access control system that allows only authorized persons to access a restricted area. The system is fully controlled by the 8 bit microcontroller AT89C2051 which has a 2Kbytes of ROM for the program memory. The password is stored in the EPROM so that we can change it at any time. The system has a Keypad by which the password can be entered through it. When the entered password equals with the password stored in the memory then the relay gets on and so that the door is opened. If we entered a wrong password for more than three times then the Alarm is switched on. When we go inside and come back then the microcontroller will sense the person using the Laser light, the microcontroller will automatically open the door for you.

EXPLATION OF PROJECT
Password Based Door Security System using Microcontroller is used in the places where we need more security. It can also used to secure lockers and other protective doors. The system comprises a number keypad and the keypads are connected to the 8 bit microcontroller AT89C2051. This is one of the popular Microcontroller. It has only 20 pins and there are 15 input/output lines. The microcontroller has a program memory of 2 Kilobytes. The microcontroller continuously monitor the keypad and if somebody enters the password it will check the entered password with the password which was stored in the memory and if it they are same then the microcontroller will switch on the corresponding device. The system will allow the person who knows the password and it will not allow who dont know the password and the system will also show the persons who try to break the protection barrier.

BLOCK DIAGRAM

FLOW CHART

INTRODUCTIONS OF SOFTWARE KEIL


Click on project menu and select new project You will be asked to create new project in specific directory Just move to your desired directory and there create a new folder for your project named "first". Here i am creating new project give the name of project as "test". By default it will be saved as *.v2 extension.Now you will be asked to chose your target device for which you want to write the program.Scroll down the cursor and select generic from list. Expand the list and select 8051 (all variants).If you scroll down cursor you will see that all the sfrs like p0-p3, tcon, Tmod, acc, bit registers and byte registers are already defined in this header file. So one can directly use these register names in codingNow you can write your program same as c language starting with void main() After completing the code save the file in project folder with ".c" extension.Now right click on "source group 1" in project workspace window. Select "add files to source gorup 1"Select the c file you have created and click add button You will see that the c file has been added in source group Now to compile the program from project menu select "build target". In the output window you will see the progress If there is any compilation error then target will not be created. Remove all the errors and again build the target till you find "0 error(s)" Now you are ready to run your program. From debug menu select "start/stop debug session" You will see your project workspace window now shows most of the sfrs as well as gprs r0-r7. Also one more window is now opened named "watches". In this window you can see different variable values. To add variable in watch window goto "watch#1" tab. Then type f2 to edit and type the name of your variable If you want to see the output on ports go to peripheral menu and select i/o ports. Select the desire port. You can give input to port pins by checking or unchecking any check box. Here the check mark means digit 1 and no check mark means 0. The output on the pin will be shown in same manner To run the program you can use any of the option provided "go", "step by step", "step

forward", "step ove" etc. Select output tag and check "create hex file" box This file you can directly load in 8051 target board and run the application on actual environment.

NTRODUCTION OF COMPONENTS LCD DISPLAY


The most commonly used Character based LCDs are based on Hitachi's HD44780 controller or other which are compatible with HD44580. In this tutorial, we will discuss about character based LCDs, their interfacing with various microcontrollers, various interfaces (8-bit/4-bit), programming, special stuff and tricks you can do with these simple looking LCDs which can give a new look to your application. The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 charachers, whereas LCDs supporting more than 80 characters make use of 2 HD44780 controllers. Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two pins are extra in both for back-light LED connections). Pin description is shown in the table below.

Pin No.

Name Description

Pin no. 1 Pin no. 2 Pin no. 3 Pin no. 4 Pin no. 5 Pin no. 6 Pin no. 7 in no. 8 Pin no. 9 Pin no. 10 Pin no. 11 Pin no. 12 Pin no. 13 Pin no. 14

VSS Power supply (GND) VCC Power supply (+5V) VEE Contrast adjust RS0 = Instruction input 1 = Data input R/W 0 = Write to LCD module 1 = Read from LCD module EN Enable signal D0 Data bus line 0 (LSB) P D1 Data bus line 1 D2Data bus line 2 D3Data bus line 3 D4Data bus line 4 D5 Data bus line 5 D6 Data bus line 6 D7 Data bus line 7 (MSB)

SCHEMATICS OF PROJECT

PROGRAM:
COMMAND: CLR P3.5 ;FOR RS SRTB P3.6 ;FOR ENABLE MOV P2 ,A RET DATA: SETB P3.0 ;FOR RS SRTB P3.6 ;FOR ENABLE MOV P2 ,A RET

MAIN: MOV A,#01 ACALL COMMAND MOV A,#0C0H ACALL COMMAND MOV A,#LOCK_I ACALL LCD_DAT MOV A,#':' ACALL DATA MOV R1,#05H HERE: MOV A,#5

ACALL GET_INPUT CJNE STATUS,#TRUE,MAIN MOV DPTR,#CHK_12345 DJNZ R1,HERE

ACALL CHK SJMP MAIN

LCD_START: CLR A MOVC A,@A+DPTR JZ LCD_START_END INC DPTR ACALL DATA SJMP LCD_STRART

LCD_START_END: RET

KEYPAD_INIT: ANL KEYPORT,#0FH RET

GET_KEY: MOV KEYVAL,#1H MOV A,#80H MOV TEMP,#04 READ: MOV A,#00H CPL A ANL P2,A

JB COLUMN1,NEXT JNB COL1,$ SETB P3.0 RET NEXT: JB COL2,NEXT1 INC KEYVAL JNB COL2,$ SETB ISKEY RET

NO_KEY: MOV A,,#00H ORL KEYPORT,A INC KEYVAL INC KEYVAL INC KEYVAL RR A MOV DELAY,#10 ACALL DELAYMS DJNZ TEMP,READ

CLR ISKEY RET

GET_INPUT: MOV R0,#INPUT

MOV COUNT,#0H INC MAX CHK_KEY: INC COUNT DJNZ MAX, GET_INPUT_NXT MOV DPTR,#GET_INPUT_ERR

DB " CODE IS SMALL...", 0H

GET_INPUT_ERR: DB " CODE TOO LONG...",0H

CHK: MOV R0,#INPUT CHEK: CLR A MOVC A,@A+DPTR MOV @R0,A CJNE A,B,CHEK INC DPTR INC R0 DJNZ COUNT,CHEK SETB P2.0 RET

CH3EK_12345:

DB

"12345",0H

CHK_MASTER: DB "1234567890",0H

CHK_UPASS: DB "54321",0H

STRART_NEW: DB "ENTER NEW CODE", 0H START_SAVED: DB "LOCK CODE SAVED!", 0H

COPY_CODE: MOV R0,#INPUT MOV R1,#UPASS MOV COUNT,#5 COPY_CODE_L1: MOV A,@R0 MOV @R1,A INC R0 INC R1 DJNZ COUNT, COPY_CODE_L1 RET

DELAY_1SEC: MOV R3,#254H BACK: MOV TOMD,#10H MOV TH1,#0B2H MOV TL1,#09H SETB TR1 AGAIN: JNB TF1 AGAIN CLR TR1 CLR TF1 DJNZ R3,BACK RET

ICONS: DB 0XE, 0XA, 0X1F, 0X1F, 0X1B, 0X1B, 0XE, 0X0, 0XE, 0X2, 0X1F, 0X1F, 0X1B, 0X1B, 0XE, 0X0, 0X1F, 0X1B, 0X1B, 0X1B, 0X1B, 0X1F, 0X1B, 0X1F, 0X0, 0X1, 0X3, 0X16, 0X1C, 0X8, 0X0, 0X0

END

RESULT & ANALYSIS


Password Based Door Security System using Microcontroller is used in the places where we need more security. It can also used to secure lockers and other protective doors. The system comprises a number keypad and the keypads are connected to the 8 bit microcontroller AT89C2051. This is one of the popular Microcontroller. It has only 20 pins and there are 15 input/output lines. The microcontroller has a program memory of 2 Kilobytes. The microcontroller continuously monitor the keypad and if somebody enters the password it will check the entered password with the password which was stored in the memory and if it they are same then the microcontroller will switch on the corresponding device. The system will allow the person who knows the password and it will not allow who dont know the password and the system will also show the persons who try to break the protection barrier.

CONCLUSION
Our electronic door lock performed as expected. We were able to implement all of the functions specified in our proposal. The biggest hurdle we had to overcome with this project was interfacing the micro controller with the hardware components. We feel that this electronic door lock is very marketable because it is easy to use, comparatively inexpensive due to low power consumption, and highly reliable. This door lock is therefore particularly useful in applications such as hotel room door locks, residential housing, and even office buildings

APPLICATIONS
Electrical devices such us Lights, Computer etc can be controlled by using separate passwords. The system can be easily connected to the personal computer for further control.

REFERENCES:http://microcontroller51.blogspot.in/2011/06/introduction-to-89c51-microcontroller.html http://www.faadooengineers.com/threads/5305-Digital-code-lock-project-report-pdfppt-download
www.8051projects.info/projects.asp http://seminarprojects.com/Thread-microcontroller-based-digital-code-lock--21479 BOOKS:

http://books.google.co.in/books/about/The_8051_Microcontroller_And_Embedded_Sy .html?id=8t0gVhfUGXUC http://books.google.co.in/books? id=8t0gVhfUGXUC&pg=PA299&source=gbs_toc_r&cad=4#v=onepage&q&f=false


The 8051 Microcontroller And Embedded Systems Using Assembly And C, 2/E Pearson Education India By Mazidi

You might also like