Introduction: Control Your Model Train Layout With Your Mobile Phone!
Controlling a model train layout with a wired throttle and turnout controllers might be a good start for beginners but they pose a problem of non-portability. Also, the wireless controllers which come in the market can either control only some locomotives or are a bit too expensive. So, in this instructable, let's learn how to make a simple wireless model train layout control setup with a smartphone so you can sit back, relax on your couch and have a control on your layout. Let's get started!
Step 1: Watch the Video!
Step 2: Collect All the Stuff!
Before starting to build, make sure you have all of the following parts, materials, tools, and supplies:
- An Arduino board, preferably an Arduino UNO, MEGA, Leonardo, or similar ones which can be attached to an Adafruit motor driver shield.
- An Adafruit motor driver shield.
- A 12-volt DC power source.
- A DTMF decoder.
- Wires to connect the track power and turnouts(click on the image to know more).
- Wires to connect the DTMF decoder to digital pins and power(click on the image to know more).
- A smartphone equipped with a DTMF tone generator app.
- A crosshead screwdriver.
- A 1KΩ - 10KΩ resistor.
Step 3: Program the Arduino Board
If you don't have Arduino IDE on your computer, download it from here. The library for the Adafruit motor driver shield can be found here, in case you don't have it in your IDE. Make sure you install this in your IDE before compiling the program. If you need help installing a library, check this link out.
Step 4: Modify the DTMF Decoder
Look for an LED on the board marked as 'DV', it lights up whenever the DTMF decoder receives an appropriate audio signal. Trace its path to the chip(make sure you are not following the GND connection) and solder a wire where the copper trace connects the chip's pin to the resistor connecting to the LED.
Step 5: Make the Layout
The test layout which I made is made up of a small oval loop along with two yard-sidings.
Step 6: Make All the Wiring Connections
Connect a 'pull-down' resistor between the pins GND and A0. Plug the AF motor shield on the Arduino board by carefully aligning the pins of the shield to the sockets on the Arduino board and pushing the shield down to secure it firmly on the Arduino board.
Make the following wiring connections:
- Connect any one of the two turnouts to the screw terminal blocks marked 'M4'.
- Connect the second turnout to the screw terminal blocks marked 'M3'.
- Connect the wires of the power feeder track to the screw terminal block marked 'M1'.
- Connect the digital outputs of the DTMF decoder to the analog inputs of the Arduino board as follows:
- D0 to A1
- D1 to A2
- D2 to A3
- D3 to A4
- DV to A0
Step 7: Place the Train(s) on the Track(s)
We'll just use two locomotives for testing purposes. You may even use one.
Step 8: Connect Your Phone to the Bluetooth Receiver
Make sure you have DTMF tone-generator app installed on your smartphone. Turn on the Bluetooth receiver and turn on the smartphone's Bluetooth, go to Settings> Bluetooth and find the receiver's name and pair it with your smartphone.
Step 9: Test Your Setup
Open the DTMF tone generator app and test your layout. The default controls are as follows:
- 2: Accelerate the locomotive forward.
- 8: Accelerate the locomotive backward.
- 5: Stop the locomotive.
- 1 and 3: 1st turnout controls.
- 4 and 6: 2nd turnout controls.
The remaining buttons are unused and can be used to control even more turnouts by modifying the Arduino program.
If the locomotive starts to move in the wrong direction, turn off the power and swap the wires of the power feeder track with each other.
Step 10: Get Your Layout Working!
Now you can sit back, relax on your couch and control your trains and turnouts with your mobile phone.
Step 11: What Can I Do More?
There are a lot of unused buttons left on the control pad. So, go ahead by adding more functions to your layout and share your creation below. All the best!

Participated in the
Big and Small Contest
14 Comments
Question 7 months ago on Step 4
Hi, any recommendation for a DTMF decoder, or, any recommendation if I can’t find DV on ant DTMF decoder available?
Answer 7 months ago
I used the MT8870 DTMF decoder module as it has a pin provided to connect to the DV pin of the IC making wiring easy.
https://www.electronicscomp.com/mt8870-dtmf-decode...
Generally, all the DTMF decoder ICs have the DV pin, if it is not available on the board, you can look at the IC's pinout and then solder a wire directly to that pin. For example, before coming across the above DTMF decoder, I used this one:
https://robocraze.com/products/dtmf-decoder-gl?cur...
It has an LED connected to the DV pin of the IC but no pin to connect wire to, so I soldered a wire directly to the pin of the IC and secured it with hot glue.
3 years ago
Does the train engine have to have Bluetooth built in to start with or can it be added?
3 years ago
Do you think it is possible to replace your DTMF by this one https://www.ebay.fr/itm/Clavier-Dtmf-Generator-Module-Carte-Emetteur-Encodeur-Audio-pour-Arduino-Uno-j1y/113923869159?hash=item1a866449e7:g:EdkAAOSwwlVdpLDi
It is impossible to find your DTMF in any store. Thank'y !
4 years ago
You have put out a bunch of brilliant information in a bunch of instructables. Thank you :) good luck with the competition. :)
Reply 4 years ago
full layout of this and components
Reply 4 years ago
Thanks! All this would not have been possible without the support and motivation members like you give me to help me create such content.
4 years ago
Not including the trains, what is the approximate cost of this project?
Reply 4 years ago
- An Arduino UNO (about 6$).
- An Adafruit motor driver shield(about 5$).
- A 12-volt DC power source(about 4$).
- A DTMF decoder(about 4$).
- Jumper wires(about 1 to 2$).
- A crosshead screwdriver(Price may vary depending upon brand and quality).
- A 1KΩ - 10KΩ resistor(about 2 cents).
The total cost will roughly come to be about 20 to 25$.Reply 4 years ago
That's great, I was expecting it to be far more expensive. Great instructable, looking forward to trying it soon.
Question 4 years ago
OK, I might not read the whole instructable multiple times, but how do you switch the trains? Like now you are controlling one train and you want to stop it and control the other one. So what do you have to do?
Reply 4 years ago
Not to be confused with DCC, the controls used in this project, apart from being wireless, are similar as used for DC trains. Both of the trains are kept in the sidings until any one of them, when required, can be taken on the mainline to operate them.
Question 4 years ago
Do you think it would be possible to adapt this to HO slot cars instead of trains and can two people control 2 different cars at the same time so they could race them?
Reply 4 years ago
For that purpose, you will need twice the number of the materials mentioned in the parts list. Make two separate control station for each loop of the track to the two cars independently and then you will be able to control the two cars like the trains as shown in the video on step 1.