Reverse Loop D
Version C plus Signal 1, a two-head mast on the mainline facing the turnout. The upper head is for the straight route and the lower head is for the diverging route. The SMART Switch’s signal OUT drives a 1 A DPDT PD relay, so the signal always shows the route the turnout is lined for, whether a push button or a detector moved it.
The train has to fit in the loop
The whole train must fit between detectors 2 and 4, clear of both, right here. Then the entry line releases before the nose reaches the exit detector.
Signal 1 at the turnout
The SMART Switch’s signal OUT follows the turnout and drives a single 1 A DPDT PD relay. Pole 1 runs the upper head: green when the turnout is closed for the straight leg, red when it’s thrown. Pole 2 runs the lower head the other way around: green when thrown for the diverging route, red when closed. Both poles move together, so pole 2’s two wires cross on the way to the lower head. The relay commons take 12 V+, and each contact feeds one LED. If your output runs the opposite way, press SELECT seven times on the SMART Switch to reverse it. The 1 A relay is plenty for signal LEDs. It only switches the signal lamps, not track power.
Push buttons
In two-button mode, a button on input A throws the turnout for the diverging route, and a button on input B closes it for the straight leg. The buttons share those inputs with the detector lines. While a train is over a detector, the line holds the SMART Switch and the buttons have no effect. When no train is on a detector, a press moves the turnout. If the train is in the loop, the exit detector sets the turnout back for the exit before the train reaches the points.
Detectors hold the boards
A Precision Detector keeps its line active for as long as the train is in front of it. It isn't a one-shot pulse. While one input holds the SMART Switch or SMART Relay, the board ignores its other input. Once the train is fully past (plus the detector’s timeout), the board releases. It stays latched where it is, and the other input can take over.
Why two detectors on each side
Detectors 1 and 2 share one line, and detectors 3 and 4 share the other. The detector inside the loop (2 or 4) has to flip the loop’s polarity before the train reaches the exit gap. The same line also lines the turnout for the leg the train is about to use, so it never runs through points set against it. The detector outside the loop (1 or 3) sets the loop for a train coming in, before it reaches the entry gap. When a train is leaving, it just extends the hold.
The train has to fit in the loop
When the nose reaches the inner exit detector, the rear must already be past the inner entry detector. That lets the first line release. If the first line is still holding, both boards ignore the exit detector, and the loop doesn’t flip in time.
DCC: A and B, not + and −
The drawing uses + and − to make the polarity easy to follow. On a DCC layout, the rails don’t carry + and −. They carry the two DCC phases, A and B. The loop works the same way: each loop rail just has to match the mainline rail it’s about to meet at the gap. The SMART Relay swaps A and B on the loop the same way it swaps + and − here.
Board settings
SMART Switch: two-button mode (press SELECT twice) and coil machine (press SELECT four times; 100 ms pulse, adjustable to 200 ms with the trim pot). SMART Relay: use the 5 A version (the standard relay’s contacts are rated 1 A), set to behavior 3, latched by input #1 and input #2. Wire it as a reversing switch using all six contacts: track power + to COM1 and − to COM2, NC1 and NO2 together to one loop rail, and NO1 and NC2 together to the other. Flipping the relay swaps which rail gets + and which gets −. Power the boards and all four detectors from the same 12 V DC supply.