RFID Module RC522 Interfacing with Arduino Uno/Mega || RFID Module Arduino Tutorial + Code 2020

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 พ.ค. 2024
  • RFID Module RC522 Interfacing with Arduino Uno/Mega || RFID Module Arduino Tutorial + Code 2020
    Download Code: bit.ly/rfidCodes
    Download Schematic: bit.ly/rfidSchematic
    Download Library: bit.ly/rfidLibrary
    Article:
    Hello guys I'm Azhar, and in this video I will show you how to use this RFID module with Arduino. So for this project you will need RFID module this is RFID RC522. I'm here using Arduino mega you can use Arduino uno, and I'm here using an LCD with I squared c (i2c) module for displaying the messages. We will connect the four pins which are SDA, SCK, MOSI and MISO and we will skip the fifth one and we will then connect ground, reset and 3.3 volts pin. So as you can see here I have done the Connections, I have connected the lcd and this RFID module to the Arduino mega. We will read the UID of our tag and cards and then we will read them using this RFID module. I have connected it so here this is the code is actually the example code of this library which is MFRC522 so the code is this one dump info but I have modified it for the lcd. These are the pins of the RFID module so here RST in Arduino uno we will connect RST to pin 9 SDA to 10 MOSI to 11 MISO to 12 and SCK to 13 but in Arduino mega we will connect the RST pin to 5, SDA to pin 53, and MOSI to pin 51, MISO to 50 and SCK to 52 so you can use this module with Arduino uno, mega, nano, micro and pro micro so now let's see the code here I have added these libraries these two are for LCD and these two are for this RFID module so if you are using Arduino uno you will change here these pins this RST pin and SS pin. RST if you are using Arduino uno so you will change it to 9 here and SS to 10 right but here i'm using Arduino mega so I will change it to 53 and to 5 okay so here we have created instances for lcd and RFID module we have initialized the lcd we have begun the serial communication and we have initialized and we have initialized the RFID module so here we will read the card or tag whatever we have so after this we will print the data in the card to the serial and also to the LCD so let's upload the code first we will check our board and the port which it is connected and then we will upload it. So our code is uploaded so we can check the UID of our cards and the tag using this serial monitor. So here we will scan our tag on this RFID sensor. So here you can see the UID 69 CD 70 59 here in the serial monitor you can see here the Card UID which is 69 CD 70 59 so you will note this UID we will use this later. So I have these three cards here you can see and this one tag I have scanned the tag and I have noted the UID now I will scan this card and this is the UID of this card. I will scan another card and this is the UID of this card and i'll scan this last card and this is the UID of this card so now we have got the UID of our cards and tag I will open the another code here. You can see here I have four strings UID 1, UID 2, UID 3 and UID 4 and these are the UIDs of my cards and tag. Right. And after this we have this code so here it will check the UID of the scanned card or tag if it is UID 1 it will print on the serial authorized access and it will print on the LCD Tag 1 and it will print in another line authorized access right. If it is UID 2here okay okay this one. So here if the UID is 2 it will print Tag 2 authorized access if it is UID 3 it will print Tag 3 authorized access and if it is UID 4 it will print Tag 4 authorized access after this if the UID of the scanned card or Tag doesn't matches with any of these four UIDs so it will print access denied and it will print on the LCD unknown after that access denied so as I have four cards. Right. And let's check both the conditions so i'll upload the code and our code is uploaded so here as you can see the LCD says scan Tag so first we'll scan this so it says Tag one authorized access it will say it for three seconds so this was our Tag one now let's scan this one this card that says take three authorized sccess so let's write here 3 okay and i'll scan this one now so this is Tag 2 and let's write here 2.Okay and let's scan this last one and it says access denied so as you can see it says unknown access denied so it means that this is our tag four so in this way you can use this RFID module you can make a lot of projects using this module you can make a door lock you can make an attendance system you can make a lot of IOT projects.
    Automatic Water Pump Controller
    • How to make automatic ...
    Home Automation using Arduino
    • How to make Home Autom...
    Home Automation Using Node MCU
    • How to make smart home...
    Wifi Controlled Robot Car
    • How to make wifi contr...
    A9/A9G GPRS + GPS module complete tutorial, calling, texting
    • A9/A9G GPRS + GPS modu...

