Home Creators Posts Import Register Favorites Logout

Content

It's been over a year since I made my RFID Object Placement puzzle, which continues to be one of the most popular technologies used to provide the "magic" in escape room puzzles, and also has plenty of uses in other playful technology projects. 

So, I thought I'd take this opportunity to test out some of the common RFID hardware currently available - note the advantages and disadvantages of each - and some of the "gotchas" to be aware of if you're considering using RFID in your own projects.  

RDM6300

The simplest, cheapest option for reading a single RFID tag

The RDM6300 is a widely-available low-frequency (125kHz) RFID reader based on the EM4100 chip. Whenever an EM4100-compatible tag is brought within range, the reader automatically outputs the tag ID in a 14-byte datastream to a device connected to the TX pin. An Arduino can read this data very simply using a Serial.read() command to retrieve the tag, and compare this to a known "correct" value. It works well for detecting single cards at close distance, but that's about the limit of its use. 

+ Incredibly cheap (around $1.40 each at AliExpress) and easily-available

+ Very simple to wire - requires only 5V, GND, and a single data wire to Arduino

+ Very simple software; no additional 3rd party libraries required, just read out whatever data is received on the serial connection pin. Example on my GitHub repository.

- Very limited read range (~3cm)

- Very hard to have more than one reader connected to single Arduino;  can't reliably create more than one software-emulated serial port, and switching between readers on a single port using a multiplexer might get garbage data etc.

- No way to detect if a card is *currently* present on the reader - only to get the tag of the last card read

 

MFRC522

Very widely-used, with reliable, well-supported software library and plenty of examples

The MFRC522 is a high-frequency (13.56MHz) chip that uses the ISO14443 protocol, compatible with common "Mifare" cards and tags. This is the board I see most-commonly used in other projects, and is the one I used in my own previous RFID tutorial. It's very easy to get hold of, and very cheap. One thing to note is that it comes in a number of different varieties, and even when two boards are apparently based on exactly the same design, they can still vary significantly in the quality of components used. If you buy the absolute cheapest model available, don't expect it to be the most robust!

It uses the SPI standard peripheral interface, and one particular difference I've become aware of is that some boards are tolerant of receiving 5V on the SPI lines from the master device (SCK, MOSI, SS), whereas some are not. That means that, rather than connecting directly to a 5V Arduino Uno/Nano, you should place a 3.3V<>5V logic-level convertor like this on those lines (it will protect devices that are not 5V tolerant, and won't do any harm for those that are). If you are using a microprocessor that already uses 3.3V logic, like an Arduino Micro or ESP32, the convertor is not required.

+ Very cheap (around $1.60 on AliExpress)

+ Robust, well-support software library maintained on GitHub

+ Uses standard SPI connection - each reader requires (shared) MOSI, MISO, SCK, and (dedicated) SS line.

- Read range limited to about 4cm (can be extended slightly by replacing L1 and L2 inductors with same inductance but higher current rating, e.g. like these), as shown below

 

PN532

Not the cheapest, nor the smallest, nor the easiest to use, nor the best performing... best to scroll on past...

The PN532 is a newer chip than the MFRC522 and theoretically offers a number of benefits over it. However, from empirical testing, I couldn't find any advantages of using this board over the older MFRC522. It's more bulky, significantly more expensive, has less software support, and has no discernible improvement in read range. The board supports an I²C interface, which should have simplified the wiring for an array of readers but since every PN532 board has the same, fixed I²C address of 0x48 it's impossible to address more than one of them!

- Most expensive unit on test (around $20 on AliExpress)

- Supports I2C but, with fixed address of 0x48, only one reader can be used!

- Large physical size makes it harder to embed in props

PN5180

Offers greatest read range by far of any reader tested, using familiar SPI interface. If you want the best performance and don't mind experimenting with bleeding-edge software libraries, this is the reader for you 

