Hobby train track control system to automate track switches (turnouts) based on train position detection.

The Train Track and Turnout Control system is an Arduino based digital system that utilizes infrared emitter/detectors to detect train position and then to set turnouts for specific direction and/or change DC track power direction.

This system utilizes a daisy chained pair of 74HC165 shift registers to provide 16 input channels for the IR sensors going into the Arduino. A second pair of daisy chained 74HC595 shift registers provides another set of 16 output channels to control up to 16 individual track turnout switches. These output channels are wires to 16 opto couplers to isolate the external turnout power from the Arduino system itself.

External DC power to the DC turnouts is conducted via a SN754410 H-bridge. The power flows to 16 opto- couplers (VO2223A). These allow the external power to flow in either direction to the DC motors to support forward/reverse direction.

Another support feature is a separate H-Bridge that is powered by the main track DC power. This is for a DC powered train system (not DCC type). In my current configuration I am using a pair of dtdp relays wired in an h-bridge design. I used the second side of the SN754410 bridge (3,4) as an on/off switch to the relay pair which activates the train track in either forward or reverse. The track power is always flowing through the relay pair, its just a matter of whether its flowing forward or reverse, which the SN754410 controls (via Arduino) but turning the relays on/off.

Currently a limitation is that AC powered switches are not part of the design ... yet. Got ideas how to add that, please let me know!