Jump to content

An Introduction to RFID


Recommended Posts

  • RMweb Gold

This article was written in 2006 and things have moved on a little, chiefly prices in an upward direction. MERG (www.merg,org.uk) now have kits available for readers and a board than can connect 8 readers to a single RS232 port - but only for members. The basic information is still valid and may help someone.


Technology seems to move on at an ever increasing pace and is now even making its presence felt in the world of model railways with such developments as DCC, LEDs and even on-board TV cameras. Gradually all those ???wouldn??™t it be nice if??¦??? ideas are becoming reality. Wouldn??™t it be nice to control more than one locomotive on a track??¦ Done. Wouldn??™t it be nice to have sound??¦ Work in progress. Wouldn??™t it be nice to have detailed models that run well??¦ Work in progress. Wouldn??™t it be nice to be able to identify stock automatically??¦


Now why would you want to do that? Well, if you could identify which locomotive, wagon or coach was in a certain place it opens up a whole lot of possibilities. Imagine a model hump marshalling yard that automatically sorts the wagons. How about an information screen that tells watchers at an exhibition about the locomotives that are passing in front of them? How about a system that identifies the DCC addresses of the locomotives hiding in your fiddle yard? The only problem is how do you identify different items of rolling stock easily, reliably and without spending a fortune?


Modellers in the US are often ahead of us in the use of technology. In the 1970s Bruce Chubb suggested that barcodes under the rolling stock could be read by devices between the rails and used for identification. More recently Fleischmann have introduced a system that uses an IR (infra-red) transmitter in locomotives and between the tracks receivers to provide this information. Both these systems are feasible but suffer from problems. As anyone who has ever waited in a supermarket queue will testify bar code readers don??™t work first time, every time. It can take several attempts to read a bar code and dirt or obstructions stop the system working. It is reliant on the sensor having an unobstructed view of the bar code. The Fleischmann system uses a pulsed IR beam that carries a digital number that is unique to the transmitter. Once again it is reliant on the receiver having an unobstructed view of the transmitter so dirt and obstructions can stop the system working. The transmitter needs power and so is normally fitted into a DCC fitted locomotive. If a transmitter needs to be fitted into coach or wagon then that will need power pick ups too.


Fortunately there is an off the shelf technology that can do the job better. It is called RFID (Radio Frequency Identification). The technology has been around for a number of years and is now in widespread use. This means that the problems have been ironed out and prices have fallen. It is used for everything from smart cards to tags that identify lost pets. The system consists of a tag, which is a small electronic circuit, and a reader. When a tag passes close to a reader it picks up power from the reader by a process called induction and transmits its unique number. The reader receives this number and passes it on, usually to a computer. The beauty of the system is that it is compact, uses radio waves and so is not reliant on the tag being visible from the receiver, is impervious to dirt and requires no power supply to the tag.


I purchased an evaluation set and was impressed at how simple and easy to use the technology is. The tags come in a variety of styles but the most useful for modellers will be the ???World Tag??™, a small flat disc and glass tubes. The World Tag discs are 20mm or 30mm in diameter and 2.1mm thick. The glass tubes are 12mm long and 2.12mm in diameter or 34mm long and 4mm in diameter. Both are easy to conceal in the underframe of most items of 4mm scale or larger rolling stock. Subject to the range of the reader the tags can be inside the rolling stock but bear in mind that metal may block the radio signal. The tags cost from around 84p to ??2.58 each. The readers come in small black plastic packages 26 mm x 25mm wide and 7mm deep. They are available with the radio antenna built in or with a separate 36mm square antenna. Prices are around ??20. The readers have a range of about 10cm for the larger tags and so can be mounted underneath the baseboard without any problem. Alternatively you can mount them directly under the track and use the smallest tags.


