Programmable number lock system
by Ranjith | November 19th, 2008.APPLICATION:
The ‘Electronic device number lock’ system is a high security system.The main application kept in mind during the design of this system is to secure expensive electronic devices and machinery. The access to such devices can be restricted to particular users only. The system is highly secured since the code can be changed every time the user locks it.
This can also be used an physical lock by using solenoid and thus can be used to lock safes in banks or other institutions.
Regular electronic number lock available in the market can lock/unlock just one device, but this design can lock/unlock up to nine devices.
The program used for the operation of this system is as follows :
;***************************************************************;
PROCEDURE OF WAIT
;***************************************************************
org 8500h
wait: push dph
push dpl
push r0
push r1
mov dptr,#2042h ;input data from PORT C
wi: movx a,@dptr
mov r2,a
anl a,#20h
jz cont ;check for interrupt from display unit
jmp start
cont: mov a,r2
anl a,#0fh ;to check whether any key is pressed
jz wi
mov r0,#75
lcall 6798h
mov dptr,#2042h
here: movx a,@dptr ;wait for the key to be realesed
jnz here
mov dptr,#2040h ;sending a pulse to the display section
mov a,r2
movx @dptr,a
mov a,#00h
mov dptr,#2041h
movx @dptr,a
mov a,#40h
movx @dptr,a
mov a,r2
mov r0,#75
lcall 6798h
pop r1
pop r0
pop dpl
pop dph
ret
;***************************************************************;
STORING AND RETRIVING OF PASS WORD
;***************************************************************
org 8550h
scan: mov r0,#04h
mov dptr,#2042h
one: movx a,@dptr ;check for lock or unlock buttons
anl a,#0c0h
jz one
ret
lock: lcall wait ;storing of pass word in given location
mov @r1,a
inc r1
djnz r0,lock
lcall out
ret
unlock: clr 0ah
call wait
mov a,@r1
xrl a,r2 ;comparing the entered and the stored code
jz match
setb 0ah ;in case of mismatch set error bit
match: inc r1
djnz r0,unlock
jnb 0ah,go
mov a,#20h
push dptr
mov dptr,#2040h
movx @dptr,a
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
mov a,#00h
movx @dptr,a
pop dptr
jmp not
go: lcall out
not: ret
;***************************************************************;
TO ACCEPT THE DEVICE NUMBER
;***************************************************************
org 9000h
mov sp,#05fh
main: clr 01h ;clearing all the device flags
clr 02h
clr 03h
clr 04h
clr 05h
clr 06h
clr 07h
clr 08h
clr 09h
setb ie.7
setb ie.2
start: mov a,#89h ;C as i\p,A and B as o\p
mov dptr,#2043h
movx @dptr,a
mov r7,#05h ;clearing the display section
rss: mov dptr,#2040h
mov a,#00h
movx @dptr,a
mov a,#00h
mov dptr,#2041h
movx @dptr,a
mov a,#40h
movx @dptr,a
djnz r7,rss
lcall wait
cjne a,#01h,nxt2
jmp dev1
nxt2: cjne a,#02h,nxt3
jmp dev2
nxt3: cjne a,#03h,nxt4
jmp dev3
nxt4: cjne a,#04h,nxt5
jmp dev4
nxt5: cjne a,#05h,nxt6
jmp dev5
nxt6: cjne a,#06h,nxt7
jmp dev6
nxt7: cjne a,#07h,nxt8
jmp dev7
nxt8: cjne a,#08h,nxt9
jmp dev8
nxt9: cjne a,#09h,start
jmp dev9
;***************************************************************;
SELECTED DEVICE ACTIVATION
;***************************************************************
org 9200h
dev1: mov r1,#30h ;Loading the address of the password
mov r3,#01h ;device no. used to give to the decoder
lcall scan
cjne a,#80h,unlock1 ;check for the lock\unlock pressed
jmp lock1
unlock1: jnb 01h,error1 ;generating error if the selected device is already
;activated
lcall unlock
jb 0ah,hr1
clr 01h ;clear lock\unlock flag
hr1: jmp start
lock1: jb 01h,error1
lcall lock
setb 01h ;set lock\unlock flag
jmp start
error1: mov a,#40h ;activating the error LED
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***************************************************************
dev2: mov r1,#035h
mov r3,#02h
lcall scan
cjne a,#80h,unlock2
jmp lock2
unlock2: jnb 02h,error2
lcall unlock
jb 0ah,hr2
clr 02h
hr2: jmp start
lock2: jb 02h,error2
lcall lock
setb 02h
jmp start
error2: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***************************************************************
dev3: mov r1,#03ah
mov r3,#03h
lcall scan
cjne a,#80h,unlock3
jmp lock3
unlock3:jnb 03h,error3
lcall unlock
jb 0ah,hr3
clr 03h
hr3: jmp start
lock3:jb 03h,error3
lcall lock
setb 03h
jmp start
error3: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***************************************************************
dev4: mov r1,#040h
mov r3,#04
lcall scan
cjne a,#80h,unlock4
jmp lock4
unlock4:jnb 04h,error4
lcall unlock
jb 0ah,hr4
clr 04h
hr4: jmp start
lock4:jb 04h,error4
lcall lock
setb 04h
jmp start
error4: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***************************************************************
dev5: mov r1,#045h
mov r3,#05h
lcall scan
cjne a,#80h,unlock5
jmp lock5
unlock5:jnb 05h,error5
lcall unlock
jb 0ah,hr5
clr 05h
hr5: jmp start
lock5:jb 05h,error5
lcall lock
setb 05h
jmp start
error5: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***************************************************************
dev6: mov r1,#04ah
mov r3,#06h
lcall scan
cjne a,#80h,unlock6
jmp lock6
unlock6:jnb 06h,error6
lcall unlock
jb 0ah,hr6
clr 06h
hr6: jmp start
lock6:jb 06h,error6
lcall lock
setb 06h
jmp start
error6: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;**************************************************************
dev7: mov r1,#050h
mov r3,#07h
lcall scan
cjne a,#80h,unlock7
jmp lock7
unlock7:jnb 07h,error7
lcall unlock
jb 0ah,hr7
clr 07h
hr7:jmp start
lock7:jb 07h,error7
lcall lock
setb 07h
jmp start
error7: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***********************************************************
dev8: mov r1,#055h
mov r3,#08h
lcall scan
cjne a,#80h,unlock8
jmp lock8
unlock8:jnb 08h,error8
lcall unlock
jb 0ah,hr8
clr 08h
hr8: jmp start
lock8:jb 08h,error8
lcall lock
setb 08h
jmp start
error8: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***********************************************************
dev9: mov r1,#05ah
mov r3,#09h
lcall scan
cjne a,#80h,unlock9
jmp lock9
unlock9:jnb 09h,error9
lcall unlock
jb 0ah,hr9
clr 09h
hr9: jmp start
lock9:jb 09h,error9
lcall lock
setb 09h
jmp start
error9: mov a,#40h
mov dptr,#2040h
movx @dptr,a
push dptr
push r0
push r1
mov r0,#ffh
lcall 6798h
pop r1
pop r0
pop dptr
jmp start
;***********************************************************
; OUTPUT SECTION
;***********************************************************
org 0a000h
out: mov a,r3 ;loading the device number
mov dptr,#2041h
movx @dptr,a
ret
;***********************************************************
This program is assembled using DASM assembler and the hex file is downloaded to the 8051 microcontroller kit.






