In this illustration we will going to wire the RFID (Radio Frequency Identification) Module RC522 in this module it uses a radio signals and a Radio Label Tags for reading and writing data.

How RFID works please refer to this link,
How Servo works please refer to this link.

The most common way of using RFID is the identification or a products, where tag can contain information such as product code, the origin, expiration date, and the manufacturer, etc. also the RFID is used in Tags on animals for tracking purposes, also in vehicles, transportation, cargo tracking and access control and many other purposes.

Kit_Modulo_Rfid_Mfrc522_13,56_Mhz

The RFID Module is able to read tags at operating 12.56MHz frequency, and support cards and tags like Mifare1 S50, Mifare Ultraligh, Mifare1 S70, Mifare DESfire and Mifare Pro.

Gate / Entrance Access Control with RFID

RFID-522-Diagram-Pinout-Wire-Arduino-3

Wiring the RFID Module

RFID-522-Diagram-Pinout-Wire-Arduino

This RFID module uses SPI (Serial Peripheral Interface) for communication with the Arduino MCU though the digital pin 10 at 13, pin9 which is the RST (Reset) is connected. See the diagram below the arrangement of the pins and connection to the Arduino board along with the MFRC522 library.

RFID-522-Diagram-Pinout-Wire-Arduino-2

Recognizing the Tags and Cards to Control the Servo using PWM

As you see the sketch below, we include the Servo Code Library which is been already built-in inside of our Arduino IDE, and the RFID You can download the Code library here.

We added two LED to show as our indicator the GREEN will be Access Granted Status and the RED LED will be our Access Denied indicator, which is connected to our Arduino Pin 6.

To read the tag, you need to check the monitor serial number of the tag read by the sensor, and place the number in the code | if (cont.substring(1)==”14 12 22 4A”)

Same thing the cards, you can add identical entries and just change the UID number in each card, released the access and drives the serve, moving to 90* and if the access is denied the red LED will flash.

Sketch Code for Using Single Channel Relay

Download the MFRC522 Code Library Here | Zip

RFID RC522 Gate Access Control with Arduino
Facebooktwittergoogle_plusredditpinterestmail
Tagged on:     

8 thoughts on “RFID RC522 Gate Access Control with Arduino

  • at
    Permalink

    i have an error. which is ‘Mfrc522’ was not declared in this scope..
    how to solve this problem?

    Reply
  • at
    Permalink

    Hi, you need to import the MFRC522 Library which is can be downloaded at
    > https://github.com/miguelbalboa/rfid
    Step 1.
    1. Goto Arduino library manage then type MFRC522
    2. then Install

    Other Step
    1. Download the MFRC522 Library
    2. Extract
    3. Copy the folder and Goto My Documents / Arduino / Library and phase.

    Reply
  • at
    Permalink

    While uploading the codes to my arduino the error message is coming that mfrc522 was not declared. Can you please let me know the that what is the solution for that

    Reply
  • at
    Permalink

    cont was not declared in this scope… why?

    Reply
  • at
    Permalink

    Hey, thanks for the article, great illustrations! Just a little heads up, first illustration with just the RFID wiring, MISO should be Pin 12 :)

    Reply
  • at
    Permalink

    hi. i get the error ” error: ‘cont’ was not declared in this scope

    if (cont.substring (1) == “7A E0 03 2F”) ”

    how can I fix this?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *