The great Folks at the JMRI Users Group at groups.io have made it! Tom Seitz recently posted a bunch of Ardiuno sketches that allow up to eight MFRC522 13.5MHz RFID Readers connected to an Ardiuno Mega to be used as an alternative to a MERG Concentrator.
These RC522 readers are dead cheap, selling for less than 13 Euros for a pack five. The total cost for this RC522 Concentrator totals about 45 Euros including the Mega as compared to the MERG Concentrator’s several hundret Euro initial cost when using the concentrator with eight Sparkfun ID20/ID12/ID2 RFID Readers which sell for ca. 55/48/40 Euros each (not including the 20 Euro yearly membership fee for the MERG Community, which seems to be necessary to get a hold of their concentrators). However, the community is also very generous, by publishing its „e-Book“: Electronics for Model Railways which contains an entire chapter about RFID: Chapter 11 – RFID. Herein the format of the data expected by JMRI is clearly defined:
Concentrator output
The above illustrations and screenshots show the output from a single reader.
Where multiple readers are in use, the output has to indicate not only the tag ID but the
reader that is sending the ID.
This is achieved by amendments to the ID string.
A concentrator can handle 8 readers and it recognise input
1 as ‚A‘, input 2 as ‚B‘, up to input 8 as ‚H‘
The STX character is then replaced by the appropriate
letter.
So, for example, if tag FE4000FF7637 was read from input
4, the beginning of the string is changed from STX
FE4000FF7637 to DFE4000FF7637.
The ETX character at the end of the string is replaced by
the > character.
Now every character has an impact on the screen display; all the characters are printable,
with the exception of the carriage return and line feed.
At one tenth the initial cost the model railroader should of course be ready to assemble the whole system him-/herself. Oh wait, you are required to do the Same with the MERG hardware… I think you realize where I’m heading.
What’s ready to use/test?
For now the Ardiuno sketch for connecting up to eight MFRC522 RFID Readers to one Ardiuno Mega ist available at the JMRI Users Group. And yes, you read correctly, „up to“ means that you can decide to only connect a single reader or any number up to eight to your ardiuno. You can even use other Arduinos, like the UNO or Nano, with the limitation, that the number of pins available allow only for a maximum of seven readers and you would have to map the Pins to your specific hardware.
Also, it needs to be distinguished, that this type of connectivity allows only for sequential reading of the readers. If simultanous reading is of main concern, then the number of available hardware serial interfaces per MCU plus two (SoftwareSerial and NewSoftSerial) determines the number of reader possible per MCU (keep in mind, that USB eats up one hardware serial port).
What’s to expect in the future?
Tom Seitz, who programmed the sketches, stated his vision being to provide a sketch in the future, which will be useable with any reader. So even the ones I tested here – the RDM6300 and GWIOT 7841E – are within the scope of this Project.
What will this site provide for model railroaders?
I will update this article with more information and ressources as they become available.
As soon as my Test Layout becomes operational, I will post tutorial videos, explaining the implementation step by step. So be a little Patient and drop by frequently for more Info.
GitHub Repos
ESP-32 based connection
https://github.com/jerryg2003/MRR-RFID-ESP32
Arduino/USB based connection
https://github.com/TMRCI-DEV1/RFID-Concentrators
Further Reading: RFID4MRR@groups.io
So, that being Said, where is the Break-even-Point? At which Point is a commercial Produkt better suited than a DIY solution?
There are two Major factors involved. Cost and time. Both include losses due to repairs, etc.
A Most cost effective StaRFIsh Rail system consists of a Hub (120,-£), at least one Reader (Quad: 60£) and at least one serial/antenna (4×6£), plus a bunch of CAT5 Patch cables for around 220£. No programming, No Adaption, No hassles.
A system based on RC522 is cheapest at around 3€ a piece (3.3v). Around six Readers can be attached to a single Arduino or ESP32. The total cost Up to this Point with four Readers as above is less than 40 Euros, assuming one out of 5 Readers bought in a bundle might arrive defective.
The repo above gives you out of the box connectivity of three RC522 readers per ESP32 (NodeMCU) board. THis is a great compo, as the readers only draw about 20 mA which is within the specs of the NodeMCU-ESP32 board and this board is 3.3V which is grat for not damaging the readers or needing a more complex setup with level-shifters. Also wiring thre board with 8 wires each to one MCU is manageble. Connectivity to JMRI is via TCP/IP (over WiFi) which is convenient, as the only wiring under the layout would be the power bus for the MCUs. This will probably be my go-to method in the future.
(Updated in October 2023)
JMRI : Getting started with RFID
This relatively recent site is part of the JMRI documentation and walks you through the initial steps. The necessary steps I tried to research for years without success. Not because there was a lot missing in the documentation, but because my understanding of how it all works together was very limited.
With my recently acquired knowledge, I am now able to reliably use a bunch of different RFID readers and get the TAG-IDs of the cars equipped with such tags into JMRI. With the data being stored in the relevant tables within the JMRI ecosystem, the data can be processed within JMRI.
My goals for this winter (2023/2024) are to build the above Switching Layout and install readers on all classification tracks, as well as a few strategic locations to scan incoming or outgoing trains (probably at the entrance/exit of the staging cassette).