Tracking Object Position

Hello,
I need to track the positions of the model trains that I have for signalization and automation. I've considered using CNY70s but putting them under 20~ rails then connecting them seemed a bit hard so I thought if I put a Bluetooth beacon on the train and use 2 receivers, 2 because I know the boundaries of the track and don't need the 3rd dimension, that will estimate the position of the train with RSSI values, I think I can use HC05 and 06, and since the environment is controlled, no object will interfere with the signal except a tunnel which I can find
while processing the data. Is that possible? If not then what can I do? I will only use Arduinos to gather and send the data to a faster computer like Raspberry Pi and process the data there.
I haven't considered GPS since I'm going to use this indoors and need precise, 5-10cm, measurements.
-I tested HC-SR04s but they didn't work and they are too big for the trains.
-I don't have a device or knowledge to make a real time image processing application.
Thanks.

I doubt bluetooth solution will work well. If the trains have a brain they may read some beacon to get rough position (i.e. NFC tags/IR beacons under tracks) and use encoders on wheels to estimate distance from last beacon. Than use nRF or some other link to report the position.

Smajdalf:
I doubt bluetooth solution will work well. If the trains have a brain they may read some beacon to get rough position (i.e. NFC tags/IR beacons under tracks) and use encoders on wheels to estimate distance from last beacon. Than use nRF or some other link to report the position.

Unfortunately they don’t have any processing nor transmitting device. Can I make a miniature GPS with nRFs, antenna 1 sends a packet and starts timer, train nRF1 receives and immediately transmits back a package and when antenna 1 receives the package it stops the timer and calculates the distance (I’ll figure it out somehow) and antenna 2 does the same thing with the train nRF2 at the same time with antenna 1, the nRFs are connected to different Arduinos or smaller MPUs, cost doesn’t matter. Is that viable?
Also nRF uses 2.4GHz band for communication and the train model is in front of the wireless modem in my house, I can manually select a channel for my modem and also my neighbors (heh), will that prevent channel conflicting?

Maybe a camera on the ceiling and some image processing would give you the the position information you want, but that would not be something you would use an Arduino for.

johnwasser:
Maybe a camera on the ceiling and some image processing would give you the the position information you want, but that would not be something you would use an Arduino for.

Sorry, I forgot to add that. I have no device or knowledge about image processing. It's probably plan Z. Thanks.

AKKaygin:
Can I make a miniature GPS with nRFs, antenna 1 sends a packet and starts timer, train nRF1 receives and immediately transmits back a package and when antenna 1 receives the package it stops the timer and calculates the distance (I'll figure it out somehow) and antenna 2 does the same thing with the train nRF2 at the same time with antenna 1, the nRFs are connected to different Arduinos or smaller MPUs, cost doesn't matter. Is that viable?

5cm accuracy would require using a timer capable of resolving down to around 0.0002uS, but with plenty of money to spend on the project, it ought not to be a problem.

Or, you can do like the rest of the RR modelling community does.
Put sensors on the layout at the locations there you need to trigger the signal or automated event.

I agree with @vinceherman.

I use Light Dependent Resistors (LDRs) under the track to locate my trains. The wiring of LDRs is simpler than reflective optical sensors because they just need two wires. However the LDRs do need light falling on them but with a high value (100k?) resistor as the other part of the voltage divider they seem to work in a wide range of light. Also, I use the LDRs to provide a digital input to my Arduinos.

If you want to use reflective sensors and if you live in the UK the price of the Megapoints infra red block detectors seems attractive

...R

I would use one of these, they look like they would sit nicely under a track and detect the train going over the top.
https://uk.farnell.com/osram-opto-semiconductors/sfh-9206/reflective-interrupter-0-05a-5mm/dp/2981800RL
When they are back in stock of course.

Grumpy_Mike:
I would use one of these, they look like they would sit nicely under a track

I suspect the 5mm range may not be enough.

...R

Grumpy_Mike:
I would use one of these, they look like they would sit nicely under a track and detect the train going over the top.
https://uk.farnell.com/osram-opto-semiconductors/sfh-9206/reflective-interrupter-0-05a-5mm/dp/2981800RL
When they are back in stock of course.

Isn’t that very much like the CNY70 reflective sensor that the OP decided not to use because of the need to run wires to 20-odd positions all over the track? I suspect they would have the same issue.

I suspect they would have the same issue.

He would but he is just being a wuss about this. I said "if it were me" and that is what I would do.