Skip to main content

RFID Based 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.
Project Description
A 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.

RFID based Access Control using 8051

The 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.
The Program
RS EQU P2.7 RW EQU P2.6 E EQU P2.5 FLG EQU 40H SEL EQU 41H ORG 000H CLR P2.0 MOV TMOD,#00100001B MOV TH1,#253D MOV SCON,#50H SETB TR1 ACALL LCD_INIT MOV DPTR,#TEXT1 ACALL LCD_OUT ACALL LINE2 MOV DPTR,#TEXT2 ACALL LCD_OUT MAIN: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_OUT CMD: ACALL CMD_WRITE SJMP LCD_OUT EXIT: 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 REPEAT FAIL:ACALL LINE2 MOV DPTR,#TEXT4 ACALL LCD_OUT CLR P2.0 RET DELAY1:MOV R3,#46D BACK: MOV TH0,#00000000B MOV TL0,#00000000B SETB TR0 HERE1: JNB TF0,HERE1 CLR TR0 CLR TF0 DJNZ R3,BACK RET CMD_WRITE: MOV P0,A CLR RS CLR RW SETB E CLR E ACALL DELAY RET DATA_WRITE:MOV P0,A SETB RS CLR RW SETB E CLR E ACALL DELAY RET DELAY: 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..",0 TEXT3: DB "Access allowed",0 TEXT4: DB "Access denied",0 PASS1: DB "18008DC02E7B" PASS2: DB "7500511ECDF7" END

Comments

Popular posts from this blog

Introduction To Smart Wi-Fi

We need faster tools and media to prove our ideas, and this is where ready-to use modules like Smart Wi-Fi enter. Fig. 1 shows the top side of Smart Wi-Fi module. Fig. 1: Smart Wi-Fi module Fig. 2: Block diagram of the introduction of Smart Wi-Fi The module is low-cost and versatile; all a developer needs is a USB cable and it is ready to work. For software developers, working with hardware is always a pain, and this is one of the biggest reasons why many ideas never exit a computer. Smart Wi-Fi enables making a product quickly and reliably. With open software resources and hardware data, moving to the final product after the proof of concept is also easy. One of the major aims for writing this article is to show the versatility of this product and show how quick the development can be. In this article a few tests with Smart Wi-Fi are discussed, which show the applicability of this module for development of the Internet of Things (IoT) products. Fig. 3: C

Make Your Own Air Quality Monitoring Device!

Air pollution and concern about air quality is not something new. Complaints were recorded even in the 13th century when coal was first used for industrial purposes in London. From the middle of the 19th century, the atmosphere of major British cities was regularly polluted by coal smoke in winters, giving rise to the infamous mixture of fog and smoke known as smog. Today the emphasis has shifted from pollution problems caused by the industry to the ones associated with motor vehicle emissions. Author’s Prototype Air Quality Index Air Quality Index, or AQI, is a number used by government agencies to communicate to the public how polluted the air currently is, or how polluted it is likely to become. As AQI increases, an increasingly large percentage of the population experiences severe adverse health effects. Different countries have their own air-quality indices corresponding to different national air-quality standards. Some of these are Air Quality Health Index (C

Learn to Build Real Time Clock using 8051and DS1307 RTC Module

In this article, we are going to see how to interface an RTC (Real Time Clock) Module to 8051 micro controller. There are different kinds of RTC module available in the market. We are using the most common RTC module that comes with the DS1307 IC, an LCD module and AT89S52 (8051 variant) for this tutorial. AT89S52 is a typical 8051 microcontroller manufactured by Atmel. Interfacing an RTC module to 8051 microcontroller is pretty simple. You only need to make 2 connections between the RTC module and 8051. So lets get to business! A Real Time Clock module is basically a time tracking device which gives the current time and date. RTC modules that comes with DS3231 IC have the provision to set alarms. Notes On DS1307 RTC Module Here we are using an RTC module with clock chip DS1307 based on I2C protocol (Two Wire Protocol). The module provides details such us second, minute, hour, day of week, day of month, month and year including correction for leap year. It can operate eithe

Hit Counter