Summary of Model Railway Layout With Automated Siding
This article outlines a low-cost, automated model train layout project using an Arduino microcontroller. Key advantages include minimal operational costs, suitability for unattended displays, and excellent practice for microcontroller enthusiasts. The guide details the necessary materials, wiring instructions for turnouts and power feeders via an L298N motor driver, sensor integration, and track layout requirements to ensure smooth automation.
Parts used in Model Railway Layout With Automated Siding:
- Arduino UNO microcontroller board
- L298N dual H-bridge motor driver board
- 6 male to male jumper wires
- 7 male to female jumper wires
- Screwdriver
- 12 volt-DC power supply adapter
- Kato S62 track segment with IR proximity sensor
- Turnouts (switches)
- Power feeder track
Making model train layouts is a great hobby, automating it will make it a lot better! Let us take a look at some of the advantages of its automation:

- Low-cost operation: The whole layout is controlled by an Arduino microcontroller, using an L298N motor driver, their cost is almost nothing as compared to traditional train control throttles and power packs.
- Ideal to put up at a display: Since no human interference is required to keep a control on the layout, you can use it at a display where you cannot be always present to control the train and the turnouts.
- Great for microcontroller hobbyists: If you are or want to start with Arduino and programming, this is a great project for you to practice your skills.
If you are interested, you can also check the previous version of this project which is even simpler.
So, without further ado, let’s get started!
Step 1: Watch My Project Working
Step 2: Get All the Material

To start, make sure you have all of the following:
- An Arduino microcontroller board, UNO is preferred.
- An L298N dual H-bridge motor driver board.
- 6 male to male jumper wires.
- 7 male to female jumper wires.
- A screwdriver.
- A 12 volt-DC power supply adapter.
- A track segment with IR proximity sensor attached on the underside(I used a Kato S62 track)
Step 3: Upload the Program to the Arduino Board

Step 4: Lay the Tracks and Make the Layout

Make an oval loop with a passing siding somewhat as shown above. Make sure the distance between the sensor track and the first turnout the train will cross after crossing the sensor track is greater than the length of the train such that no part of the train is over the sensor track when it crosses the turnout.
Step 5: A Circuit Schematic Is Always Helpful

Click on the image to get a full view. Make sure you go through the full circuit schematic and all of the details before proceeding.
Step 6: Connect the Turnouts to the Output of the L298N Driver Board

Connect the red and the black wires of both the turnouts respectively to each other, resulting in a parallel connection. Then, connect the red wires to the out4 and the black wires to the out3 terminal of the motor driver board.
Step 7: Connect the Power Feeder Track to the Other Output of the L298N Driver Board

Connect the power feeder’s white wire to the out1 and the blue wire to the out2 terminal of the motor driver board.
Step 8: Connect the L298N Driver Board to the Power Pins of the Arduino Board

Connect the 12-volt pin to the VIN pin of the Arduino board, the GND pin to the GND pin of the Arduino board, and preferably, the 5-volt pin of the motor driver to the 5-volt pin of the Arduino board.
Step 9: Connect the Sensor to the Arduino Board

Connect the VCC pin of the sensor to the 5-volt pin of the Arduino board, GND pin to GND pin of the Arduino board, and the OUT pin to the A0 pin of the Arduino board.
Step 10: Connect the Input Pins of the Motor Driver to the Arduino Board

Connect the digital pins of the Arduino board to the input pins of the motor driver board as follows:
- D9 to IN1
- D10 to IN2
- D11 to IN3
- D12 to IN4
Source: Model Railway Layout With Automated Siding
-
What are the main advantages of automating this model train layout?
The project offers low-cost operation, allows for display use without human interference, and serves as a great practice tool for Arduino hobbyists. -
Which Arduino board is preferred for this project?
An Arduino UNO board is the preferred choice for this specific layout. -
How should the turnouts be connected to the L298N driver board?
Connect the red and black wires of both turnouts in parallel, then link the red wires to out4 and the black wires to out3 on the driver board. -
What is the required distance between the sensor track and the first turnout?
The distance must be greater than the length of the train so no part of the train remains over the sensor when it crosses the turnout. -
How do you connect the power feeder track to the L298N driver board?
Connect the white wire of the power feeder to out1 and the blue wire to out2 terminal of the motor driver board. -
Which pins on the Arduino board connect to the L298N input pins?
Digital pin D9 connects to IN1, D10 to IN2, D11 to IN3, and D12 to IN4. -
How is the IR proximity sensor wired to the Arduino?
Connect the sensor VCC to the 5-volt pin, GND to the GND pin, and the OUT pin to the A0 analog pin of the Arduino. -
Can this project be used at a display where no one is present?
Yes, since no human interference is required to control the layout, it is ideal for unattended displays.
