Looking for suggestions for tracking of 3-4 "& more" garden railway loco's?

Hi, i’m looking for suggestions for simple tracking a garden railway. I looked at rfid & barcodes & might be a bit to complex. Then i thought of somthing like a zigbee door contact. The contact can get a name like “Station 1” & could be mounted in the track & the magnet in the train. This would trip an alarm & would log time & arrival date on a screen, “Great solved” but how do i do this if 3 or 4 trains on the track. Every train would trip it & we would not know which one did the trip. What i need is a magnet on the train with ist own id. Any sugestions?? Thanks

1 Like

A BLE beacon on each train and a Bluetooth proxy at each station.

The basics are covered here: https://youtu.be/-fmBwINdsxQ?si=hEdCS2C7vMIF3gLq

I can recommend these BlueCharm beacons: Bluetooth BLE iBeacon (BC04P-MultiBeacon) – Long Range PHY (300 meters) & Water Resistant with Motion Sensor – Blue Charm Beacons

1 Like

Hi Tom, thanks for that & the links. I’m forgetting BT has a lot better coverage these days & didn’t really look. But certainly worth investigating. :+1:

Bermuda makes it very easy.

Camera is perhaps overkill.
But there are also components to ESP-Home that can detect color, if they are different color.
Your magnet idea could work if you use ESP-Home and have the magnets at slightly different places on the trains.
That could give each of them a different strength reading.
But I doubt it’s a good solution since it needs to be water proof and prone to issues if the magnets move or fall off.

Oddly enough, we experimented with this & you can get the magnets very directional by placing them about 1/4" up a steel tube & it seems to narrow the magnetism feild. .

I just want to see pictures of this “garden railway.” Sounds like a lot of fun!

Bluetooth probably is the right answer, as that should work even if you have multiple trains arriving at 1 station together (e.g. multiple platforms). The reader/scanner should in theory just report both detections.

I had thought multiple contact sensors, so a station and a train would be triggered, and that would work, but I think only if each station has just one platform. So you’d get 2 notifications, 1 to say train x has arrived, and one to say a train has arrived at station x.

Although with anything you’d need to make sure you kept them dry.

Thats the plan, will post some pictures later.

3 Likes

Consider using ESP-NOW and the RC522 RFID detector to sense RFIG tags. The RC522 sensors have about a 1" range, so the detector could be in a waterproof box under the track, and the RFID tag under the train. You could even put RFID tags under each car of the train if you switch them around.

Could probably easily be solved with a row of microswitches under the tracks facing up and a pin on each train that will press one of the switches as it goes by. Simple mechanical process and contact closure. How many trains that could be processed would depend on the width of the switches and width of the tracks. Since the tracks are fixed, the pin location would be quite precise.

I can’t remember what the integration is called but there is one that can give you Bluetooth devices on a map.
That would be really cool to have.

Edit:

I could not contribute to the discussions here in this thread, but, please, I so wanna go off topic and so wanna see those pictures !!!

Welcome!

While the idea of using Bluetooth based triangulation sounds interesting, I wonder if it will give you the level of accuracy to locate a train. Especially with your numerous of what appears to be relatively closely spaced parallel track segments.

I think you can really go down a ‘rabbit hole’ in trying to get a solution that will not yield ‘Addams Family’ level train wrecks :boom::steam_locomotive: . I think that is why PTC in the real world is not easy.

Other than one of existing RFID based solutions that appear to be ‘proven’, but require a lot of physical wire and buck$.

To your magnet switch noodling, one idea that might be not too wiring ugly, lower cost and could be made aesthetic. These off the shelf temperature sensors ( Xiaomi LYWSD03MMC ) can be had for under USD 10 each and if you get the right ones can be ‘augmented’ with a reed or similar switch. This would eliminate the power and wire runs back to a central location (they can use Zigbee or BLE) and possibly much lower cost than RFID solutions. However, there would appear to be no way to get a unique identification of the train ID source of the switch trigger. See links below. This is going down a DIY rabbit hole to save you maybe USD 20 to 40 per sensor node over a RFID wireless path. But not getting the positive ID that RFID solution would gain you, time maths via a LLM might make this work (and long as no one picks up the train and ‘flys’ it, I think the ‘traveling salesman’ routes issues could be maths solved via enough and properly placed reed sensors, ask GPT-5 for placement and maths ideas). And since I’ve not tried this, I am unsure of the responsiveness (would need 1 second response to switch being triggered I am guessing) and battery life with this switch sensing speed.

Good hunting! You know the saying “…differentiated by the price of their toys” :wink:

Yes it will.

They only want station location. With a proxy at (or before) each station and the beacon TX level turned right down low it will work perfectly. Triangulation will not be required as only one proxy will be receiving at a time. That proxy is the location.The beacon battery at this low TX level will also likely last for many years. The app used to program the BlueCharm beacons is very easy to use.

I use this system to locate my phone’s private BLE signal in my house very effectively and to perfectly determine if my garbage bins have been put out or not.

I think it’s actually worth a try to see if it can detect the position.
I mean a five pack of ESP32 is not that expensive.
Place them at a few different places where on the right side, mainly because it’s closer to the house and easier to set up.
No need to place a tag on the actual trains, just lay the wires across the tracks for testing, then walk around with a BLE tag and see if it detects your position.

There’s not much that interfere with the signal so it should work better than indoors I assume.
Even if it doesn’t know which of the parallel tracks it’s on then it’s still pretty cool to see where the trains are, not just on the stations.

Tom, I like your enthusiasm for a BLE solution. However, I remain skeptical. Resolving multiple BLE tag locations at inch (cm) level precision at second time intervals to prevent :boom::steam_locomotive: , convince me. I believe you and I are reading the OP’s requirements differently. After a cup of :coffee:, I am more convinced that the OP’s challenge is a rather tough one to solve at a ‘reasonable’ price and wiring snakes nest. A bit of Googling shows me that either a ESP32 RFID or ESP32 Camera solution has yet been ‘perfected’ for model railroads. And it appears there are some rather dedicated ‘hobbyists’ trying.

Upon reflection, microswitches could easily decode as binary so three switches could track 7 trains.

That is not what they are asking for and not what I am proposing.

They want notification a train is arriving at a station. Not cm precision tracking of each train’s location.

A proxy located before each station would be able to pick up the BLE tag and identify which train is passing by. On the lowest TX power the beacons would only trigger one proxy at a time. There is sufficient space between stations to prevent the tags triggering multiple proxies.

I will defer to you to being more knowledgeable on the OP’s requirements. I hope he is able to get a solution.