RFID card, also called IC card, is widely used in security system. This tutorial will show you how to use Osoyoo MEGA-IoT shield+OSOYOO RC522 RFID module + MEGA 2560 board to Write/Read data from RFID card and verify if the IC card matches the computer record.
OSOYOO Advanced Board for Arduino MEGA2560 x 1
OSOYOO MEGA-IoT Shield x 1
OSOYOO RC522 RFID module x 1
First, insert Osoyoo MEGA-IoT shield to OSOYOO Advanced Board for Arduino MEGA2560, then use the 8-pin Parallel Cable to connect OSOYOO RC522 RFID module to MEGA-IoT RFID 8-male-pin row, make sure the 3.3V pin in RC522 module must connect to 3.3V in RFID 8-pin slot in the shield and SDA pin in RC522 must connect to pin 48 in the RFID slot.
1)You need download and install RFID library from following link:
Then, Go to IDE->Sketch->Include Library ->Add .zip Library and add RFID.zip file into the library.
2)Download following sample code to test RFID:
3)Load above code into OSOYOO Advanced Board for Arduino MEGA2560. Then open the serial monitor.
Use a RFID card to touch the RFID RC522 module, you will see following result in the serial monitor:
The number showed in above red circle is the RFID id of your card. You can write down this number in line 12 to verify card next time. If you use this card to touch RFID module, you will see “this card match our record”, otherwise if the serial window will show “not match”.
DownLoad Url osoyoo.com