RFID-RPI


What is RFID?


Radio-frequency identification uses electromagnetic fields to automatically identify and track tags attached to objects. An RFID system consists of a tiny radio transponder; a radio receiver and transmitter.

rfid

A conventional RFID system is made up of three components:

  • RFID reader.
  • RFID antenna.
  • RFID transponder (or tag) electronically programmed with unique data.

RFID modules used:

  • EM18 MODULE: EM18 RFID Reader is a module which reads the ID information stored in RFID TAGS. This ID information is unique for every TAG which cannot be copied.

em18

  • MRC522 MODULE: The RC522 is a 13.56MHz RFID module that is based on the MFRC522 controller from NXP semiconductors. The module can supports I2C, SPI and UART and normally is shipped with a RFID card and key fob.

rc522

Working with EM18 module


Enabling serial from Raspi-config:

  1. Open terminal and perform the command stated below
sudo raspi-config

sudo1


  1. Click interface options.

interface


  1. Click Serial Port.

serial port


  1. Click no when it is asked that WOULD YOU LIKE A LOGIN SHELL TO BE ACCESSIBLE OVER SERIAL?.

  1. Click yes when it is asked that WOULD YOU LIKE THE SERIAL PORT HARDWARE TO BE ENABLED?

  1. Perform reboot using the command stated below
sudo reboot


Perform the connection


1.TX of EM18 to RX of Raspberry pi
2.vcc to 5v
3.GND of EM18 to GND of raspberry pi

em18image



Run the code stored in the EM18 rfid code.py file.


Working with RC522 Module


Enabling SPI from raspi-config

  1. Execute the command stated below on the terminal:

sudo raspi-config
2. Click interface options.

interface


3. Click SPI

spi


4. Press Yes, When asked WOULD YOU LIKE TO ENABLE SPI INTERFACE
5. Perform the reboot using the command stated below:

sudo reboot

Install SPIDEV


1. Open the terminal and execute the command stated below:

sudo pip3 install spidev

spidev



Install MFRC522


## Open the terminal and execute the command stated below:

sudo pip3 install mfrc522


rc522ter



Perform the connections


rc522connection



Run the codes stored in rc522 folder.

Note unlike EM18 module, in RC522 module, we can store the unique rfid id by running the code stored in rc522 read.py file .