This instruction illustrate principal create railway classical model layout control unit. A communicate through bluetooth between Arduino and Android (or computer, or minicomputer) allows you to switch arrows, run trains.
The relay breaked current on blocked lines depending on the position of the junctions. SIgnals also change state. Look at the Arduino sketch to understand the logic of these switches. Also you will see the mechanism of power on / off on the servo drive only at moment of switching the junction.
This is also a good example for understanding the system commands of the ArduinoTrainBtControl application and the URB concept. You can also send these commands directly from the serial port terminal (via USB) or connect your Raspberry Pi.
Universal Railmodelling Bus (URB) - unit to create electrical diagrams for any railway projects and more, details on my site.