Introduction: Arduino: Wiring and Programming of RFID Sensor

Picture of Arduino: Wiring and Programming of RFID Sensor

RFID, or Radio Frequency Identification, is a system for transferring data over short distances (typically less than 6 inches). Often only one of the two devices needs to be powered, while the other is a passive device. This allows for easy use in such things as credit cards, key fobs, and pet collars as there is no need to worry about battery life. The downside is that the reader and the information holder (ie credit card) must be very close, and can only hold small amounts of data.

Step 1: Quick Start: Wiring

Picture of Quick Start: Wiring

Step 1: Connect the SDA slot on the RFID to the Digital 10 slot on the Arduino.

Step 2: Connect the SCK slot on the RFID to the Digital 13 slot on the Arduino.

Step 3: Connect the MOSI slot on the RFID to the Digital 11 slot on the Arduino.

Step 4: Connect the MISO slot on the RFID to the Digital 12 slot on the Arduino.

Step 5: The IRQ slot is to be unconnected to the Arduino.

Step 6: Connect the GND aka Ground slot to the Ground on the Arduino.

Step 7: Connect the RST to the Digital 5 slot on the Arduino.

Step 8: Connect the -3.3V to the 3.3v to the Arduino.

Step 2: Adding the Library

Picture of Adding the Library

Assuming you already have the Arduino software downloaded onto your computer.

1. Download the AddicoreRFID library needs to be added to your Arduino library depository.

2. Open the Arduino IDE and navigate to Sketch > Include Library. A drop down menu will appear. Click the option to “Add .ZIP Library…”

3. A window will open. Navigate to the location where the AddicoreRFID library you downloaded above is currently located and open it. (After the library has been installed the bottom left side of the IDE should say "Library added to your libraries. Check 'Include library' menu"

4. You can confirm that the library has been installed by again navigating to Sketch > Include Library. The AddicoreRFID library should now show in the list of “Contributed libraries.”

Step 3: Program Arduino

Picture of Program Arduino

After installing the AddicoreRFID library in the previous steps the library will be available to use in sketches but any example sketches included with the library may not be shown in File > Examples until after restarting the Arduino IDE.

1. Restart the Arduino IDE by closing all currently open Arduino IDE windows and then opening the Arduino IDE.

2. When the Arduino IDE opens navigate to File > Examples > AddicoreRFID. Select the “Addicore_RFID_Example” sketch. This will open a sketch which we will use with the RFID module that we wired to our Arduino earlier.

3. Now connect your Arduino to your computer and upload the code.

Step 4: Reading RFID Tags

Picture of Reading RFID Tags

1. With your Arduino programmed with the “Addicore_RFID_Example” sketch and with it still plugged into your computer open the serial monitor by clicking the Serial Monitor icon or pressing CTRL+SHIFT+M.

2. If it isn’t already selected set the serial baud rate to 9600 baud by clicking on the drop down selection in the lower right corner of the Serial Monitor window as shown above and selecting 9600 baud

3. Now take one of the RFID cards or fobs that came in your RFID AddiKit and hold it near the white graphic printed on your RFID-RC522 module

4. Once the module has read the RFID tag your Serial Monitor should show something similar to the second image above

5. Note the serial number. It is located on the last line of data, being the very first number (not the 100001, 1010101) it should look like a regular number like "59" or "68'

6. Now close the serial monitor and enter that number in the code of the AddicoreRFID sketch where it says

//Should really check all pairs, but for now we'll just use the first

if (str[0] ==156)

*Replace that "156" with the number you got from the serial monitor when you scanned your RFID card or fob

Along with that you can change the message from "Hello Craig!" to any message you desire. I chose "Hello Caitlin"

7. Finally, upload the changes to your Arduino by pressing the right pointing arrow in the Arduino Software window

Step 5: Test Out Your Programming

Picture of Test Out Your Programming

Make sure your programming worked by opening the Serial Monitor once again and waving your key fob or card near the sensor to see if your message appears and your programming is correct.

*Make sure your baud setting is on 9600

Step 6: Disclaimer....

Picture of Disclaimer....

I would like to first and foremost say that this instructable is an adaption from the Addicore LLC. "RFID Quick Start Guide: Arduino" pdf file. I used the pdf as a reference for my instructable. I own no rights to this information or pictures. I just created it in an 'instructable' form so it could be accessible to the instructable users or community and as a project for my class. Please give me no credit.Thank You.

Reference: RFID Quick Start Guide: Arduino. N/a: Addicore LCC., n.d. PDF.

URL:https://www.addicore.com/v/vspfiles/downloadables/Product%20Downloadables/RFID_RC522/RFIDQuickStartGuide.pdf

Step 7:

Comments

MartinH255 (author)2017-06-09

Good test to see if my soldering and setup was right, Thank You

vincenzius (author)2016-12-14

Is the ''hello name'' actually the data that is written on the tag? I'm confused, because I would just like to simply read and write some data on tags. Thank you!

Th3_D0c70R (author)vincenzius2017-01-05

The "hello name" is written into the program, the card only transmits the tag ID number.

ThomasW157 (author)2016-06-14

1.25 inch read distance for a key fob. Nowhere near the 4" distance that the manufacturer claims. Mark me down as disappointed. But thanks for the instructable!

KatV1 made it! (author)2016-05-08

thanks a lot!!!

andrew76092 (author)2016-04-14

Great Instructable! Now I just need some ideas on how to implement the use of my RFID hardware/software.

wold630 (author)2016-04-11

This was very informative!!

About This Instructable

4,396views

36favorites

More by CaitlinRR:Arduino: Wiring and Programming of RFID Sensor
Add instructable to: