picardgk

Train Tracking with RFID

Recommended Posts

This is my first experiment with RFID based train tracking. The goal is not just detecting if a train passes by, but also identify the locomotive, possibly even the carriages.

7790205046_b56e4c78bb_z.jpg

This first setup was just for verifying if the RFID reading is even possible in this scenario. Checking if multiple readers interfere with each other and also don't detect trains from the neighboring lanes.​ So I setup three readers with standard track spacing. All of them are power with 5V, but only one of the reader is actually connected to the USB serial adapter (because lack of multiple TTL serial adapters)

7790203796_b365a4ced7_z.jpg

I was us​ing RDM630 based readers with EM4100 RFID tags.

7790202742_5f64a03ca9_z.jpg

The test was successful.

I got the best results if I put the tags on the very bottom of the trains. There is no interference, but the reader does miss tags when the train goes too fast.

7790201560_e7c0d7b30f_z.jpg

7790200268_298b0f9442_z.jpg

Next step will be to add an ATtiny microcontroller for each reader and use a single I2C bus to collect all the sensor information from the layout. The same microcontroller could also handle LED signals and possibly other sensors. I was think adding an optical reflection sensor for the cases when the RFID is missed.

Any ideas are welcome!

Share this post


Link to post
Share on other sites

So what is the response time of the RFID chips? I found out that the motors produce quite a strong magnetic field (enough to detect a train at high speed using a reed sensor) so it might be better to not put the tag under the motor (to prevent interference).

B.t.w. why an attiny? I think an atmega would be better, I am still struggling to get my signals done with attinies. Update: Ah I understand, you use dedicated uC's that makes sense then for costs and size to use attinies.

Share this post


Link to post
Share on other sites

I think that making intelligent layouts with Atmel or Freescale 68k-based microcontrollers is entirely possible. If one were to have a microcontroller embedded into the train's locomotive, a central microcontroller with more storage could store what each locomotive is pulling. When the station knows that a particular train has passed by a reader at some point on the track, it can switch the direction of the points accordingly to match where that particular train must go. I think what you're doing is very cool, and that this should be looked into by the majority of the community.

Share this post


Link to post
Share on other sites

Of course it is possible. Only thing is that it is difficult to get it done with LEGO. I have some uC controlled LEGO trains. I tried it with DCC and 9V trains but the problem is you need to make such an adjustments to the motor that it will likely have an effect on performance. With PF this is much easier of course. I don't see the need to identify cars however, the loc would be fine I think.

B.t.w. a tip: now and then ME Models track might be better if one needs to put electronics between the tracks without modifying the LEGO.

Share this post


Link to post
Share on other sites

Thanks for the feedback.

I was also afraid of the motor magnetic field, but it didn't seem to have effect on these 125Khz RFID tags. Hopefully this will be also case when I switch to DCC with PWM motor signals. Just in case I may follow your advice and move the tags away from the motor.

This RDM630 reader uses 9600baud UART TTL output with about a half second latency once the RFID tag passes. I'm not sure why the big latency, but in the meantime it can start reading the next tag.

I would like to avoid connecting tons of UART cables to the command central, so my plan is to use a single bus (S88 or I2C). This is why the ATtiny chip for each reader (plus the additional free GPIO pins which I can use).

The car identification is only useful when you have a remote controlled decoupling "station" or decoupling built into locomotive like a pushing out an arm (I've seen a MOC on this forum). It would be cool to have programmable train car rearranging or automatically switching locomotives.

Share this post


Link to post
Share on other sites

In this situation it would be helpful to have a tag on each car so that they can be sorted accordingly in "smart yards." This would cause switch engines, with a smaller microcontroller, to go into that particular area of the yard and retrieve the car, then assemble the outgoing train automatically, and finally send the train with its own microcontroller on its way. That'd be pretty cool, no?

Share this post


Link to post
Share on other sites

Of course with a decoupler it would be very useful indeed! Yups the RMD360 is a nice module. I most of the time use mifare tags (because I use them in education as well). I don't know why you experience such a latency. You are just trying to read the ID and no other data?!

The ME Model rails might also be good for a decoupler b.t.w. I haven't tried it yet, but that way you can build between the tracks without having to worry about the sleepers. I made a concept that seems to work well when dry testing: it pulls the buffers + magnets apart.

LEGO_Decoupler_concept.png

Share this post


Link to post
Share on other sites

hmm those are my suppliers as well! guess we will need to wait for more stock!

Share this post


Link to post
Share on other sites

I actually have some ME-Models track I'd like to sell: 6 Double Length, 8 Single Length, 12 Half Length they include Dk BluGray Sleepers. I'd like $70 plus shipping for all of them.

Share this post


Link to post
Share on other sites

I actually have some ME-Models track I'd like to sell: 6 Double Length, 8 Single Length, 12 Half Length they include Dk BluGray Sleepers. I'd like $70 plus shipping for all of them.

Thanks for the offer, but I think I pass.

I realized I spent too much recently :laugh: Amazon.it had a discount on Maersk Train...

Share this post


Link to post
Share on other sites

it very nice :classic:

I have a question

I'm designing a table with multiple RDIF readers

How do you avoid the interference between RFID readers in your application?

Thanks in Advance

Edited by eman_elsayed

Share this post


Link to post
Share on other sites

My project got a little delayed :-)

No fully automated trains yet.

But so far I have not seen RDIF reader interference. These are short range readers and they are always at least 16 studs away from each other.

Although rarely I do have some false tag detection from the neighboring track.

On the other hand the 9V DCC signal on the tracks did interfere with the I2C TTL wires which I use for collecting information from multiple RFID readers.

I'm working on a more robust communication channel now. I will exhibit my train setup in two month at Fanabriques in France.

Share this post


Link to post
Share on other sites

Thanks for your reply

The idea of my application is to design a table with multiple RFIDs reader which allows us to teach the child languages

for example I will ask the child to spell word "House" he will pick up the cubes with letters(H-O-U-S-E) and put them on the table beside each other in that way I need to control the readers

I have read some papers that suggest the following solution

"in order to control multiple RFIDs, you have to make one reader active while the rest will be passive and next time other reader will be active while the rest will be passive and so on to avoid the interference"

the problem that I need to read multiple cubes and they will put close to each other as I explained before

What do think about that? if you have any suggestion please contact me :)

Edited by eman_elsayed

Share this post


Link to post
Share on other sites

Thanks for your reply

The idea of my application is to design a table with multiple RFIDs reader which allows us to teach the child languages

for example I will ask the child to spell word "House" he will pick up the cubes with letters(H-O-U-S-E) and put them on the table beside each other in that way I need to control the readers

I have read some papers that suggest the following solution

"in order to control multiple RFIDs, you have to make one reader active while the rest will be passive and next time other reader will be active while the rest will be passive and so on to avoid the interference"

the problem that I need to read multiple cubes and they will put close to each other as I explained before

What do think about that? if you have any suggestion please contact me :)

Another way might be to have a motorized RFID reader move under the table to read each cube left to right. Have a physical grid on the table that cubes are place in known position points.

Share this post


Link to post
Share on other sites

Hi,

