So there's many ways to do block occupancy sensors and each has their own interesting limitations. I've been looking at options for awhile and came up with this idea. First a 4 line recap of other approaches and the issues that the community is already aware of:
-->Insulated rails are relatively easy, but hurt the ability to get good grounds throughout a large layout, especially if you have a lot of different blocks. Legacy and DCS performance can suffer if the layout is chopped up into too many sections.
-->Current sensing with a hall sensor or similar only sees the locomotive or passenger cars if they draw meaningful current.
--> Magnetic sensors are complicated to mount and struggle on small plastic trains and small plastic rolling stock.
--> Optically reflective struggles to see very dark locomotives, and optical beams are tough to mount. The IR sensors get dirty and take time to align.
Idea:
So I was thinking about the other post a bit more and thought maybe we could exploit the way the legacy signal propagates to do block occupancy in a semi-parasitic way. The legacy signal is a ~450KHz RF carrier between the layout 3 rails and the earth ground, meaning it's already everywhere in a legacy equipped layout. When a train (stock, locomotive, ... whatever) goes over a section of track it disturbs the electric field radiating out of the track.
--> So the idea is why don't we use a very loosely capacitively coupled electrode near the track to sense disturbances in the legacy/TMCC electric field and determine block occupancy.
Design:
For my test I had a 8" strip of 14 gauge wire run in parallel between the center and outer rails. The wire does not connect to the layout at all, it's just physically nearby allowing it to weakly couple to the legacy/tmcc signal already present.
When a train goes over this section, the amount of capacitive coupling carrying the legacy signal from the track to this little strip of wire changes, and so we have a means for detection. Of course the coupling is weak so we need amplification and a few other things. Here is the test circuit I drew up to try this idea out.
It's pretty straight-forward. An OP (opamp) gets you the high impedance input so the legacy signal can couple onto the input easily. I used a single-ended LM358 opamp. Since it's single-ended, input bias is needed, but the impedance needs to be high for weak coupling, so some 10M resistors go there at point A to establish the input DC conditions. The waveform at A is here (taken with a high-Z probe):
As expected it's weakly coupled to a high impedance, so it's small and noisy. Note the first stage OP doesn't have much gain at 450KHz, really it's just there to maintain a high input impedance to support the weak coupling. From there it's a BJT gain stage to get useful signal swings. I just used whatever was in the bottom of my drawer (probably a 2n2222a). Whatever you go with try to keep the B>100 so you have decent gain. An LC tank for the load network makes it frequency selective enough to keep out all the out of band noise from the OP output. We're just doing detection so it doesn't have to be a super linear amplifier, or have super high Q-factor. Tying the emitter to the ground is good enough, no need to make it a degenerative stage. Waveform at the output is B:
For the last stage we just do an envelope detector (1n4148 or similar) to turn it into a DC voltage at point C. After the detector and smoothing cap, the waveform is of course pretty DC looking:
For a demo I just have a comparator check this DC level against a trim-pot and turning the output on and off (just used an LED).
Quick Breadboard Test:
Here is a test with a car that's almost completely plastic except the wheels. The trucks, car bottom, and body are all plastic. Only the axles and flanges are metal. Train comes, LED goes on. Train goes, LED goes off. Seems to work.
Summary:
So for those with a Legacy/TMCC layout that want block sensors this is a good option. It's very simple to install, doesn't need alignment, doesn't care about getting dirty and really isn't that expensive. It's also not connected to the layout electrically (except through weak field coupling) so it won't effect any of the control systems (legacy,tmcc,DCS...). Also, it's about $6 of parts.