Automated Model Railway Layout with Passing Siding

A basic model train layout containing a passing siding with a train running around and stopping in an automated sequence.

Jan 25, 2019

27734 views

38 respects

Components and supplies

1

Dual H-Bridge motor drivers L298

1

IR proximity sensor

6

Male/Male Jumper Wires

1

12V DC 1000mA (1A) switching power supply

7

Male/Female Jumper Wires

1

Arduino UNO

1

12V DC 5A switching power supply

Apps and platforms

1

Arduino IDE

Project description

Code

Model_train_layout_with_automated_track_switching.ino

arduino

Downloadable files

Circuit schematic

Make sure you go through the schematic carefully.

Circuit schematic

Circuit schematic

Make sure you go through the schematic carefully.

Circuit schematic

Comments

Only logged in users can leave comments

mrsillycats

2 years ago

This is awesome!

nickino

2 years ago

Model railways and Arduinos, two of my favourite things. Well done, keep that sort of project coming!

Anonymous user

2 years ago

I would like to know how many IR proximity units can be used on one LN298N dual bridge board

richardvanraay

2 years ago

I am missing something. What motor controls the points? Is it a Tortoise motor, a servo motor, or something else?

Anonymous user

2 years ago

Hi, a good start, the fact that you rely on delays to do your stopping and starting from one track sensor is a bit odd. You are relying on the constant speed of the train to work out its location. Will you be using more IR track sensors and thus make it less speed sensitive? I am building a control system for a dual track end to end layout, using the T_Track configuration. I'm using Hall Effect sensors and a Can Open system to communicate with each section. Tom.

Tech_build

2 years ago

I wanted to keep the project simple and easy to understand for beginners, that is why I started with a simple loop with a passing siding. Adding more sensors will greatly increase the performance of the project, like slowing down and stopping the trains at multiple locations, I will be improving and make more complex layouts in the future which will require more accurate location control, thus the delays will be used less often.

Anonymous user

2 years ago

Dear Kushagra , I loved your project, I 'm interesting in model train hobby too. but I have a question about your project. does the loco that you use your project have DCC modul in it ? or analog model? My locos have DCC modul in theirs. can I try to use your project? what do you think ? Best Regards. Necmi SENTUNA

Tech_build

2 years ago

Since I just began with the hobby, I decided to start with DC locomotives to suit my budget. As far as I know, almost all of the DCC decoders have a capability of allowing the locomotives to operate on either DCC or DC layouts, the ones manufactured by well-known companies like Digitrax certainly have this feature. I found this on Reddit: "DCC decoders have a configuration variable that is used to enable or disable DC mode. If it's disabled, you'll have to re-enable it with a DCC system. However, all modern DCC decoders come from the factory with dual-mode operation enabled." Hope this helps!

Anonymous user

2 years ago

I'm doing something similar. An end to end layout with run round loops at each end. Loco uncouples from a coach at each station and runs around to couple up for the return journey. I'm using hall effect sensors to detect the train's position.

Anonymous user

2 years ago

I'm using OO (HO track @ 1:76 scale). I will share pictures when completed.

Tech_build

2 years ago

All the best for your project build! By the way, what scale are you using(N/HO/O)? If possible, will you share some pictures of your finished layout?

Anonymous user

2 years ago

Hi, you did a good Job there. Nice to watch the videos of the train running. To keep motor temperature low I like to suggest that you use the two Bridge Inputs for controlling the direction of the train only. Use enable input to control the Speed by PWM instead. This will not shortcut the motor during off-state (both bridge inputs at same logic level)

Tech_build

2 years ago

Thanks for your suggestion, I will keep this in mind when working on future projects.

richardvanraay

3 years ago

I am missing something. What motor controls the points? Is it a Tortoise motor, a servo motor, or something else?

Anonymous user

5 years ago

I would like to know how many IR proximity units can be used on one LN298N dual bridge board

TomGeorge

6 years ago

Hi, a good start, the fact that you rely on delays to do your stopping and starting from one track sensor is a bit odd. You are relying on the constant speed of the train to work out its location. Will you be using more IR track sensors and thus make it less speed sensitive? I am building a control system for a dual track end to end layout, using the T_Track configuration. I'm using Hall Effect sensors and a Can Open system to communicate with each section. Tom.

Tech_build

2 years ago

I wanted to keep the project simple and easy to understand for beginners, that is why I started with a simple loop with a passing siding. Adding more sensors will greatly increase the performance of the project, like slowing down and stopping the trains at multiple locations, I will be improving and make more complex layouts in the future which will require more accurate location control, thus the delays will be used less often.

nickino

6 years ago

Model railways and Arduinos, two of my favourite things. Well done, keep that sort of project coming!

Anonymous user

6 years ago

Hi, you did a good Job there. Nice to watch the videos of the train running. To keep motor temperature low I like to suggest that you use the two Bridge Inputs for controlling the direction of the train only. Use enable input to control the Speed by PWM instead. This will not shortcut the motor during off-state (both bridge inputs at same logic level)

Tech_build

2 years ago

Thanks for your suggestion, I will keep this in mind when working on future projects.

nsentuna

6 years ago

Dear Kushagra , I loved your project, I 'm interesting in model train hobby too. but I have a question about your project. does the loco that you use your project have DCC modul in it ? or analog model? My locos have DCC modul in theirs. can I try to use your project? what do you think ? Best Regards. Necmi SENTUNA

Anonymous user

2 years ago

Dear Kushagra - I have recently browsed on the Arduino application for model railroads and would like to take up a few simple projects. I understand your project was using a DC locomotive. I have locos which are either on DCC or DCC with sound. In such a case how do I integrate the arduino with the DCC controller. Any ideas. I am a beginner on ardiuno and pls pardon my knowledge.

Tech_build

2 years ago

Since I just began with the hobby, I decided to start with DC locomotives to suit my budget. As far as I know, almost all of the DCC decoders have a capability of allowing the locomotives to operate on either DCC or DC layouts, the ones manufactured by well-known companies like Digitrax certainly have this feature. I found this on Reddit: "DCC decoders have a configuration variable that is used to enable or disable DC mode. If it's disabled, you'll have to re-enable it with a DCC system. However, all modern DCC decoders come from the factory with dual-mode operation enabled." Hope this helps!

Henry_Best

6 years ago

I'm doing something similar. An end to end layout with run round loops at each end. Loco uncouples from a coach at each station and runs around to couple up for the return journey. I'm using hall effect sensors to detect the train's position.

Henry_Best

2 years ago

I'm using OO (HO track @ 1:76 scale). I will share pictures when completed.

Tech_build

2 years ago

All the best for your project build! By the way, what scale are you using(N/HO/O)? If possible, will you share some pictures of your finished layout?