Home Creators Posts Import Register Favorites Logout

Content

I'm sure you're very familiar with how RFID readers can be used in escape room identification/arrangement puzzles ("Arrange the statues on the shelf" etc.). This project is a variation on that theme, inspired by the "Connecting Wall" round in BBC's Only Connect, or the NYT's "Connections" game.

These games both feature a grid of 16 items - 4 groups of 4 related elements - in which it is not necessary to arrange individual items in a particular place, but rather to arrange groups of items together onto the same row of the grid.

To create a "real-life" version of this, I use 16x MFRC522 readers. I usually normally use the more capable PN5180 readers for most new RFID projects, but for this particular usage, the limited range of the MFRC522 is actually a benefit, as it allows me to position the readers closer together without fear of them interfering with each other.

Now, the problem with using MFRC522 is (as you might have discovered yourself if you've used them in previous projects) there are a great many counterfeit chips that have flooded the market, and not all of them are well-behaved when put on the same SPI bus as other devices. Put simply, rather like a spoilt child, they just don't know how to share nicely and wait their turn. To get around that problem, I'll show you how to use mulitplexers to explicitly connect and disconnect each reader in turn from the bus.

This is a relatively advanced project, but I hope you'll find it a useful demonstration of both how to write data to RFID cards, and also how you can use multiplexers to attach many RFID readers to an ESP32 or Arduino microcontroller.

Patreons-only project resources will be uploaded shortly. I hope you enjoy!

Files

Can you solve this real-life "Connections" word puzzle?

Learn how to build a physical version of the NYT "Connections" Puzzle / Only Connect "Connecting Wall" using 16 MFRC522 RFID readers and an ESP32 or Arduino microcontroller. This simple word puzzle requires you to sort cards into four groups, each containing four elements with a common connection between them.... simple, right?! The system has an easy training function to assign new groups to cards, making an infinitely replayable game - a fun project for use in a school, as an activity at an event, or at an escape room! 00:00:00 - 00:00:56 Introduction 00:00:57 - 00:01:04 Play along! 00:01:05 - 00:03:48 Solving the puzzle 00:03:49 - 00:06:51 Component Overview 00:06:52 - 00:10:31 SPI interface 00:10:32 - 00:12:00 The problem with counterfeit MFRC522 readers 00:12:01 - 00:14:52 Using multiplexers to isolate readers 00:14:53 - 00:15:40 Wiring diagram 00:15:41 - 00:16:21 Schematic and PCB design in EasyEDA 00:16:22 - 00:19:54 Writing group data to RFID cards 00:19:55 - 00:42:23 ESP32 Code listing 00:42:24 - 00:44:21 Wrapup More details and downloads for this tutorial, and all the other #playful #technology projects on this channel, can be found on my Patreon page at https://www.patreon.com/playfultech

Comments

KooLio

So good. Just in this moment im starting a RFID project to my christamss scape room. The users must put in the correct place some nutcrackers ober the fireplace

Micropuller

Nice! I'm working on a placement puzzle using 10 MFRC522 readers at the moment. Obviously, just connecting 10 readers to one ESP32 didn't work, so I tried your "MEGA RFID network" solution, but couldn't get that to read the tags reliably either. So now I'm using two ESP32's, each one connected to 5 readers. The second ESP32 checks if the relay-pin of the first one is high before determining if the puzzle in it's intirety is solved. I think I'm going to order a couple of multiplexers, because this solution looks much more reliable / stable. Just one thing though: I couldn't get the ESP32 to work with the MFRC522 library. When I tried to upload it, it threw a fault. After some digging around on the internet, I found a solution. It involved changing two lines in the code of the library (see this thread: https://github.com/miguelbalboa/rfid/issues/371). I was surprised that you didn't seem to have that problem.

John Irvine

If anyone can make this work I would appreciate if you could post here. I have never been able to make any of Alastair’s RFID puzzles work reliably.

Christophe Geerkens

What I've been able to pull off is 2 MFRC522 readers for 1 arduino uno, and then connect multiple as a slave to a master arduino uno (or mega depending on how many slaves you have). That works pretty well, as long as the cables between the MFRC522 and the arduino uno are not too long and the connections are solid. The tiniest bit of a loose connection, and it's screwed up... Also, the distance between the RFID and the card should not be too big. About 6mm MDF is pretty good. 12mm MDF is manageable, anything thicker, or hardwoord or very glued materials, gives troubled readings... I have 6 RFID connected to one puzzle this way without issue. (1 master and 2 slaves, each with 2 RFID readers each. Each RFID also has a green and red led to indicate whether or not the card presented is correct or not.

Alastair Aitchison

The error you're describing only affects you if you've upgraded to v3.x of the arduino-esp32. This was only released recently and contains a lot of breaking changes so you'll find a lot of libraries do not yet support it. updated. There's two easy solutions: a.) Continue to use the v2.x branch of ESP32. b.) Use my fork of the MFRC522 library, which already includes the fix: https://github.com/playfultechnology/MFRC522

Micropuller

Ah, this is my first time working with ESP32, so I must have installed all the latest updates. I didn't even realise there were multiple versions. I guess that, if I would like to go back to the V2 branch, I'll have to deïnstall the V3 branch first? Or does it do that automaically (or can I use both simultaniously?)

Alastair Aitchison

Once you've downloaded them both, you should be able to switch between them relatively quickly. If you're new to ESP32, I'm not sure which is best to recommend.... on one hand, it seems a little silly to start a new project on anything other than the latest version (3.0.4). But, on the other, if you're still learning about nuances and features of ESP32, you'll find quite a few tutorials and libraries on the internet will be out-of-date, so you might want to stick with 2.0.17 instead.

Alastair Aitchison

You can safely assume that any of my projects work with 2.x, but I have not yet tested them with 3.x yet, so they may or may not require adjustments. I've recently been working on a project that uses the ESP32's CAN Bus controller, and ended up having to downgrade it back to 2.x because there were just too many breaking changes introduced to CAN/TWAI in 3.x

Alastair Aitchison

Yes, that's another possible architecture! - You can also use a buffer chip like a SN74AHC1G125 that only connects each reader's MISO line when its SS is pulled LOW. - Or, use a port expander like an MCP23017 and give each reader its own dedicated ports, which you then use an emulated SPI connection on - Or, use one microcontroller per reader! For PN5180 boards, in particular, I sometimes attach one Wemos D1 Mini board directly to it (they're unbelievably cheap) as a "dumb reader", which just reports the tag read directly back to Node-RED where all the game logic is applied. That makes for a basically limitless number of RFID readers (although be mindful of what actually makes an enjoyable puzzle!)

Micropuller

It seems the original project's biggest enemy is voltage drop / signal loss due to wiring that's too long and/or too thin and/or having bad connections. I've gotten the project working using 6 readers and an Arduino Nano. I used ribbon cables (24AWG, about 8 inches long) to connect the readers to the Nano and every connection was soldered. I now have a prototype running using 5 readers and an ESP32. I used 5 foot long ethernet cables and this "breakout board" to connect all of the readers and the ESP32: https://nl.aliexpress.com/item/1005002242911059.html?spm=a2g0o.order_list.order_list_main.23.2fbd79d29nEnxE&gatewayAdapt=glo2nld. Be careful that you buy good quality ethernet cables (I used 24AWG CAT6 cables), otherwise you'll have too much resistance, resulting in voltage drop and / or signal loss. I've noticed that increasing the voltage to the readers slightly (0.1 - 0.2 V) can help with that, but do this at your own risk. I've just tested the range yesterday and was able to read a tag through a piece of 18mm MDF.

Philipp

Hey Alastair, thank you for this amazing Videos. All of your Videos are so intersting and helpful for my Projects. The wiring withe the Ethernet-connector is so simple and smart. You talk in the Video about the Problem that multiple SPI-Devices can get Problems together. How does that affact at your project? I have also the Problem in a Project for long time and can't find the Problem. In this Project i have 8 readers (i tried to reduce it to 4 readers without any changes) and all work fine. A time later (2 - 20 min random) the Arduino freeze and not longer run the code. After reboot the it starts from begining. I tried MFRC522 and PN5180. I think both are not original. Hardware is an Aduino Mega. Software i use the reader and MQTT for connecting to Node-Redscape over Ethernet with W5500 SPI Ethernet Module.

Alastair Aitchison

Hi Philipp, thanks for your message. The way in which SPI problems can affect a project varies... normally it just means that the readers fail to intialise, or fail to detect a tag. It doesn't _normally_ result in the whole system freezing - that is more likely caused by some other problem in the code - perhaps a buffer overflow writing to an out-of-bounds memory address, or something else entirely. From your description, you mention you're using a W5500 ethernet module as well (which I assume is also sharing the same SPI bus?). I would guess that seems a likely cause of your problems. What networking library are you using? Could that be the source of blocking behaviour? (Are you polling a remote server, or sending data to it? What sort of failure-recovery do you have if the network interface is interrupted?)

Philipp

Hi Alastair, thank you for the Reply. I think i have to test it at the weekend again, last time is a little bit in the past. It is also possible that i think the system is freezing, but only the readers are not reakting to the card. The W5500 is on the same SPI bus, Library are the "Ethernet" and the "PubSubClient" for MQTT. With MQTT i subscribe some Topics and also publish to the Server.

Mark-Ron Straite-Hale

Hello Alastair. I love this puzzle but I am going to use it just like your old rfid puzzle. The reason I am going to use this version is the learn portion. I am using it for a 5 card poker hand to solve the puzzle. Is it easy to scale this connections puzzle down to five objects intead of 12?

Hernán Camusso

Have the resources for this project been uploaded yet? Where can I find them? Thank you.

Alastair Aitchison

Hi Hernán, yes they have! The Patreon platform makes it a little hard to find things, but generally whenever I make a project I make two posts: the first is a public post (this one) that links to the tutorial, and then immediately afterwards I make a Patreons-only post with links to the resources. I always give that second post the same title but with the word "resources" appended at the end, so it should show up right next to this post if you search the site for "Connections". But here's the direct link to it! https://www.patreon.com/playfultech/posts/connections-rfid-112252771

Hernán Camusso

Okay, since I'm new I didn't see that the resource post was right above and I kept scrolling down! Best Regards!!!

Alastair Aitchison

Oh, please don't blame yourself! There's a lot of things which could be improved about Patreon's user interface, which is often not that intuitive. But it's the best platform I've found so far. And do ask if you ever have questions!