RFID stands for Radio Frequency Identification. RFID module can read or write small amount of data into a Passive RFID tag, which can be used in identification process in various systems like Attendance system, security system, voting system etc. RFID is very convenient and easy technology.

To read the Passive RFID cards and tag, we need a microcontroller with UART hardware. If we select a microcontroller without UART, we need to implement software UART. Here we are using PIC Microcontroller PIC16F877A for interfacing RFID. We will simply read the unique identification no. of RFID tags and display it on 16x2 LCD.

There are three types of RFID tags available, Passive, Active or Battery-assisted passive. Different kind of RFID tags with a different kind of shapes and sizes are available in the market. Few of them use different frequency for communication purpose. We will use 125Khz Passive RFID cards which holds the unique ID data. Here are the RFID card and tags we are using for this project.

The module uses UART communication protocol in 9600 Baud rate. When a Valid frequency tag is brought into the magnetic field of the EM-18 reader, the BC557 transistor gets on and the buzzer will start beeping, it also glows the LED. We are using a module which is easily available in the market and has complete circuitry with a buzzer, led, and an additional RS232 port.
Here is the RFID board module we are using with pin names. This module also has additional power option.

One thing needs to be kept in mind that the output of EM-18 reader uses 5V logic level. We could use another microcontroller which uses a lower logic level, but in such cases, the additional logic level converter is required. In few cases, the UART pin of the 3.3V microcontroller is often 5V tolerant.

The UART output provides 12-bit ASCII data. First 10 bits are RFID tag number, which is the unique ID and last two digits are used for error testing. Those last two digits are the XOR of the tag number. EM-18 module will read the data from 125 KHz Passive RFID tags or cards.

Those tags or IDs have a factory programmed memory array which stores the unique ID number. As those are passive, so no battery is present in the card or tags, they get energized by the magnetic field of the RF Transceiver module. These RFID tags are made using the EM4102 CMOS IC which is clocked by the magnetic field too.

Material Required

To make this project we need following items-

PIC16F877A

20Mhz Crystal

2pcs 33pF ceramic disc capacitor

16x2 Character LCD

A breadboard

10k preset pot

4.7k resistor

Single strand wires to connect

A 5V adapter

RF Module EM-18

5V Buzzer

100uF & .1uF 12V capacitor

BC557 Transistor

LED

2.2k and 470R resistor.

We are using the EM-18 module board with buzzer and led preconfigured. So, the components listed from 11 to 15 are not needed.

Circuit Diagram

The schematic is simple; we connected LCD across port RB and connected the EM-18 module across the UART Rx pin.

If we see the main function we called a function to initialize the system. We initialize LCD and UART in this function.

/* This Function is for system initializations. */void system_init(void){ TRISB = 0x00; //PORT B set as output pin lcd_init(); // This will initialize the lcd EUSART1_Initialize(); // This will initialize the Eusart}

Now, in the main function, we used a 13 bit array which is RFID Number. We receive each bit of the RFID no. using EUSART1_Read(); function, which is declared inside of the UART library. After receiving 12bits, we print the Array as string in the LCD.