This is a project I probably have time for in a few years time, but I kind of like to already have some thoughts about it ;-)
The project will be a model train + track (of course) with fully automated central train control. For that I need the train control to know where every trains is physically located on the track.
I have weighed some alternatives and tend to favour a system that consists of "substations" detecting trains along the track. These can probably consist of attiny's, probably 861's, I'll see when I get there... The substations will be connected to the central control, probably using i2c or similar.
They will have an IR led and IR photodiode mounted between the rails, looking up and the train will have a bar code on the bottom side. If I choose the train id's clever, I will be able to distinguish the direction the train is moving in, as well, and maybe even the speed (but that's less important).
Has anyone ever tried something similar? Ideas, hints? I think I can make up the software, but it will be a tricky task, if the code is to be read at various speeds.
I have also considered:
- light barrier, simple to implement but no ID
- rfid, simple but way to expensive
- bluetooth, same
- frequency modulated ir from the train, no direction information, simple though
- classic block occupation detection (measure current or resistance between rails), simple but no ID and no direction information