December 21st, 2008 at 8:11 pm
i am a student of electronics and communication engineering in nepal and we had studied your project and choosed it as our final year project and we dont know how to interface the ckt with the microcontroller kit can you help……
January 5th, 2009 at 11:19 am
i am a student of electronics and communication engineering in karnataka and we had studied your project and choosed it as our final year project and we dont know how to interface the ckt with the microcontroller kit can you help……
January 6th, 2009 at 10:10 am
We are troubled with your incomplete project detail.Please do help us as soos as possible.
January 20th, 2009 at 9:22 am
hi i am doing electronics and communication in madurai.I want u to help me in this hardware project.I need the circuit and the code to do it in using microcontroller
January 20th, 2009 at 2:09 pm
Hi All
Please ask your doubts clearly. Be specific on which section. Here we are just helping students to get Ideas to do their projects.
January 20th, 2009 at 9:48 pm
I need help on the programming section of this project i want to ask can you provide us with the program in c ………
January 21st, 2009 at 4:58 pm
hello.
i am tejas. i have selected this project but i am stuck.
i need to know which 8051 IC is used in this project( like philips,atmel,pic). Also i need the microcontroller kit cicuit diagram with full pcb layout of this whole project.
Please HELP me as fast as possible
January 21st, 2009 at 5:07 pm
MAY I required circuit layout of no. lock
January 21st, 2009 at 5:20 pm
please give me the full details including pcb layout and IC no.s of this project. PLEASE……..
January 28th, 2009 at 9:13 am
sir i am a student of electronics and communication. i have studied and chosen this project as my semester project, i am keenly interested in it. sir i m stuck with the circuit diagram. sir, if u can plz help me wid the circuit diagram of allthree sections along with the code in c ,it will be of great help, as i need it as early as possible
February 2nd, 2009 at 6:35 pm
Hi Sir,
I’m interesting in doing the programmable number lock as a project. I’d be very glad if u send me the entire circuit diagram as early as possible.
Thank you.
February 3rd, 2009 at 9:10 pm
hi,
sir,would u plz give the information about how to interface the micorcontroller kit with the circuit.
February 9th, 2009 at 12:38 pm
We are engaged with the provided details. Hope we’ll come up with the output. Do help for the comlete circuit.
February 13th, 2009 at 10:37 pm
sir i am a student of electronics and communication. i have studied and chosen this project as my semester project, i am keenly interested in it. sir i m stuck with the circuit diagram. sir, if u can plz help me wid the circuit diagram of allthree sections along with the code in c ,it will be of great help, as i need it as early as possible
February 13th, 2009 at 10:41 pm
hi….sir its me 4m electronics & communication dept. I require your help to get sucess in complete my project…I have choosen this project as my final project for semestar 6th..
Awaiting for your help…..
February 17th, 2009 at 2:23 pm
hi……….
i am the student of electronics & telecommunication.
I have chosen this project for my 6th sem.
i want to know the algorithm of this project.
Can you please send me as soon as possible?
awaiting for your reply.
February 19th, 2009 at 1:36 pm
hello sir…
i m an electronics and communication student.
sir i m working on this number lock system project as my final project and i am not clear about its control unit.
sir please tel the full details about the control unit.
sir please reply me as soon as possible.
i have to complete my project till d march..
awaiting for your reply.
February 25th, 2009 at 7:22 pm
hello ranjith, we noticed that at your schematic diagram in the display unit and the picture of the finish product, we noticed that the 555 timer is not included plus another IC In the controller unit, at the circuit diagram, it has 6 ics, but at the picture, it has 10 ics. same with the keypad unit, circuit diagram has 2 ics, in the picture, it has 3. can you please provide me the whole circuit diagram of all units? we are stuck at the moment. reply asap. smsabio@yahoo.com
February 25th, 2009 at 7:23 pm
hello ranjith, we noticed that at your schematic diagram in the display unit and the picture of the finish product, we noticed that the 555 timer is not included plus another IC In the controller unit, at the circuit diagram, it has 6 ics, but at the picture, it has 10 ics. same with the keypad unit, circuit diagram has 2 ics, in the picture, it has 3. can you please provide me the whole circuit diagram of all units? we are stuck at the moment. reply asap.
March 8th, 2009 at 7:59 pm
please send me complete circuitory along with programme code n pcb layout n ic no.s………. as soon as possible
March 14th, 2009 at 8:39 pm
Sir,
i am a final year student from orissa having ece branch.
i am having a problem on the control unit part.the circuit diagram is incomplete and there r more ics present on thegiven block diagram.so if possible, plz send the complete ckt diagram ofthe control section.
March 14th, 2009 at 8:43 pm
In the display unit ,the ic 7496 is used as a 5 bit shift resistor.but this ic is not available in our local market.
so can u tell me an alternate ic for it/???
An early action is required.
i will be grately thankful to u……..
March 14th, 2009 at 8:45 pm
The description of the ics in the control unit is not available also.so how the ics function to meet the target i am not able to understand. so plz giv a detailed function of the control section.
April 2nd, 2009 at 12:46 pm
hello sir…
i am a final year student from ahmedabad having ec-c branch.
i am having a problem on the control unit part.the circuit diagram is incomplete and there r more ics present on thegiven block diagram.
so if possible, plz send the complete ckt diagram ofthe control section.
April 18th, 2009 at 11:05 am
hello……….
I have choosen this project but without any idea please someone help me in this.. I want the coding in c…please help me out as soon as possible…
June 16th, 2009 at 3:22 am
pls sir i am interested in learning how to write my own codes. is there anyway u can help.
July 9th, 2009 at 3:05 am
sir,i am a final year student of electronics n comm.
i am interested in this project but feel the given information is insufficient.So plz send me the codes n complete circuit of the given project.
Plz help me out as soon as possible..!!
July 14th, 2009 at 8:55 am
sir,i am a final year student of electronics n comm.
i am interested in this project but feel the given information is insufficient.So plz send me the codes n complete circuit of the given project.
Plz help me out as soon as possible..!!
August 10th, 2009 at 11:45 pm
Hello. I m diploma ec final year student n i require the information regarding how 2 interface ckt with 8051 kit. Even i require the pcb layout n ckt diagram of 8051 kit.
I need the complete information of this project so plz help me out.
Kindly forward it.
Hope 4 reply as early as possible.
Thank u.
August 11th, 2009 at 12:51 pm
i want this project
August 12th, 2009 at 5:06 pm
hello sir…
ur ideas are very usefull to us !
i really thank u so much!
August 24th, 2009 at 7:29 pm
please send me complete circuitory along with programme code n pcb layout n ic no.s………. as soon as possible
August 27th, 2009 at 6:51 am
sir i am a student of electronics and communication. i have studied and chosen this project as my semester project, i am keenly interested in it. sir i m stuck with the circuit diagram. sir, if u can plz help me wid the circuit diagram of allthree sections along with the code in c ,it will be of great help, as i need it as early as possible
August 27th, 2009 at 6:54 am
hi……….
i am the student of electronics & telecommunication.
i want to know the algorithm of this project.
sir please tel the full details about the control unit.
thanking you…
August 28th, 2009 at 12:15 pm
sir,
please let me know about the circuit diagram,components required and the necessary program in C so that i can design an electronic number lock,which i have taken for my project.
October 10th, 2009 at 10:15 am
IN CONTROL UNIT WE CAN`T SEE PIN NOUMBER OF IC7473
PLEASE UPLOD HI RESOLUTION JPG FILE
October 10th, 2009 at 8:12 pm
i am the student of electronics & communication.
I have chosen this project for my 7th sem.
i want to know the algorithm of this project &some
other information.
Can you please send me as soon as possible?
awaiting for your reply.
October 12th, 2009 at 3:20 pm
hi..
i m interested in your project.. but i want to build the system without using the micro controller as the control system. instead i want to use flip flops… can yu help me with the circuit daigram the system overview??
November 4th, 2009 at 10:56 pm
hello sir…i hav choosen this as a final yr project..
plz cud u mail me..that hw to interface this with 8051..& provide PCB layouts of this..
November 12th, 2009 at 11:18 pm
I am a electronics student and i am very intrested in programmable number lock system
But i don’t have the 8051 kit
So can i change the 8051 by 16f877
And what should i chang in the circuit
November 22nd, 2009 at 6:34 pm
sir,
sir apne isme 8051kit ke bare me likha h uska kya matlab h n vo link kha per h please send me as soon as possible
Thanku
January 1st, 2010 at 1:13 am
Hi Respected Mr. Designer:
I would like to present some of my suggestions regarding this project’s development and simplification, and cost effectiveness.
I will discuss each section step by step
1) The Keypad unit can be greatly simplified by using 4×3 matrix keypad and using its * and # keys for Lock/Unlock it requires just 7 lines to interface. The total Decoding will be done by uController having a suitable algorithm running. This greatly simplifies the Keypad Circuitry by removing all of the encoding chips.
2) The Display Panel is very complex and not much user friendly also has onboard a large no of Latches, Decoders etc it can be greatly simplified by using a single 16×2 or 16×1 LCD Display which can be interfaced in nibblemode to the uController requiring just 6 interface lines saving IO Pins and complexity.
3)Instead of 8051 any other avr family member can be used if more EEPROM is needed to save passwords. But I Think 8051 is suitable.
Keeping in view the above suggesstions the hardware can be centralised around 3 core components i.e uController, LCD, matrix keypad This saves a huge cost, time and makes it robust and much used friendly also development Friendly.
The Design Strategy will be tilted towards Embedded System Design rather Than Digital Logic Design.
January 1st, 2010 at 1:22 am
@ tamim:
=======
Tamim if u know PIC Programming and interfacing you should not have much Problem regarding Hardware Translation. But regarding Software Translation There will be a huge revolution you will have to totally rewrite the software for PIC architecture because 8051 and PIC belong to different families and manufacturers I suggest the Program The Pic in C using mikroC compiler it will save ur time in C rather than in assembly. If you are proficient in assembly then code the PIC in assembly
January 1st, 2010 at 1:36 am
Dear Mr Designer,
Is This was your Final year Project?? or it was your Course Project?
January 6th, 2010 at 8:31 pm
plz send me complete detail of this project.
Thanking You
January 8th, 2010 at 10:37 am
can you send me the project detail shown above to me with some more addition to it
January 14th, 2010 at 1:56 pm
sir i really liked ur idea of dis project ….can u pls send me pcb layout and complete circuit diagram as soon as possible…..
January 15th, 2010 at 5:37 pm
i’m a student doin a project on this topic and i dont quite understand the control unit.i can’t see the pin numbers on the jk flipflops could u pls assist me,i am desparately in need of ur help pls!
January 23rd, 2010 at 4:48 am
sir,
im very intrested in doing this project.so plz send me circuit diagram and code for this project to my mail id.
-krishnaece434@gmail.com
January 23rd, 2010 at 3:55 pm
Am final year tudent of computer engineering,please i need a complete circuit diagram of this project;as soon as possible.thanks for your cooperation.
January 24th, 2010 at 8:52 pm
sir
kindly can you send the circuit diagram and pcb layout of the the project
agugrg@gmail.com
January 24th, 2010 at 8:53 pm
I’m very much interested in doin this as my project
January 28th, 2010 at 6:09 pm
hello sir
i have choosed this as my project
and i have a problem with control unit sir.
so kindly i requested you to send the complete cicuit diagrama and i want to know the algorithm of microcontroller programming. so send the algorithm also
thankink you sir,
January 29th, 2010 at 9:05 pm
gimme more details abu this project………waitin
February 4th, 2010 at 12:34 am
sir please give the source code for programmable number lock system….
February 16th, 2010 at 7:48 pm
Application of programmable lock is to secure electronic device i.e to On & OFF by perticular user,but how to secure any electronic device?What should be connected between lock & device that we are supposed to secure?
February 16th, 2010 at 8:18 pm
Hello Sir,
Firstly i would like to thank you for publishing your work this way. It is helping us in every way. I have a small doubt about this project, I will be highly obiliged if you can help. Sir i have understood the working and all but the problem is that i could not understand the interfacing part. How do we connect the circuit to the electronic device? What is that physical part with the help of which we will be connecting the circuit to the electronic device? Another problem is that to lock the device means what exactly will it do?For example if we take a power supply & we lock it then how will it get locked? What we will observe there & to which part of power supply we will connect the circuit & how? Sir please help me as soon as possible. i will be waiting for your reply. Thank you very much sir. Thank you…
February 24th, 2010 at 11:43 pm
plz tell me the procidure..
March 5th, 2010 at 4:35 pm
I am final year student of Mechatronics engineering.
so kindly i requested you to send the complete circuit diagrama
How do we connect the circuit to the electronic device?What is that physical part with the help of which we will be connecting the circuit to the electronic device? Another problem is that to lock the device means what exactly will it do?For example if we take a power supply & we lock it then how will it get locked? What we will observe there & to which part of power supply we will connect the circuit & how?
would you please send me all these answer thank you.
March 10th, 2010 at 5:07 pm
many thanks !! fairly practical write-up
March 15th, 2010 at 7:56 pm
hello sir i’m 6th sem E&E student we r doing project on electronic number lock system we r not getting full discription &circuit diagram on this project would you plese send me these thing as soon as possible i was waiting for ur reply