@gunrunnerjohn posted:Try them at an angle to the track and they may catch the train and ignore the gaps.
In the datasheet for the HC-SR04 they say that the "Measuring Angle" is 15 degrees. Not sure but I think that may mean you have to be within 15 degrees of perpendicular to the reflecting surface for it to read the reflection. If true, that might limit how far off these can be mounted, but a little more experimenting will tell I guess.
Rod