What do I need to setup crossing detection? I have the signals but I don't know how to get them to work only when the train goes by.
you need some form of detection that the train in approaching the crossing.
a block detector, that detects current flowing thru the track due to a locomotive, lamps or resistance, is one approach that has a single output that turns on/off you signals
optical detectors along with some logic can be located some distance on either side of the crossing to separately turn on and then off the signal
there are various commercial products
greg - Philadelphia & Reading / Reading
I have a couple of Rob Paisley circuits which use visible light detectors between the rails. I have one that operates a simple pair of crossing flashers on a rural road, and another that operates flashers and an operating crossing gate, which requires a Tortoise turnout motor. The circuits handle the alternate flashing of the lights, and can also operate a warning bell, if desired.
At the time, I was trying to be budget-conscious. I did buy the circuits pre-assembled and tested. These have worked fine for years.
I got my crossing flashers from Oregon Rail Supply and my crossing gates from NJ International.
It takes an iron man to play with a toy iron horse.
I use Logic Rails IR version. https://www.logicrailtech.com/
ba&prrI use Logic Rails IR version.
Second that. Although my first installation uses photocells as IR wasn't an option then. Mine is on a double-track main and two Grade Crossing Pro boards are linked to operate one pair of signals.
Here are the instructions to give you an idea of what to expect.
https://www.logicrailtech.com/GCP2%20instructions.pdf
Mine has been functioning for years, trouble-free.
Good Luck, Ed
Tony Train Exchange has the Cross Hare; a complete railroad crossing kit which includes control board, optic sensors, and speaker for sound:
Here's one that is pretty easy to use and works 2 track bi-directional. It's their #501 Crossing Signal Circuit. I have one on my layout..
https://eastcoastcircuits.com/Circuits
Happy with trains What do I need to setup crossing detection? I have the signals but I don't know how to get them to work only when the train goes by.
I use Tomar Industries Crossing Signals without crossing gates. A pair of Circuitron Opto-Sensors, embedded between the ties, trigger the crossing signals On and Off. A Circuitron detection board is used to control the red LED lights on the crossing signals, while a Circuitron Flasher board alternates the flashing red lights.The entire setup is powered by a DC power source.
Rich
Alton Junction
Super simpleAs I'm always researching for new ideas and in doing so I found a very slick IR detector module, the Arduino FC-51. It is the reflective type so many are needed to obtain block occupation but the cost of the FC-1 is in the ballpark at 49¢ each, 50 for $20, 100 for $38 and no special circuits, no Arduino needed for detection or emitter modulation, simple switched ground output when active.I mount them vertical with the LEDs pointing toward the track at coupler height in hidden track areas. Between the ties where they could be seen.Mel My Model Railroad http://melvineperry.blogspot.com/ Bakersfield, California Turned 84 last July, aging is definitely not for wimps.