8051 Microcontroller based electronic lockerΒ system
CIRCUIT DESCRIPTION
Security is a prime concern in our day-today life. Everyone wants to be as much secure as possible.The issue of security is very paramount at home doors and safe. An access control for doors formsvital.link
in a security chain. Therefore we intend to aid in security at home by bringing in an electronic code lock system that involves an individual to enter the password before getting an access to some items, a particular room or building.This code lock system is not just the normal single user code lock system that required a user to insert an already programmed code to gain access to a room or safe; it is a code lock system that has password and enable multiple user access.
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 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 door is opened. If we entered a wrong password for more than three times then the Alarm is switched on.
The data pins of LCD are connected to P1 port & RS,R/W,E pins are connected to P0.2,P0.3,P0.4. L293D is used to rotate motor bidirectionaly to open & close the locker. A 4*3 keypad is used to enter the numbers 0 to 9 & β*β, β#β. There is a system menu, contains three buttons for open locker, reset password & close the locker.
PROJECT CODE
#include< reg51.h >
#define col P2
#define row P3
sbit m1=P3^4;
sbit m2=P3^5;
sbit bu=P0^1;
sbit rs=P0^2;
sbit rw=P0^3;
sbit en=P0^4;
sbit start=P0^5;
sbit rst=P0^6;
sbit mp=P0^7;
sfr lcddata=0x90;
void delay(int a)
{
int i,j;
for(i=0;i<a;i++) for(j=β0;j<1100;j++);β }=ββ void=ββ command(unsigned=ββ char=ββ s)=ββ initialise=ββ of=ββ the=ββ lcd=ββ {=ββ lcddata=βs;β rs=β0;β rw=β0;β en=β1;β delay(5);=ββ lcddisplaydata(unsigned=ββ data=ββ writing=ββ delay(8);=ββ displaydata(unsigned=ββ *word)=ββ int=ββ x;=ββ for(x=β0;word[x]!=0;x++)β lcddisplaydata(word[x]);=ββ unsigned=ββ array[3][4]=β{β0β²,β1β²,β2β²,β3β,β β4β,β5β²,β6β²,β7β²,=ββ β8β,β9β²,β*β,β#β};=ββ n=β0;β m=β0;β i,p,q,r;=ββ main()=ββ colloc,=ββ rowloc;=ββ array1[4];=ββ array2[4]=β{β3β²,β1β²,β1β²,β2β};β array3[4];=ββ locker1:=ββ col=β0xFF;β row=β0x00;β m1=β0;β m2=β0;β bu=β0;β mp=β1;β p=β0;β q=β0;β r=β0;β start=β1;β rst=β1;β command(0x01);=ββ command(0x38);=ββ command(0x0c);=ββ command(0x84);=ββ displaydata(βpress=ββ keyβ);=ββ command(0xc0);=ββ displaydata(βfrom=ββ system=ββ menuβ);=ββ while(1)=ββ if(start=β=0)β goto=ββ locker2;=ββ else=ββ if(rst=β=0)β locker3;=ββ locker2:=ββ command(0x82);=ββ delay(10);=ββ displaydata(βenter=ββ yourβ);=ββ command(0xc3);=ββ displaydata(βpasswordβ);=ββ delay(80);=ββ command(0x80);=ββ locker5;=ββ locker3:=ββ currentβ);=ββ command(0xc4);=ββ locker4:=ββ command(0x83);=ββ newβ);=ββ displaydata(β=ββ passwordβ);=ββ locker5:=ββ do=ββ colloc=βcol;β &=β0x0f;β }while(colloc!=β0x0f);β }while(colloc=β=0x0f);β if(colloc!=β0x0f)β rowloc=β0;β break;=ββ if(p=β=1)β if(colloc=β=0x0E)β array1[n]=βarray[rowloc][0];β n++;=ββ locker6;=ββ if(q=β=1)β locker7;=ββ if(r=β=2)β locker11;=ββ array2[n]=βarray[rowloc][0];β locker9;=ββ array3[n]=βarray[rowloc][0];β locker8;=ββ locker6:=ββ if(n<4)=ββ lcddisplaydata(β*β);=ββ if(n=β=4)β delay(50);=ββ if(array1[1]=β=array2[1]&&array1[2]==array2[2]&&array1[3]==array2[3]&&array1[0]==array2[0])β displaydata(βright=ββ locker14;=ββ displaydata(βwrong=ββ locker15;=ββ locker7:=ββ locker4;=ββ locker12;=ββ locker8:=ββ if(array3[1]=β=array2[1]&&array3[2]==array2[2]&&array3[3]==array2[3]&&array3[0]==array2[0])β displaydata(βnew=ββ password=ββ hasβ);=ββ displaydata(βbeen=ββ setβ);=ββ delay(100);=ββ locker1;=ββ locker13;=ββ locker9:=ββ locker10;=ββ locker10:=ββ displaydata(βconform=ββ locker11:=ββ locker16;=ββ locker12:=ββ m++;=ββ if(m<3)=ββ delay(500);=ββ locker13:=ββ locker14:=ββ delay(125);=ββ while(mp!=β0);β locker15:=ββ locker16:=ββ <=ββ>