In my test system I mounted a 20mm World Tag and a 34mm glass tube underneath two cars of a Lima DMU. The reader was mounted underneath a Sundelea topped baseboard. The reader was connected to a computer??™s serial port and then the DMU was run backwards and forwards over the reader. I didn??™t manage to get the reader to miss a reading, or get one wrong, even at absurdly high speeds so the system appears to be pretty foolproof. Using the 12mm glass tags I found it necessary to mount the reader directly under the track to obtain a reliable reading. This would be an advantage if you had two or more parallel tracks as the limited range would ensure that trains on adjacent tracks did not trigger the reader. For scales larger than 4mm you will need to use the larger tags.


The readers can be connected to the standard RS232 serial ports found on most computers. If you need a number of readers on your layout then you will need to install more serial ports on your computer. The best way to do this would be to buy a special card with four ports. These are quite expensive when new, usually over ??100, but can usually be picked up far more cheaply on the auction site eBay. (Note - See opening comments, MERG can supply a cheap kit to connect up to 8 readers). Connecting the readers up is well within the capability of anyone who can solder wires to pieces of rail. There are two power leads, three serial signal leads and an optional LED to show that it is operating. The reader needs a 5 Volt power supply.





Left to right: 34mm Glass Tag, 12mm Glass Tag, 20mm World Tag Disc





A 12mm glass tag fixed to the chassis of a venerable Hornby Pannier Tank. The white tape is so that the tag will show up on the photograph. As you can see, installing the tag is simplicity itself.




Selction of tags tested with ID-12 reader using its internal antenna

34mm long glass tag - 4mm diameter - Vertical read range >60mm - Horizontak read range 25mm

12mm long glass tag - 2.12mm diameter - Vertical read range 13mm - Horizontal read range 15mm

20mm diameter World Tag Disc - 2.1mm thick - Vertical read reange > 60mm - Horizontal 55mm



The RFID reader (bottom left) doesn??™t require much in the way of extra components to get it to work. Even the LED and switch are optional.



Example Circuit Using ID-12 Reader


R1 ??“ 1K resistor

D2 ??“ LED ??“ indicates that reader is on

On a 9 pin D connector (socket) Tx should be connected to pin2 and GND to pin 5.

The 5V supply can either come from a suitable regulated power supply or from 4 AAA batteries connected in series. The evaluation kit came with batteries so the slightly higher voltage must be acceptable.