ความคิดเห็น • 33

  • @evanheffley1625
    @evanheffley1625 3 ปีที่แล้ว +1

    Great tutorial, thank you so much for the detailed information!

  • @damianred2003
    @damianred2003 ปีที่แล้ว

    Hello, I wanted to ask you if you can make an access counter with the internal memory of the rfid card. Let's say I use two readers. With a reader you can record the number of accesses on the card and with the other reader authorize the access and gradually discount the number of accesses from the card. It would be two Arduinos with two different readers. Is it possible to do that?

  • @kevfl1311
    @kevfl1311 2 ปีที่แล้ว

    Como puedo encontrar la librería LiquidCrystal_I2C ?

  • @mtechzone3176
    @mtechzone3176 3 ปีที่แล้ว +1

    Good

  • @learningadvancedenglish805
    @learningadvancedenglish805 2 ปีที่แล้ว +1

    Azhar Bhai splendid

  • @bhuvanbhuvanraj
    @bhuvanbhuvanraj 2 ปีที่แล้ว

    Can i run this code in ESP32S ???

  • @mrinalmathur9868
    @mrinalmathur9868 3 ปีที่แล้ว

    My lcd is getting backlight but nothing else..please help

  • @severinegeorges2584
    @severinegeorges2584 2 ปีที่แล้ว

    Hi, thanks for this. I am getting the message MFRC522.h: no such file or directory although i can see it downloaded. Any suggestion please?

  • @user-ds7ol9mu4m
    @user-ds7ol9mu4m 2 ปีที่แล้ว

    How did u connect that circuit diagram i.e.,through which website??
    In tinkercad i am not able to connect rfid... Please suggest me another way

  • @habeebsahily244
    @habeebsahily244 3 ปีที่แล้ว

    hi can you please tell me how to connect the lcd display to arduino uno since the schematic is the connection with Arduino mega please?

    • @AzharElectronics
      @AzharElectronics  3 ปีที่แล้ว

      Kindly watch this video for LCD connection with Arduino UNO.
      th-cam.com/video/ih_cWhl_ES0/w-d-xo.html
      If you have any other questions you can send me an email.
      Email: azhar987k@gmail.com

  • @sensordhanaraj1327
    @sensordhanaraj1327 2 ปีที่แล้ว

    But u don't mention any output pin to this circuit sir.please tell me.

  • @The1976DJ
    @The1976DJ 2 ปีที่แล้ว

    Hi may i request how to code RFID by coin operated..?

    • @AzharElectronics
      @AzharElectronics  2 ปีที่แล้ว

      Download Code: bit.ly/rfidCodes
      Download Schematic: bit.ly/rfidSchematic
      Download Library: bit.ly/rfidLibrary

  • @sensordhanaraj1327
    @sensordhanaraj1327 2 ปีที่แล้ว

    Sir please give 5v relay output point sir. For lock and unlock system.

  • @user-oe1tj3vs6x
    @user-oe1tj3vs6x 6 หลายเดือนก่อน

    Can i use 1 watts speaker?? please reply😢

    • @AzharElectronics
      @AzharElectronics  6 หลายเดือนก่อน

      For what do you want to use 1 watt speaker?

  • @augustinealbert
    @augustinealbert ปีที่แล้ว

    Can I use RFID sensor without Arduino

    • @AzharElectronics
      @AzharElectronics  ปีที่แล้ว

      You can use but you have to get the data and process that. For that you need a microcontroller/microprocessor

  • @MonirMostafiz
    @MonirMostafiz 9 หลายเดือนก่อน

    Download Code is not working

  • @ihebbenyahmed5992
    @ihebbenyahmed5992 2 ปีที่แล้ว

    How to interface it with arduino due please? Ido the same that you do and it didn't work

    • @AzharElectronics
      @AzharElectronics  2 ปีที่แล้ว +1

      Check the pins of your arduino.

    • @ihebbenyahmed5992
      @ihebbenyahmed5992 2 ปีที่แล้ว

      @@AzharElectronics i checked but it didn't work and i couldn't find any examples in the internet. Can you please send me the interfacing diagram with arduino Due?