The car identification is only useful when you have a remote controlled decoupling "station" or decoupling built into locomotive like a pushing out an arm (I've seen a MOC on this forum). It would be cool to have programmable train car rearranging or automatically switching locomotives.

There are more useful applications to RFID-tagged cars. E.g. identifying all cars can be used to emulate wheel counters: With 2 RFID-Reader on the track, you can check, whether each car that has entered the track also has left it - thus finding out whether the train has fully cleared the track. This might help increase safety on automated layouts dramatically. You can also use this to automatically operate warning lights and fences at level crossings.

Regards

Xris

Share this post


Link to post
Share on other sites

Another way might be to have a motorized RFID reader move under the table to read each cube left to right. Have a physical grid on the table that cubes are place in known position points.

Thanks

I will try

Share this post


Link to post
Share on other sites

Sorry for bumping this topic ....

I am testing a setup with an RFID reader and RFID chip. I am using 9V train equipment. Issue I see is the speed of the train. Till around 30% of the speed the RFID reader signals the passing chip, however when I increase the speed there is less accuracy. Is there any experience in the community with this?
I am happy to share some more info and what material I am using, but am just wondering for now if I am the only one experimenting.

I did do a lot of research in the modeltrain world, however they run their trains at a lower speed then a normal lego train so they do not experience this issue.

Share this post


Link to post
Share on other sites

Passive RFID chips need time to energize.  Would larger or multiple antennas work?  Maybe another option to use active RFID chips which are better for high speed applications like electronic toll roads. 

 

Share this post


Link to post
Share on other sites

What about a "speed restriction" through your section of track?   You could put a Slow order flag by the track to explain it then wire that section of track separately with a resistor in line so that you don't have to physically slow the train.   

Also in reading I saw issues with DC interference...  Shielding the wires may solve some of this noise.   (foil tape hooked to ground) 

The thing to remember even about the active reader is they can't read if it's moving too fast as well (although they have a better read time)

Share this post


Link to post
Share on other sites
12 hours ago, dr_spock said:

Passive RFID chips need time to energize.  Would larger or multiple antennas work?  Maybe another option to use active RFID chips which are better for high speed applications like electronic toll roads. 

 

Agreed, however I do not want to make adjustments to my train motors and use tags that require power from the train.

1 hour ago, Roadmonkeytj said:

What about a "speed restriction" through your section of track?   You could put a Slow order flag by the track to explain it then wire that section of track separately with a resistor in line so that you don't have to physically slow the train.   

Also in reading I saw issues with DC interference...  Shielding the wires may solve some of this noise.   (foil tape hooked to ground) 

The thing to remember even about the active reader is they can't read if it's moving too fast as well (although they have a better read time)

Yeah this is the alternative, however this means more work as I have to isolate track for this. Also it will lead to shortcut issues, maybe this sounds a bit strange but the track power is controlled via an arduino instead of the regular 9V trafo. When a train motor has wheels on both sides of the isolation point this will cause a shortcut and makes the arduino to mailfunction. Also this can be solved, but I would rather have a stable reading so that I can spend time on building Lego instead of finding solutions for arduino issues :-)

Edited by aawsum

Share this post


Link to post
Share on other sites
54 minutes ago, aawsum said:

Agreed, however I do not want to make adjustments to my train motors and use tags that require power from the train.

Yeah this is the alternative, however this means more work as I have to isolate track for this. Also it will lead to shortcut issues, maybe this sounds a bit strange but the track power is controlled via an arduino instead of the regular 9V trafo. When a train motor has wheels on both sides of the isolation point this will cause a shortcut and makes the arduino to mailfunction. Also this can be solved, but I would rather have a stable reading so that I can spend time on building Lego instead of finding solutions for arduino issues :-)

Add a super capacitor then have a section of unpowered track either side of the slow zone.   Or install a prox detector the program looks for to slow the train. 

Share this post


Link to post
Share on other sites

Yeah I understand slowing the train is a way out, however I was more searching for methods where I could maintain the speed :-)

Share this post


Link to post
Share on other sites

Dear All,

in beginning 2018 i startet also to build up a train traking system by use of RFID. I also posponed my action however during my testing i have also seen  the behaviour listed in previous reports with the cheap rdm6300.

At the end i choose  a larger antenna to get a higher range. Together with an discrete 125kHz detekor ( own design)  i was able to extend to a range of approximatly 6 cm (on single antennas) However this leads is the fact  i did not decode the Tag ID itself, but this allows me to operate on higher train speed. Since i do not need the Train ID, it works fine for me.

Antenna side by side operation will disturbe each single system.To allow operating antenna side by side (see picture) the 125kHz Signal need to be in sync, therefore i use an external 125kHz Signal as master. 

I did not notice any major impact in case the tag is placed below a 9V or 12V motor(i use 8khz  PWM to control the motor).

regards

rfid.gif

Share this post


Link to post
Share on other sites

Did you create the antenna yourself? How did you calculate the amount of turns (length of wire) to use?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.