Automated Model Train Layout(Version 1.0)

by KushagraK7 in Circuits > Arduino

7229 Views, 20 Favorites, 0 Comments

Automated Model Train Layout(Version 1.0)

IMG_0483.JPG

Model trains are always a fun to have and run. But to control them manually sometimes seems to be a bit boring. So in this instructable, I will show you how you can automate your model railway layout so you can sit back and relax while watching your train run on its own. This can be useful at places where you have to put your layout show and you cannot always be present there to control your trains. So, let's get started!

Step 1: Collect All the Stuff!

IMG_0479.JPG

Before starting, make sure you have all the parts for the build:

An Arduino Mega microcontroller board

An Adafruit motor driver shield(as shown in the picture)

A 16x2 LCD screen

A 10 kOhm potentiometer

A 12v DC wall adapter(recommended max current capacity of 1000mA)

Some wires

The Train!

IMG_0455.JPG

This is a Tomix EF210 N-scale electric locomotive which I bought from Japan. It comes as a set with two container wagons, check it out here: https://www.amazon.co.jp/gp/product/B00EZIDM6M/ref...

Let's first just get our locomotive. We will add rolling stock at the end.

The Arduino Program

Capture.PNG

Download it from here:

Making the Control Unit

IMG_0462.JPG
IMG_0463.JPG
IMG_0464.JPG
IMG_0465.JPG
IMG_0466.JPG
IMG_0467.JPG
IMG_0467.JPG

I tried to use as less wiring as possible in order to keep the setup clean. If you want the LCD screen to be wired differently, you can change the pin connections in the Arduino program.

Make the Layout!

IMG_0456.JPG

I made this test layout to run my train using Kato Unitrack, it is one of the best quality model railway tracks I found in the market. You can make your loop as long or short as possible.

Install the Train Controller.

IMG_0468.JPG
IMG_0469.JPG
IMG_0470.JPG

I used a sturdy cardboard box with some weights inside it as a platform for the train controller since it also featured an LCD screen. I used two flat-head screws at the rear part to anchor a plastic fiber ruler to support the controller board standing on the platform.

Connect the Power Feeder Track's Wires to the Motor Output of the Driver

IMG_0471.JPG

Remember those header pins which were connected to the motor output? The feeder track's connector can be attached to these long header pins or you can cut away the connector and connect the track's power through bare-end wires.

Put the Locomotive on the Track.​

IMG_0473.JPG

Connect 12v DC Power to the Arduino Board and Turn on the Power

IMG_0472.JPG

Check If the Setup Is Working Properly.

IMG_0475.JPG

The LCD screen should light up and the locomotive should start moving after 5 seconds of powering up the controller. Watch out for loose connections, short circuits, and malfunctioning components. Make sure the rails are cleaned properly to ensure proper electrical contact between the wheels of the locomotive and the rails.

Attach Rolling Stock to the Locomotive

IMG_0476.JPG

Since the locomotive is working perfectly well, let's attach some rolling stock to the locomotive to make it look like a train.

Get the Train Running!

IMG_0477.JPG