Developing Grade Crossings
Part 3 – Detection
My original track design only accounted for block detection and signals.
Grade crossing placement was never in the plan to include gaps and detection.
My grade crossing was very near one of those detection gaps.
Originally, I just used the detection for both blocks to run the crossing signals.
That worked, but reset only occurred once both blocks cleared.
I needed to detect the crossing itself.
Others have used infra-red Arduino obstacle avoidance modules to determine crossing occupancy.
Following that lead, I drilled the holes and placed one module in the crossing.
Some of the rolling stock detected sporadically.
I tried a second module figuring together they would be more reliable.
Still the detection popped in and out as the train passed.
I have in the past successfully made these into beam break sensors across HOn3 track, and since I was reading the sensor with an Arduino just changed the code to look for a HIGH when the beam is broken and therefore a car is present.
I ran multiple tests trying to get the detector to sense grade crossing occupancy.
The avoidance detectors failed to be reliable.
I attributed that failure to the black undersides of locomotives and rolling stock.
A black underbody does not reflect IR effectively.
Perhaps these detectors I used were not as sensitive as others.
I decided to reapply the detector and the sensors as interference detectors.
I planned upon placing the sensors on either side of the track.
I planned to hide the sensors in trackside cabinets.
I started with replacing the detector board sensors with 0.1 PCB headers.
The sensors got twisted pair wires so they could remote from the detector board.
Then where to place the sensors?
I noticed the freight house next to the crossing had a long window.
What a perfect place to hide the dark IR sensor.
In a dark window with line of sight diagonally across the grade crossing.
[Mounted at the proper angle on the freight house floor]
[IR source mounted on a tongue depressor end]
[Aligning sensor and source]
[Overhead view of alignment]
[Track level view with 'bush' installed]
The IR source has a wide beam which made it easy to line up.
I added a furnace filter bush over the IR source and the beam made it through.
Testing proved out the setup and the operation to my satisfaction.
There are a few positives to this arrangement:
1) The sensors are not visible as they were previously mounted in the grade crossing.
2) Placed on a diagonal, there is no dead spot between cars as it would be when mounted below the track.
3) The inverse action (interference vs reflective) is fail-safe. Loss of a sensor reads as occupied.
Now I just need to replace the crossing boards with ones with no holes.
I detect the train approach with the current block detection.
The crossing gates and warning signals activate immediately.
Logic in my JMRI software system determines the approach direction and controls the crossing operation.
Once the train clears the IR sensor, the crossing gates and warning signals deactivate.
The software logic accounts for backing movements.
The software also accounts for the special track arrangement at the depot to the east.
At the depot, trains can meet and pass.
The software logic also accounts for that special case where one train leaves and other proceeds through the crossing.
The crossing system resets once both detection blocks clear.
------------------------
Chapter 3 – Gaps and Blocks