I’m the guy referenced here…the detector consists of 2 tssp4038 IR detectors that work at 38KHZ, and an IR source driven at that frequency.
The way it works is that an Arduino NANO monitors the sensors and can tell the direction of the movement across the sensors, and knows if the count increases or decreases for any block. Obviously, both adjacent blocks need to be informed of the transition, and an individual count is maintained.
The system can detect anything going past the sensors, with the smallest size being detected based on the placement of the detectors, closer equals smaller detection. The detectors were initially at the side of the track, and because of the size if the detection surface, it actually counted trucks as they passed.
My current system uses Fiber Optic cable to link the detectors to the track, and the detectors are mounted close to and just above the railhead. It works flawlessly.
Like ALL my work for model railroad use, it’s all open source/DIY. I’m setting up a web site to sell the bare PCBs if anyone wants them. The complete system including HW & SW is included, but most won’t want to get their own PCBs made, so that’s the reason for the web site.
The system requires soldering, and I’m considering offering pre-soldered PCBs. Every part that can be socketed is socketed, allowing easy installation and troubleshooting/parts replacement.
I’m not in this to make any money, but I certainly don’t want to lose money, so prices will be LOW. Hopefully, I’ll get this all done in the next few months.
I put some video of my prototypes on YouTube. Please ignore the quality of the video. Enjoy" https://www.youtube.com/channel/UCGxniu22N3COHRWq_gfEpsw
I forgot to mention that there are NO modifications required