Hi James. Thanks for your input.
I’m very experienced with software (although not Arduino), but my hardware experience is limited to very simple circuits, so I’m feeling my way here.
I have an initial bias towards a “break-beam” solution. My rationale is that a break-beam solution is less requiring of calibration. Especially in the outdoors environment, with varying ambient light levels and other complications. It feels like a beam solution can easily remove most of the “noise” by using something like a hood or short PVC tube to localise the input. In contrast, a reflection-based sensor needs to be much more concerned about ambient IR and also whether random objects not in the actual detection zone can also trigger the sensor.
Indoor railroads often place the sensors facing “up” between the rails, using either IR reflection or light sensors. Light sensors are effectively break-beam sensors using the room’s ambient light as the beam source. IR reflection is also less “noisy” indoors, as you can assume a relatively fixed light level.
One concern with break-beams is that for dual-track (or multi-track) arrangements I would need to ensure that the beam covers only one track. This would mean placing nodes between (rather than just outside) the rails. Or I could put the receivers in an overhead gantry and have the emitters shine straight up.
Using reflective IR proximity detection, could I place them close beside a rail and have them detect objects up to 2-3cm away but not 5-6cm away?
The rationale for all of this is to automatically drive signals and protect “blocks” of track from multiple trains. For my design, each block controller needs about 5 each inputs + outputs for block control plus about the same to drive a signal to depict the state of the block. Thus the need for train detection (to know if a block is occupied) and multiple IO ports per signal / block. I can do the software easily enough; I need help getting the signals into the Arduino.
In my design, each signal / block is mostly independent, albeit with some outputs from one signal driving inputs to the previous signal. I’m thinking that each Arduino could manage up to (say) 4 signals / blocks. The number of sensors is greater than the number of blocks, because I plan to try to detect trains anywhere in the block, not just track ingress and exit.
Using some sort of IR / light based technology appeals to me because it can be added to an existing system without needing to interact with the existing track & track power in any way.