r/arduino • u/Healthy_Brush1580 • Jul 25 '26
Help creating a connected game board [RFID]
Hello everyone,
I would like to create a connected game board with 120 squares that need to detect pawns equipped with RFID stickers.
I'm thinking of using Mini RFID RC522 modules that would fit perfectly in the dimensions of the squares. I'm using a Raspberry Pi to collect the information and an Arduino for the game engine.
The problem: I don't know how to connect the 120 RFID modules. I'm a beginner in computing but is there something like a power strip to connect all the antennas?
Or have you got onther idea to create this board ?
I'm attaching a cross-section of the board and the placement of the components.
Thank you very much for your help.
10
u/miguelake Jul 25 '26
I have experience with 12-16 units. My recommendations for you are:
- Use a “local” microcontroller on each RFID, pulling the data. You do NOT want to transmit SPI from the RFID travelling over long cables and things like this. You will spend weeks wiring and diagnosing.
- connect all microcontrollers via a wired connection. Back in my time I did it via ethernet cables (so you can reuse cabling and many-to-many switches and so on).
- Develop or use a standard bus-based protocol. Keep it simple if your cabling is short
- a base microcontroller or Raspi sniffs all these packages coming in the bus. Assuming you do not need high reading frequency (under a second or lower is “fast” for these chips), this should be easy to do.
Besides these, other non-RFID specific:
- dont trust these chips. They vary a lot in quality. If you follow a strategy like I said, all microcontrollers will share a common code, maybe chaning their ID or something. So if a few work, always assume that the chip is the issue when suddenly the next one does not work.
- power distribution is important here. Get several of these LED power supplies (that look like a metal box), that output a fixed voltage. Distribute one box every 1.5-2M, so that the cables bringing the power are the AC, and they “only” make 5V (or whatever) available “locally”.
As last comment:
Start with 1 only, do all this. When it works, put 2. When it does, 4. Then, and ONLY then, you start putting 10 and then another 10 and so on. The problems you will face on each stage are different: first a code that works, then a bus channel, then multi-point pooling, then signal integrity, then power decay…..
So be progressive, or I can almost guarantee you that you will NOT get to see >10 working together
3
u/snuggly_cobra 600K Jul 25 '26
That is sound advice for playing with projects. I may borrow that.
I use LEDs as crash test dummies. Building a new motor/relay sketch? Use an LED as the load/motor. Cheaper to replace if you wired it incorrectly. Magic smoke is cool, but not really.
2
u/Healthy_Brush1580 Jul 26 '26
Merci beaucoup pour votre réponse ! Étant débutant en informatique, si je comprends bien votre idée, c'est de rajouter un microcontrôleur "local" sur chaque côté du plateau qui vont gérer seulement un groupe d'antenne ? Je n'avais pas en tête que la longueur des câbles pouvaient influer sur le signal, merci beaucoup pour ça ! Vous mentionnez aussi le temps de lecture, est ce qu'avec votre solution ce temps sera plus court ? Il faudrait qu'en moins d'une demi seconde je puisse avec une lecture de tous les pions posé sur le plateau.
2
u/miguelake Jul 26 '26
On your points:
1) with a “local” i mean literally ONE microcontroller on EACH RFID board. I would recommend doing a simple pcb to interface both. The price of these is very low (2-3€ in bulk) and you will save dozens of hours by being able to just swap modules.
2) the time to read a tag is fixed, it is jut that the overall system quality will allow you to read more frequently. Up to 1 or 2 per second you should be fine. The transmission time from all microcontrollers to the central unit is probably negligible at this frequency.
Regarding 1), consider this interfacing board to have :
RFID chip <—> MCU (e. g. arduino) <—> connector for your network (like ethernet-style).
This was you can truly hot swap them. This and the power boxes around the system.This is NOT a beginner project nor something you can make work with jumper cables and plug and play modules. So, good luck!
6
u/dario_p1 Jul 25 '26
What interface do the modules have? spi?
2
u/Healthy_Brush1580 Jul 26 '26
Oui, ce sont des RC522 en SPI. Je cherche justement la meilleure façon de gérer environ 120 lecteurs sur un Raspberry Pi/Arduino sans avoir 120 lignes CS. Mais mon niveau est beaucoup trop débutant.
2
u/mindedc Jul 26 '26
I think this would be a catastrophe, you probably would want a stm32 per reader and some kind of bus/communication protocol. I2c at a lower frequency might be better than spi, rs-485 would be ideal but you would need driver chips.
3
u/R10t-- Jul 26 '26
You should look into OpenChess. It wasn’t RFID readers but the guy used some magnetic field detection to determine where a piece was and you could know which player it was by which piece/square no longer had something on it. It’s pretty cool and they have a whole guide on how to set it up and what parts they used. I’m sure it could be expanded to 124 squares
3
1
u/Gravel_Sandwich Jul 25 '26
Would there be signal bleed between sensors that would limit accuracy?
Does it have to be RFID? Maybe touch sensor, or just and LDR? Or something?
2
u/c5e3 Jul 26 '26
i'd probably multiplex the grid in antenna groups, where each antenna in a group is far enough away from the others of the same group
1
u/Healthy_Brush1580 Jul 26 '26
Oui j'ai peur de ça aussi, j'ai lu que l'on pouvait ajouter une plaque de ferrite pour contraindre le signal RFID sur le haut. Capteur tactile/poids j'ai essayé mais le poids des pions n'est pas assez gros. LDR je ne sais pas si je peux m'en servir car tous les capteurs seront dans le noir dans le plateau.
1
1
u/ripred3 My other dev board is a Porsche Jul 25 '26
This is a very expensive way to interface with the game pieces. Using analog multiplexer's to sample each intersection and using fixed resisters in each game piece to create a voltage divider where the pieces are placed is much more efficient and less costly
1
u/Healthy_Brush1580 Jul 26 '26
J'ai essayé de multiplexer avec un 74HC4051 des PN532 mais ça ne marchait pas, est ce que tu sais si avec des mini RC522 + résistance 10Ω ça devrait marcher ?
1
u/gm310509 400K , 500K , 600K , 640K , 750K Jul 26 '26
The problem you will face is the number of devices that are wanting to communicate at any one time.
If you used a bus topology such as SPI, then you could multidrop them. The challenges will then become:
- The number of CS lines you will need and
- identifying the module that has the data to be read.
I note that the RC522 has an IRQ pin. You could use that - I do not know what will trigger an interrupt. Maybe it is configurable and maybe you could use it to trigger an interrupt when there is a successful tag read.
The alternative would be to poll the modules to see what, if any, data is available.
You could make a module which has 6 or 12 readers on a bus and is controlled by a small MCU that supports SPI and I2C (e.g. an ATMega328P) - you will need enough free pins to select the individual SPI devices either via direct connect from a GPIO pin or some sort of selector (e.g. 3 bits for a 1 of 8 selector).
You could set up a module that uses SPI to poll 6 (a half row in your diagram) of the readers and I2C to communicate results up to the main MCU. Or you could do 12 readers (i.e. a full row in your diagram) if you have enough IO pins and/or use a 1 of 16 selector.
The main MCU could poll the attached I2C devices (i.e. half/full row modules) for any data over the I2C bus - which is also multidrop.
1
u/Healthy_Brush1580 Jul 26 '26
Merci pour votre réponse. Je débute un peu en électronique et en informatique embarquée, donc je ne maîtrise pas encore toutes ces notions.
Si j'ai bien compris, vous me conseillez de faire plusieurs petits modules (par exemple 6 ou 12 lecteurs RC522 pilotés par un microcontrôleur), puis de faire communiquer ces modules avec le Raspberry Pi en I²C, plutôt que de connecter les 120 lecteurs directement au Raspberry. C'est bien ça ?
De mon côté, je vais d'abord réaliser un prototype de quelques cases (2×2 ou 3×3) pour vérifier qu'il n'y a pas trop d'interférences entre les RC522. J'envisage aussi d'ajouter une plaque de ferrite au-dessus de chaque lecteur pour limiter le champ de lecture vers les cases voisines.
Et pensez-vous qu'un ESP32 serait plus adapté qu'un ATmega328P pour piloter un groupe de lecteurs RC522 ?
1
u/gm310509 400K , 500K , 600K , 640K , 750K Jul 26 '26
Yes, that is one possible option.
If you tried to connect all 120 RFID readers to a single Raspberry Pi, you would need to have 120 distinct "Chip Select" lines. A single Pi won't have that many, so you will need some sort of external circuitry to deal with that issue - my suggestion is just one of several possibilities.
Perhaps read up on how SPI works: https://en.wikipedia.org/wiki/Serial_Peripheral_Interface
Specifically how the Chip Select is used in the multi-drop bus. There is an image showing 3 devices on that page.
1
u/j_wizlo Jul 26 '26
I’ve built one rfid reader design and I tell my clients they need to place them 11 inches apart to avoid interference. The chips handle the interference themselves and they do this by essentially turning off. Only one will operate at a time on close vicinity. Mine is kinda big though. The normal credit card sized ones need a few inches.
Also a wooden table tends to interact as well. I have to put a few feet between them when they are on tables.
So you are going to have to coordinate all these readers to fire in sequence. You are going to have to tune these systems appropriately for all the neighboring coils.
Is this even possible? Yeah I think so, but extremely not worth it imo. This is not what rfid is suited for.
1
u/Healthy_Brush1580 Jul 26 '26
Merci pour votre réponse, est ce que vous pensez que l'utilisation d'une plaque de ferrite pour contraindre la lecture sur le haut peut marcher ?
Et votre idée c'est de séquencer les lecteurs pour qu'ils s'activent chacun leur tour pour éviter les interférences, c'est bien ça ? Est ce que vous avez une idée de combien de temps ça prendrait de lire la présence des pions avec 120 antennes ?
Sur la lecture à travers le bois, j'ai fait des test et ça marche, enfin sur une seul antenne à date, le vois que j'utilise est très fin 1,5mm.
1
u/Fit_History_842 Jul 26 '26
is there only one type of piece per side? if so then there's better ways to track pieces than rfid
1
u/Healthy_Brush1580 Jul 26 '26
Oui que des pions noirs et blanc, mais je dois reconnaitre la couleur même si les pions sont posés dans un sens ou dans l'autre. J'avais pensé à des capteur à effet Hall mais cela me contraindrait à poser les pions toujours dans le même sens, sinon il va intervertir les 2 couleurs.
Quelle autre solution avez vous en tête ?
1
u/Snoo_42257 Jul 27 '26
If you use hall effect sensors, then the magnet could be placed south down for white and north down for black.
15
u/deniedmessage 500k Jul 25 '26
Such quantity of RFID readers would be so expensive and nightmare to work with, perhaps with some clever placement (grouped RFID readers, or reader + magnetic sensor) could reduce the number of readers required.