Trybotics Logo

Simple Automated Point to Point Model Railroad Running Two Trains

DESCRIPTION

Arduino microcontrollers are a great way of automating model railroad layouts due to their low-cost availability, open-source hardware and software and a large community to help you.

For model railroads, Arduino microcontrollers can prove to be a great resource for automating their layouts in a simple and cost-effective way. This project is such an example of automation of a multi-point model railroad layout to run two trains.

This project is an upgraded version of some of my previous point to point model railroad automation projects.

A bit into this project:

This project focusses on automating a multi-point model railroad layout which has three stations. There is a starting station, say 'A' which initially houses both the trains. The mainline track leaving the station branches into two lines which go respectively to the two stations say 'B' and 'C'.

Description:

Watch the above video to understand the operation of the layout.

Description:

Here is what you will need for this project:

  • An Arduino microcontroller compatible with the Adafruit motor shield V2.
  • An Adafruit motor shield V2. (Know more about it here.)
  • An expansion shield(Optional but highly recommended)
  • Three 'sensored' tracks.
  • 6 male to male jumper wires(To connect the turnouts and track power wires to the motor shield.)
  • 3 sets of 3 male to female jumper wires, a total of 9(To connect the sensors to the Arduino board)
  • A 12-volt DC power supply adapter with a current capacity of at least 1A(1000mA).
  • A suitable USB cable(For connecting the Arduino board to the computer).
  • A computer(For programming the Arduino board)
  • A small screwdriver

Description:

Make sure you have the Adafruit's motor shield v2 library installed in your Arduino IDE, if not, press Ctrl+Shift+I, search for the Adafruit motor shield and download the latest version of the Adafruit Motor Shield v2 library.

Before uploading the code on the Arduino microcontroller, make sure to go through it to get an idea of what all is happening and how.

Attachments

Description:

Click on the above image to know more about the layout and the location of each 'sensored' track and the turnout.

Description:

Install the motor shield on the Arduino board by carefully aligning the pins of the shield with the herders of the Arduino board and make sure no pin gets bent.

Description:

Make the following connections:

  • Connect the output of the motor shield 'M3' to turnout 'A'.
  • Connect the output of the motor shield 'M4' to turnout 'B'.

Description:

Connect the output of the motor shield 'M1' to the track power feeder installed in the mainline.

Description:

Description:

Make the following connections with the 'sensored' tracks:

  • Connect each sensors' pin labeled 'power', 'VIN' or 'VCC' to the header rail of the expansion shield labeled as '+5V' or 'VCC'.
  • Connect each sensors' pin labeled 'GND' to the header rail of the expansion shield labeled as 'GND'.
  • Connect the sensor A's output to pin 'A0' of the Arduino board.
  • Connect the sensor B's output to pin 'A1' of the Arduino board.
  • Connect the sensor C's output to pin 'A2' of the Arduino board.

Description:

Place the trains in the tracks of station A. The train A will be placed on the branch line of station A and the train B on the straight one. Refer to step 4 for more information. A diesel locomotive has been used here to represent train B.

Use of a rerailer tool is recommended, especially for steam locomotives.

Description:

After powering up the setup if the locomotive starts to move in the wrong direction, reverse the polarity of track power's connection with the terminals of the motor shield. If any of the turnouts switch in the wrong direction, you know what to do!

Description:

If everything was done properly, then you should see the train in the sideline at station 'A' start to move and the operation to carry on as shown in the video in the first step.

Description:

If you want you can go ahead and tinker with the Arduino code and make changes to suit your needs. You can expand the layout, add more motor shields to run more trains, increase the complexity of railroad operation such as running two trains simultaneously and so on, there is a very long list of what you can do.

If you want you can also take a look at some different layout automation projects here.


YOU MIGHT ALSO LIKE