RFID Door Access Control System using 8051
In this project, we are going to build an RFID Based Access Control System using 8051 Micro Controller. The same system can be named like RFID based door lock or RFID based access management system. If you have been to big hospitals or companies, you might have seen how they used RFID based locks to restrict access to certain areas. In hospitals, only hospital staff with approved RFID tags can access Intensive Care Unit and such restricted areas. So let’s begin to build the system.
Before reading further, you need to fully understand How to Interface RFID Reader to 8051 Microcontroller. Read this article before you attempt to make RFID based access control system.
韦德体育投注网是什么,韦德体育appA RFID based Door Lock or Access Control System is based on some simple concepts. We store a set of RFID card data in our system, say 3 or 10 RFID card data. When the person with the right RFID card (compatible to data preloaded in our program/system) come and swipes his RFID tag, access will be granted. When the person with the wrong RFID card (whose data is not loaded in our system) swipes his RFID tag, access will be denied. I hope you understand the system concept of RFID based Door Lock.
韦德体育投注网是什么,韦德体育appThe full circuit diagram for interfacing RFID module to 8051 is shown above. The unique ID code in the RFID card is read by the circuit and displayed on the 16×2 LCD display. Tx pin of the RFID module is connected to Port 3.5 of the microcontroller. The microcontroller receives data from the RFID module through this channel. Switch S1, capacitor C1 and resistor R1 forms the reset circuit. Capacitor C2, C3 and crystal X1 are associated with the reset circuit.
RS EQU P2.7RW EQU P2.6E EQU P2.5FLG EQU 40HSEL EQU 41HORG 000HCLR P2.0MOV TMOD,#00100001BMOV TH1,#253DMOV SCON,#50HSETB TR1ACALL LCD_INITMOV DPTR,#TEXT1ACALL LCD_OUTACALL LINE2MOV DPTR,#TEXT2ACALL LCD_OUTMAIN:ACALL LCD_INIT MOV DPTR,#TEXT1 ACALL LCD_OUT ACALL LINE2 MOV DPTR,#TEXT2 ACALL LCD_OUT ACALL READ_TAG CLR REN ACALL LINE2 ACALL CHECK_PASSWORD ACALL DELAY1 SETB REN SJMP MAIN LCD_INIT: MOV DPTR,#INIT_COMMANDS SETB SEL ACALL LCD_OUT CLR SEL RET LCD_OUT: CLR A MOVC A,@A+DPTR JZ EXIT INC DPTR JB SEL,CMD ACALL DATA_WRITE SJMP LCD_OUTCMD: ACALL CMD_WRITE SJMP LCD_OUTEXIT: RET LINE2:MOV A,#0C0H ACALL CMD_WRITE RET READ_TAG: MOV R0,#12D MOV R1,#160D WAIT:JNB RI,WAIT MOV A,SBUF MOV @R1,A INC R1 CLR RI DJNZ R0,WAIT RET CHECK_PASSWORD: CLR FLG MOV R2,#12D MOV R1,#160D MOV DPTR,#PASS1 REPEAT: CLR A MOVC A,@A+DPTR XRL A,@R1 JNZ CHECKNEXT INC R1 INC DPTR DJNZ R2,REPEAT ACALL LINE2 MOV DPTR,#TEXT3 ACALL LCD_OUT SETB P2.0 RET CHECKNEXT: JB FLG,FAIL MOV R2,#12D MOV R1,#160D MOV DPTR,#PASS2 SETB FLG SJMP REPEATFAIL:ACALL LINE2 MOV DPTR,#TEXT4 ACALL LCD_OUT CLR P2.0 RET DELAY1:MOV R3,#46DBACK: MOV TH0,#00000000B MOV TL0,#00000000B SETB TR0 HERE1: JNB TF0,HERE1 CLR TR0 CLR TF0 DJNZ R3,BACK RETCMD_WRITE: MOV P0,A CLR RS CLR RW SETB E CLR E ACALL DELAY RETDATA_WRITE:MOV P0,A SETB RS CLR RW SETB E CLR E ACALL DELAY RETDELAY: CLR E CLR RS SETB RW MOV P0,#0FFh SETB E MOV A,P0 JB ACC.7,DELAY CLR E CLR RW RET INIT_COMMANDS: DB 0CH,01H,06H,83H,3CH,0 TEXT1: DB "RFID ACCESS",0 TEXT2: DB "Swipe TagS..",0TEXT3: DB "Access allowed",0TEXT4: DB "Access denied",0PASS1: DB "18008DC02E7B"PASS2: DB "7500511ECDF7" END
韦德体育投注网是什么,韦德体育appThe program is self-explanatory.
Project Kit – RFID Access Control System