You are on page 1of 6

MICRO CONTROLLER BASED COMBINATION LOCK SYSTEM

Vasanth , Vijay , Yogaesh.R

ABSTRACT A combination lock is a type of lock in which a sequence of numbers or symbols is used to open the lock. An electronic lock (more precisely an electric lock) is a locking device which operates by means of electric current. The advantages of an electric lock connected to an access control system include: key control, fine access control, and transaction logging. This project aims on developing a security lock system controlled by a micro controller. The microcontroller is interfaced with a keyboard (which accepts the authentication code) and to a seven segment display (to display the access granted). The microcontroller which has preset authentication code, compares the given code with preset value to control the security lock.

Block diagram of Programmable number lock system:

SIMPLE PROGRAM PROCEDURE: 1. Read number of bytes in the password 2. Initialize the password 3. Initialize the Keyboard Display IC (8279) to get key and Display 4.Blank the display 5.Read the key from user 6.Compare with the initialized password 7.If it is not equal, Display E to indicate Error. 8.Repeat the steps 6 and 7 to read next key 9.If entered password equal to initialized password, Display O to indicate open. PROGRAM: MOV 51H,# MOV 52H,# MOV 53H,# MOV 54H,# MOV R1,#51 MOV R0,#50 MOV R3,#04 MOV R2,#08 MOV DPTR,#FFC2 MOV A,#00

MOVX @DPTR,A MOV A,#CC MOVX @DPTR,A MOV A,#90 MOVX @DPTR,A MOV A,#FF MOV DPTR,#FFCO LOOP: MOVX @DPTR,A DJNZ R2,LOOP AGAIN: MOV DPTR,#FFC2 WAIT: MOVX A,@DPTR ANL A,#07 JZ WAIT MOV A,#40 MOVX @DPTR,A

MOV DPTR,#FFCO MOVX A,@DPTR MOV @R0,A MOV A,@R1 CJNE A,50H,NEQ INC R1 DJNZ R3,AGAIN MOV DPTR,#FFCO MOV A,#OC MOVX @DPTR,A XX: SJMP XX NEQ: MOV DPTR,#FFCO MOV A,#68 MOVX @DPTR,A YY: SJMP YY
SIMPLE PROGRAM TO INTERFACE KEYBOARD

to check that whether any key is pressed start: mov a,#00h mov p1,a mov a,#0fh mov p1,a press: mov a,p2 jz press

;making all rows of port p1 zero ;making all rows of port p1 high ;check until any key is pressed

after making sure that any key is pressed mov a,#01h mov r4,a mov r3,#00h mov a,r4 mov p1,a mov a,p2 jnz colscan mov a,r4 rl a mov r4,a mov a,r3 add a,#08h mov r3,a sjmp next ;make one row high at a time ;initiating counter ;making one row high at a time ;taking input from port A ;after getting the row jump to check column ;rotate left to check next row ;increment counter by 08 count ;jump to check next row

next:

after identifying the row to check the colomn following steps are followed colscan: in: mov r5,#00h rrc a ;rotate right with carry until get the carry jc out ;jump on getting carry inc r3 ;increment one count jmp in mov a,r3 da a ;decimal adjust the contents of counter before display mov p2,a jmp start ;repeat for check next key.

out:

SEVEN SEGMENT DISPLAY INTERFACING

ORG 0000H

; Execution starts here

SETB CLR CLR CLR CLR CLR CLR

P0.3 P0.1 P0.0 P0.6 P0.5 P0.4 P0.2

; Turn off the g segment ; Turn on the a segment ; Turn on the b segment ; Turn on the c segment ; Turn on the d segment ; Turn on the e segment ; Turn on the f segment ; Loop here forever

HERE: AJMP HERE END

You might also like