Like the MFRC522 and PN532, this is a 13.56MHz high-frequency RFID reader. However, rather than using the ISO14443 "proximity card" standard as with those readers, it also implements the ISO15693 "vicinity card" standard. This allows for much greater read ranges - I could comfortably read the ID of a card held about 15-20cm from the reader. Note that you need to get compatible tags/cards to make use of the ISO15693 standard - although they look identical to the ISO14443 tags you'd use with an MFRC522, you can't simply use the same tags and expect to get an improved range - you need dedicated ISO15693 tags such as these.

+ Significantly greater read range than any other reader tested here (~15-20cm)

+ Uses same SPI interface as the common MFRC522

- Uses ISO15693 protocol, for which tags are less common and more expensive than ISO14443

- Very new chip means few libraries, documentation, or other examples currently available. Please see my GitHub repository for code used here. 

- Limited range of hardware suppliers, and cost is more expensive than some other readers, although still cheaper than PN532! (PN5180 is currently around $8 on AliExpress) 

Files

RFID Roundup!

Radio-Frequency Identification (RFID) is used in all sorts of daily life: from contactless smart cards to warehouse inventory management, tracking livestock to library book loans. It's also commonly used in escape rooms and other similar electronic projects where a number of items (secretly embedded with RFID tags) must be placed in particular positions in order to be detected by (equally secret) readers. In this video, I want to compare four of the most common sorts of RFID readers used in Arduino electronic projects - RDM6300, MFRC522, PN532, and PN5180 - and describe their usage with particular emphasis on their suitability for such "object placement" puzzles. The most important characteristics I'll be looking for are the read range at which a tag can be detected by the reader, and the ability to create an extensible array of readers such that each reader must be simultanously activated by the appropriate tag ID in order to "solve" the puzzle. I'll also mention price, ease of wiring, and software coding. For accompanying wiring diagrams and software code used, please refer to my Patreon page at https://www.patreon.com/posts/23115452

Comments

Riccardo Bramati

Hi Alastair. I saw your project on YT and came to Patreon to ask you a couple of things. Now I'm using MFRC522 and I saw that by changing the inductance L1 L2 I can extend the reading range, ok this is a good idea. However, I wanted to know if there are I TAG 215 type tags with ISO15693 and if they can be written and read as happens with ISO14334 TAG215 tags with NDEF type coding. Using the MFRC522s with the NDEF_MFRC522 library I can read and write them. What can I do with these PN5180? Is there a library that offers me not only reading the UID but also the bad EEPROM data? Thank you

Zach Huffman

Are there any kind of RFID reads out there that give you 1 - 1.5m read range? Like for instance, a group has to be carrying an object in order to open a door?

Greguy Leodocard

hi alastair, thank you for your video ! i use the MFRC522 on an UNO with your RFID project. i watched your video several times to understand how to plug the converters with 4 MFRC522 but i did not figure out how to do it. In your example there is only one MFRC522 and you don’t connect the mosi / miso / sck to pin 11, 12,13, only the sda and voltage wire go to your UNO. I’m wondering how can i plug all the wires with the logic converters in your RFID project ? Thank you !

Ian Chou

Hi Alastair. Comparing to RC522 which uses shared reset signal, PN5180 uses unique reset signal and additional unique busy signal. Does that mean if we are to connect 4 PN5180, it would use 7 more GPIO than to connect 4 RC522? I am using a Wemos D1 board which has fewer GPIO, is there a walkaround to use less GPIO? Or a ESP-32 is necessary to have more PN5180 readers. Thanks.

Jon Weston

