Experiment 6 How to Use RFID Module

Share for us


In this experiment, we will learn how to use RFID module. We use RFID library and simulate SPI with software to realize the communication between SUNFOUNDER MEGA2560 and RFID module. After you have finished the following experimental steps, if you make the matched magnetic card approach to the card reader, the serial monitor will display ”Collect!”.



RFID Module (including card reader and tag) * 1 USB Cable * 1

Jumper wires


First, connect the circuit

Second, program

Open the getId file provided in our CD in Arduino IDE, compile the file and then burn it into SUNFOUNDER MEGA2560 board.

After burning getId, make the tag approach to the card reader, you will see the following values printed on the serial monitor:

Open your serial monitor and write down your magnetic card ID (e.g. my magnetic card show ID is 156F9FAF). Open the rfidTest file provided in our CD and replace the ID in the program with the ID you just wrote down (divide the ID into four parts and fill them according to the following format).

Third, compile the program

Fourth, burn the program into SUNFOUNDER MEGA2560 board

After burning rfidTest, you will see the following values printed on the serial monitor: