Search form

In this project, we are going to develop an RFID and keypad based Security system. This project is implemented by using 8051 microcontroller. RFID Tecnology (Radio Frequency Identification and Detection) is commonly used in schools, colleges, office and stations for various purposes to automatically authenticate people with valid RFID tags. Here we will check the RFID tag, along with a password associated with the tag, to secure the system.

Working

We can divide the complete security system into various sections - Reader section, Keypad, Control section, Driver section and Display section. Working of the entire system and role of each section can be understood throgh the below block diagram.

Reader Section: This section contains a RFID, which is an electronics device which has two parts - one is RFID Reader and other is RFID tag or Card. When we put RFID tag near the RFID reader it reads tag data serially. RFID tag which we have used here has 12 digit character code or serial number. This RFID is working at baud rate of 9600 bps.

Control Section: 8051 microcontroller is used for controlling the complete process of this RFID based security system. Here by using 8051 we are receiving RFID data and sending status or messages to LCD.

Driver Section: This section has a motor driver L293D for opening gate and a buzzer with a BC547 NPN transistor for indications.

When a person put his RFID tag to RFID reader then RFID reads tag’s data and send it to 8051 microcontroller and then microcontroller compares this data with pre-defined data. If data is matched with predefined data then microcontroller ask for password and after entering password microcontroller compare password with predefined password. If password match gate will open otherwise LCD show Access denied and buzzer start beeping for sometime.

Circuit Diagram and Explanation

As shown in above RFID security system circuit diagram, 16x2 LCD is connected in four bit mode with microcontroller. LCD’s RS, RW and EN pins are directly connected at PORT 1 pin number P1.0, P1.1 and P1.2. D4, D5, D6 and D7 pins of LCD is directly connected at pin P1.4, P1.5, P1.6 and P1.7 of port 1. Motor driver is connected at PORT pin number P2.4 and P2.5. And buzzer is connected at P2.6 at PORT2. And keypad is connected at PORT0. Keypad row are connected at P0.4 – P0.7 and Columns are connected at P0.0 – P0.3.

Program Explanation

While programming the 8051 microcontroller for RFID based security system, first of all we include header files and defines input and output pin and variables.

Here we have some function that we have used in our program. In this we have configured 9600bps baud rate at 11.0592MHz Crystal Frequency, and fuction for receiving we are monitoring the SBUF register for receiving data.

After this in main program we have initialized lcd and Uart and then we read the output of RFID when any tag is bring on it. We store this string in an array and then match with predefind array data. And then match the password.

Currently we have hard coded the the RFID tags IDs so you cant add on run time, but you can alter ID in code for your card. Or you can modify the code to add IDs on run time and share here for the community.

Dear Abi
I am Pradeepkumar working in Salem Steel Plant as Sr Mgr Electrical. I started my Carrier in Electronic Lab and having more interest in doing projects as hobby. Earlier I did in 8085 ..then small projects in 89c51 ...now started learning Arduino. I used to invest money to purchase sensors and processor and doing myself in House. But main technical supports are from NET, like you people. But now-a-days people are crazy to put their project as youtube without code and circuit diagram. So some time people like me are blinking.
But you have given the project in detail. It is very nice of you. By your this type of helping, you can develop many electronic engineers in India. let me once again Congrads you abi. All the best. Pl send your mail id if u like to have contact to my mail id []. Thanks Abi
Regard from Pradeep

Sir,
I tried the same code given above, but could not understand the flaws.... the rfid reader reads the tag code... but does not display the rfid code in lcd... it shows junk characters..... would you mind helping me out... that what would be reason behind this issue