Fork me on GitHub

Project Notes

#500 RFID Concentration Game

Play a game of Concentration/Pairs with a stack of MIFARE Classic cards.


Here’s a quick demo..



You may have played Concentration - the simple card game where the objective is to pickup as many matching pairs of cards as possible.

I have a stack of RFID cards that I got with a reader, so attempting a version of Concentration was the first and most obvious thing that popped into my head!

Gameplay Design

I decided to keep the interaction as simple as possible, and in particular avoid the need for a text display unit, so I designed the game-play around:

  • an 8x8 matrix to display the card identity and flash various effects
  • a buzzer and LEDs for feedback
  • and the cards themselves for all input

Feedback states:

Name Buzzer Red Green Yellow Meaning..
gameRunning off off off Fast Flash in game mode, waiting for a card..
initializing off Flashing Flashing Flashing in card initialisation mode
CardInitialized Beep off ON Flashing card initialized, ready for a new one
CardInitializeFail Beep ON off Flash ON card initialize failed
cardAccepted Beep off Flashing off first card accepted, present another..
cardMatch Happy Beep off ON off second card match. Win!
cardMismatch Sad beep Flash ON off off second card mis-match. Fail!

The Doxygen documentation for the code is available here.

Additional libraries used in the Arduino code:


The RFID cards need to be initialized before they can be used.

After power-on:

  • if a recognised card is scanned, we assume you’re starting a game using the card set retrieved from EEPROM.
  • if an unrecognised card is scanned, we assume you’re setting up a new stack of cards:
    • the card set is initialised
    • the card is added to a new card set in memory (grouped into pairs), and the card ID is written back to the card
    • positive feedback (a “good” beep and green LED)
    • keeps initialising any other cards that are presented until max card limit reached, or an already-initialised card is presented (which triggers game mode)

Game Mode

  • after first card is presented, provides a neutral beep and red/green LEDs flash
  • when a second card is presented:
    • if it matches, plays a happy tune and green LED is on
    • if it does not match, plays a sad tune and red LED is on
  • game is over when all pairs have been successfully matched


  • it won’t bother to warn on repeated presentations of the same pairs - assume players are policing the rules themselves!
  • there’s no score-keeping, that’s up to players, as it doesn’t know who or how many players are in the game

Card Data

For simplicity, uses value blocks for a game ID and card ID.

Data is stored in sector 1. That is, block 4 to block 7:

  • block 4: the game ID value block
  • block 5: the card ID value block
  • block 6: unused
  • block 7: sector trailer

Each card is given a sequential number starting from 1. Pairs are the adjacent cards i.e. 1+2, 3+4 etc. That’s not random, as it assumes the players will use the age old technique of shuffling the cards before starting the game.

Circuit Design and Breadboard Prototype

Power: the MFRC522 is 3.3V device, and officially tolerant up to around 4V. So, running it with the 5V Uno is not strictly legit. Power is supplied correctly at 3.3V, but data lines will stray up to 5V. I haven’t included level shifters. But it does seem to work, as many have proven before, though I wouldn’t do it this way for anything requiring long term reliability.




Final Build

Some decisions for the final build:

  • I replaced the 3 LEDs with the LEAP#269 Boldport Cordwood for the final build (because it’s purdy).
  • stuck with an Arduino Uno as the base board (as it has the 3.3V and 5V supply already taken care of)
  • still left out the level shifters for the MFRC522 data lines. So far, so good (fingers crossed)

The Boldport Cordwood gets some copper wiring so it can stand proud:


Wiring and testing the modules before mounting:


I used some balsa wood with a clear varnish for the custom case. Mounting the modules:


The final build in action:


Credits and References

Project Source on GitHub Project Gallery Return to the LEAP Catalog

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

LEAP is just my personal collection of projects. Two main themes have emerged in recent years, sometimes combined:

  • electronics - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting
  • scale modelling - I caught the bug after deciding to build a Harrier during covid to demonstrate an electronic jet engine simulation. Let the fun begin..
To be honest, I haven't quite figured out if these two interests belong in the same GitHub repo or not. But for now - they are all here!

Projects are often inspired by things found wild on the net, or ideas from the many great electronics and scale modelling podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know (or send a PR!). See the individual projects for credits where due.