The RS-232 data is sent as 8 data bits, 1 stop bit with no parity at 9600 baud.[


Data read from six different tags.

(Hexadecimal on the left, ASCII on the right)

02 30 34 31 32 30 33 45 35 31 43 45 43 0D 0A 03 .041203E51CEC...


02 30 34 31 32 30 34 32 37 31 46 32 41 0D 0A 03 .041204271F2A...


02 30 34 31 35 31 39 45 37 42 41 35 35 0D 0A 03 .041519E7BA55...


02 46 45 34 30 30 30 31 34 32 42 38 31 0D 0A 03 .FE4000142B81...


02 46 45 34 30 30 30 35 35 37 36 39 44 0D 0A 03 .FE400055769D...


02 30 34 31 33 32 37 36 45 37 31 32 46 0D 0A 03 .0413276E712F...


Data is in ASCII format. First character (02h) marks the start of transmission. Characters 2 to 11 are the tag number (0413276E71 on the last line). Characters 12-13 (2F on the last line) are check digits used to check if the data was received correctly and the last three mark the end of the message. The tag number is unique with, or without, the check digits so it is up to you if you wish to include them in your processing.


You will need to write, or get someone else to write, a computer program to make use of the data. If you are not happy with computer programming it is normally quite easy to find someone who is, many teenagers would be happy to help out either as part of a school project or in exchange for a small payment.



Visual Basic Program Code Fragments To Read RFID Tag Number From COM1


Dim xTemp As String



xTemp = ReceiveSerialData() ???Read tag data from COM1




Function ReceiveSerialData() As String


' Receive strings from a serial port.


Dim returnStr As String = ""


Dim Incoming As String


Using com1 As IO.Ports.SerialPort = _


My.Computer.Ports.OpenSerialPort("COM1") ???Open COM1


Incoming = com1.ReadLine() ???Read COM1 data


If Len(Incoming) > 10 Then


Incoming = Mid$(Incoming, 2, 10) ???Set Incoming to tag number




Incoming = "" ???Clear Incoming


....End If


returnStr &= Incoming


End Using


Return returnStr


End Function


End Class





The tags and readers can be purchased from:


Mannings (Southport) Limited, Units 1-5, Russell Road, Southport, PR9 7SY

Tel: 01704 538202 Fax: 01704 514713


Or on-line at: www.rfidshop.com[


If you are inspired to try RFID but are frightened by the thought of blazing a technological trail there are two commercially available systems.

One is distributed by LDT of Germany www.ldt-infocenter.com. The readers (part number COL-10) cost around 77?‚¬ each and the RS-232 interface unit (INTER-10) which can handle up to 99 readers costs about 140?‚¬. South West Digital (www.southwestdigital.co.uk) are the UK agents for LDT but do not carry the RFID range. The other is produced by Digitrax and consists of readers (RX-4) connected to occupancy detectors (BDL-168) which feed information back using Digitrax??™s LocoNet. Each RX-4 (priced around ??34) consists of four readers and 8 readers can be connected to each BDL-168 (priced around ??110). Of course you also need a Digitrax DCC system to run the LocoNet. At least these items are readily available in the UK and are listed by Sunningwell Command Control Ltd on their website (www.scc4dcc.co.uk). More information on how this system works can be found on the Digitrax website (www.digitrax.com).


Example Use: DCC address recorder

Whilst DCC has many advantages and you can work out various schemes to determine a locomotive??™s DCC address from its number there can be problems in identifying locomotives from time to time. If a locomotive is hidden at the back of the engine shed or in the depths of your fiddle yard then it can be a matter of trial and error to get the right address. Similarly if you have a number of DMUs, telling them apart from a distance can be a problem. By placing a RFID tags on your locomotives, a reader at the entrance to the fiddle yard and feedback from the point motors (using DCC or separate hardware) you could create a system that logs each arriving loco and the line on which it is stored. When it is time for the train to reappear you just look it up on the list and key in the appropriate address. Given that redundant PCs can be picked up at little or no cost this is not such an extravagant scheme as you might think.



Example use: An Exhibition Information System



A locomotive identification system could display information like this for people watching your layout.


You might be able to tell a 4mm scale Grange from a Hall from the other side of an exhibition hall but many of the people looking at your layout cannot. RFID could be easily used to give information about the locomotives seen on a typical double track tail-chaser layout.

A reader would be installed under the track at the exit from, and entrance to, the fiddle yards. Each locomotive would have a tag mounted underneath the chassis. The readers would be connected to a computer with a screen to display information for people viewing the layout. The screen would be divided into two sections, one for up and one for down trains. As a locomotive leaves the fiddle yard its tag number is sent to the computer. The computer looks up the locomotive??™s details and displays them on the appropriate side of the screen. This screen could display a picture of the locomotive (facing the correct way), its type and any other information deemed of interest. When the locomotive reaches the fiddle yard again its tag number is passed to the computer and the information is taken off the screen. The system would ignore locomotives that are not fitted with tags. You could even give viewers spotting lists so that they can cross off the locomotives that they have seen!


The Science Bit: How RFID Works



This type of RFID tag has been used for years to track everything from cows to airline luggage. There are three parts to a typical inductively coupled RFID tag:

Silicon microprocessor - These chips vary in size depending on their purpose

Metal coil - Wound into a circular pattern on the transponder, this coil acts as the tag's antenna. The tag transmits signals to the reader, with read distance determined by the size of the antenna

Encapsulating material - glass or plastic material that wraps around the tag.

Inductive RFID tags are powered by the magnetic field generated by the reader. The tag's antenna picks up the magnetic energy, and the tag communicates with the reader. Data is transmitted back to the reader, which directs it to the host computer.

Link to post
Share on other sites

  • 2 weeks later...
  • RMweb Gold

Interesting to see the price and size of readers now approaching something pracaticable. This is the same technology as the chipped wheelie bins in Ireland where the refuse truck reads which bin is being emptied and is used for invoicing and other bin management purposes.


I look forward to trying out the system when my layout is ready.

Link to post
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...