Hi Alastair, is there a Fritzing (or similar) available for wiring up 4x RC522 readers to an Arduino going through a logic level shifter? Would I use one shifter and then out to the readers or a shifter per reader? EDIT: I've managed to get a bi-directional logic level shifter working nicely on a 1m run of cable. The shifter is fixed to the reader to minimise any 3.3v voltage drop. Next to re-cable with CAT5 and test adding more readers/shifters up to 6...!? The shifter is VHB'd to the reader and the reading side will be flat against the underside of the gameplay surface (a pocket cut area on/in a ply surface): <a href="https://www.dropbox.com/s/wrmkecwg53q8qbq/2019-01-06%2017.28.32.jpg?dl=0" rel="nofollow noopener" target="_blank">https://www.dropbox.com/s/wrmkecwg53q8qbq/2019-01-06%2017.28.32.jpg?dl=0</a> (Note the tiny surface mount components on the RC522 - different than the larger components on the readers that you used in your RFID game last year - this difference must make them non 5v compatible!) Here is a Fritzing of how I have wired it up: <a href="https://www.dropbox.com/s/zy912k2zr8lxc3q/RC522%20plus%20shifter%20Fritzing.png?dl=0" rel="nofollow noopener" target="_blank">https://www.dropbox.com/s/zy912k2zr8lxc3q/RC522%20plus%20shifter%20Fritzing.png?dl=0</a> Found this fritzing to get me started: <a href="https://cdn.sparkfun.com/assets/learn_tutorials/1/4/7/spi-example_bb-02.png" rel="nofollow noopener" target="_blank">https://cdn.sparkfun.com/assets/learn_tutorials/1/4/7/spi-example_bb-02.png</a>

Sven Hurt

Hello Alastair, After waiting almost a month, I got myself a PN5180 from eBay. I've downloaded the library and connected the reader to an UNO via a logic level shifter. Once uploaded, the serial monitor prints out the following message(s): ---------------------------------- Loop #486 Error in getInventory: No card detected! IRQ-Status 0x6: [ TX IDLE ] *** No card detected! ---------------------------------- Loop #487 Error in getInventory: No card detected! IRQ-Status 0x6: [ TX IDLE ] *** No card detected! The reader came with a card and a tag, both doesn't seem to work since the message does not change at all. I've checked the connection twice with different cables. Do you have any idea what the problem might be?

Hjalte Schougaard Olsen

Hello! I just joined the patreon but can't find the software code or wiring diagram. Can anybody help please? :)

Minter Arnaud

Hi Alastair, new subscriber from France, where can i find your codes ?

Dr Vector

Hello everyone. Greate video, really good comperison. Do any of you know cheep reader with antena with circular polarization. I am not sure by looks like PN5180 is linear. I will have tags with different positions and I heard that antenat polarized circular will work much better. I want to use it with ESP32.

Euan Hair

*** FATAL: Reading more than 508 bytes is not supported!

Euan Hair

HI Alastair, I've set up one reader and wired it according to your fritzing. The only bit in the code I've changed is I've made the number of readers 1 and removed one of the UIDs then set configured for the pins 10,9 & 8 for NSS, BUSY & RESET. const byte numReaders = 1; // What is the "correct" UID that should be detected by each reader uint8_t correctUid[][8] = { {0xB,0x8A,0xC6,0x6A,0x0,0x1,0x4,0xE0} }; // This pin will be driven LOW when the puzzle is solved const byte relayPin = A0; // GLOBALS // Each PN5180 reader requires unique NSS, BUSY, and RESET pins, // as defined in the constructor below PN5180ISO15693 nfc[] = { PN5180ISO15693(10,9,8), }; I keep getting the error *** FATAL: Reading more than 508 bytes is not supported! Do you know where I'm going wrong?

Mark Bond

Hi Alastair Loving your work as always In the section on mfrc522’s you say to place a 3.3V<>5V logic-level convertor between the Arduino and reader. In the video it looks like you are using a 5 channel version. In the application I’m using we are using we are only not connecting the IRQ feed. Would you recommend all cables run through a logic level or is there only a need for specific ones to run through it? We are running six readers in series if that makes any difference! Keep up the great work and look forward to you next video.

Mark Bond

Ok so an update on where I am I’ve ordered logic level controllers and made up 3 new rfid readers to replace the one’s out of the six we are using (they are set the right distance apart to stop interference). We are using I2c to communicate between two nano’s and I’ve remembered when I went to change the readers that I am feeding the readers with 3.3v but I take it that the signals will be 5v from your previous answer. so my question is do I leave it on 3.3v or run a 5v feed and run it through the logic level converter with the mosi, sck, clk and rst?