A crossing gate that drops after the locomotive reaches the road looks worse than a fixed gate. The useful part of an automatic circuit is advance detection: it starts the warning early enough for the lamps to flash and the arms to lower, then keeps them down until the last car clears.
This build uses an Azatrax MRX3 controller, four paired infrared (IR) sensors, two common-anode LED crossing signals, and two servo-driven HO gates. It suits one track with trains running in either direction. The controller handles the flashing and gate sequence; you build and adjust the detection, lighting, and mechanical connections. Expect a moderate job taking roughly half a day, with more time if the gate linkages need fine adjustment. The IR sensors work without connecting to the rails, so the approach is the same for DC and DCC control.
Tools and parts
- Azatrax MRX3 controller and four compatible IR emitter-and-receiver sensor pairs
- Two HO crossing signals with operating gate arms and common-anode LED lamps; check whether their leads already include resistors
- Two small analog servos, mounting brackets, servo horns, and approximately 0.015- or 0.020-inch music wire for the gate linkages
- Regulated 12 V DC plug-in supply rated for at least 600 mA, as specified for an MRX3 installation with operating gates
- If the signals lack resistors: ¼-watt resistors in the controller manual’s 500–1,500-ohm range
- Small screwdriver, drill and bits, hobby knife, wire stripper, ruler, masking tape, and labels for the sensor leads
Check the gate maker’s instructions before buying servos. A gate needs a freely moving arm and a workable actuating point; a detailed but fixed crossing signal won’t become an operating one just by adding a motor. The MRX3 installation guide is the wiring reference for the terminal names and servo-setting procedure below.
1. Mark the four detection points
Lay out the sensors in this order along the track:
Approach 1 → crossing-side 3 → road → crossing-side 4 → approach 6
Sensor 1 starts a warning for a train arriving from the left; sensor 6 does the same from the right. Place sensors 3 and 4 close to their respective sides of the road, but outside the pavement and beyond the gate mechanisms. They tell the controller that the train has reached the crossing area. The lamps remain active while a train occupies either of those detection points and turn off after it clears both.
Don’t choose the outer sensor positions by eye alone. Run the fastest train that uses the line and time its trip from the proposed approach sensor to the road. That interval must cover the warning you want before the gates move, the full descent, and some margin with the arms down. For example, a train moving 5 inches per second takes six seconds to cover 30 inches. If the gate isn’t down comfortably before the locomotive arrives, move the approach sensor farther out or increase gate speed. Test from both directions rather than assuming equal distances will produce equal results.
There’s a limit at the slow end, too: in this four-sensor arrangement, the MRX3 can end an approach warning if the train takes more than 30 seconds to reach the near-crossing sensor. A station stop, slow switching move, or reversal in that stretch calls for the maker’s five- or six-sensor arrangement instead.
2. Install and align the sensor pairs
Choose one sensing method for each location. An across-track pair puts the IR emitter on one side and its receiver on the other; a train breaks the beam. Angling that beam slightly along the track gives it a longer detection zone and helps bridge gaps between cars. Reflective sensing puts both parts in the roadbed, aimed so light bounces off the underside of rolling stock. It hides the hardware better, but needs careful adjustment for the different cars that will pass over it.
For a first installation, across-track sensing is easier to inspect and realign if there’s room beside the right-of-way. Temporarily tape each pair in place before drilling. Keep the beam low enough for your shortest and most open-bottomed cars to interrupt it, but clear of rails and wheel flanges. Aim the receiver away from a sunny window or strong room light. If you choose reflective sensing in HO, angle the emitter and receiver toward the underside of the train rather than pointing them straight up.
Switch off layout power before drilling or cutting near the track. Check beneath the roadbed for feeder wires and switch-machine linkages, and keep the bit away from the rails. Don’t ballast over a lens: protect it during scenery work and uncover it when the glue dries. Azatrax’s IR detector installation guidance shows both mounting methods and recommends routing sensor leads away from DCC bus wiring.
3. Mount the gates and their linkages
Set the crossing signals where their arms block the approaching road lanes without fouling the train’s clearance envelope. Before fastening anything permanently, roll the widest locomotive and car through the crossing with the gates up and down. If the road surface still needs work, finish the track and roadbed alignment around the crossing before fixing the signal bases.
Mount one servo beneath each gate, where its horn can pull or push a music-wire linkage through the layout. A small hairpin bend in the wire gives you room for fine adjustment. Connect to an actuating point as far from the gate arm’s pivot as the model permits: a connection close to the pivot needs more force and makes smooth movement harder. Leave the wire out of the servo horn until the motor has been centered in Step 6. Azatrax’s gate-mounting examples illustrate the leverage and wire-bend arrangement.
Wear eye protection when cutting music wire; the trimmed end can spring away. Keep fingers clear of the drill bit, and don’t force a stiff gate arm with the servo. Free the mechanism first.
4. Wire the four sensors to the controller
Label both leads of each emitter-and-receiver pair before they disappear under the layout. On the MRX3, connect the pairs at positions 1, 3, 4, and 6 to their matching numbered K and F terminals. Leave positions 2 and 5 unused for this single-track, four-sensor setup. Each emitter must face the receiver wired to the same numbered position—not the receiver at the next sensor down the line.
For the supplied sensor leads, the emitter’s red lead goes to its numbered K terminal and the receiver’s blue lead to the corresponding F terminal. The remaining white and yellow leads select across-track or reflective operation through the board’s X and R terminals. Follow the matching diagram in the MRX3 guide; swapping those leads changes how the detector interprets the light. Don’t assume a generic IR module has the same wiring.
Tug each inserted wire gently to catch a loose terminal connection now. Keep the leads labeled and accessible: diagnosing an intermittent sensor is much easier when you can tell pair 3 from pair 4 beneath the layout.
5. Connect the flashing lamps
With the supply unplugged, connect the crossing signals’ common-positive lead to Rtn. Connect the lamps that should flash together on one side of each signal to L, and the alternate lamps to R. If the heads flash in the opposite left-right pattern from the one you want, swap the L and R groups.
Check the signal maker’s wiring before connecting it. The MRX3’s LED outputs require common-anode signals, and LED lamps need current-limiting resistors. If the signals have no built-in resistors, install them as shown in the controller guide; don’t connect bare LEDs directly to the outputs. Keep signal wires on L, R, and Rtn, not on a track-power terminal or another layout common. Power should remain off whenever you change these connections.
6. Connect and center the servos
Plug the two gate servos into the MRX3’s primary PRI servo headers. With power off, check each connector’s orientation against the board markings: the black or brown lead aligns with B, and the white or yellow signal lead with W-Y. Never push a connector on while the board is powered. Connect the regulated supply to P1 and P2; do not connect the gates to the DCC track bus or open a mains-powered supply to adapt its wiring.
Center the servos using the guide’s Rs-to-C startup procedure before attaching the linkages. With each gate supported halfway through its travel, fit the wire to a hole near the servo shaft. Remove the support and check that the arm can move through its full range without the wire catching or the servo straining. Only then secure the servo brackets and gate bases.
7. Set the gate travel and speed
Use the MRX3’s servo set button and gate adjuster to establish each servo’s down and up positions. Set the down stop so the arm is level across the road, not pressing hard against its mechanism. Set the up stop so the arm clears road traffic and stays within the signal’s intended travel. If the adjuster cannot reach a position cleanly, change the linkage geometry rather than forcing the servo past its stop.
For two gates blocking approaching traffic, select the controller’s two-quadrant gate setting, then adjust its up-and-down speed. Don’t leave the adjuster at its central none setting, which disables gate operation. Run the fastest train again and compare its arrival with the end of gate descent. Move the outer sensor if needed; gate speed alone cannot make an approach warning longer. The controller’s speed setting and servo end-point procedure are separate adjustments, so recheck speed after setting the end points.
Prove the sequence before adding scenery
Run a short locomotive, a long train, and the rolling stock with the most open space beneath it through the crossing in both directions. A successful pass looks like this: the outer sensor triggers alternating red lamps; both gates lower before the locomotive reaches the road; the lamps stay on and the gates stay down through the last car; both gates rise after the train clears the crossing-side sensors. Watch the controller’s numbered yellow sensor LEDs during each run. They show which detector actually sees the train, making them more useful for diagnosis than the gate arms alone.
If the gates lower late, increase the approach distance and retest at the fastest operating speed. If the warning quits before a slow train reaches the road, check the 30-second approach limit and use more detection points for that operating pattern. If the gates rise while cars still occupy the crossing, check the position and alignment of sensors 3 and 4, especially with short or open-frame cars. A detector LED that lights with empty track points instead to a misaligned beam, stray light, or incorrect sensor-mode wiring. If the lamps or motors shut down and the board’s OL indicator lights, unplug the supply and inspect for a short or overloaded output before trying again.
This is a low-voltage layout project, not a job that normally needs an electrician. Leave it to a qualified electrician if the work requires modifying a mains-powered supply or household wiring. Leave a damaged or seized gate mechanism to a repairer—or replace it—rather than trying to overcome it with a stronger motor.