Introduction: Control Your Model Train Layout With Your TV REMOTE!
In this instructable, I will show you how to make an IR remote control system for a model train. You will then be able to control your trains while relaxing on your couch. So, let's get started!
Step 1: Collect All the Stuff!
Here is the parts list for electronic components:
An Arduino Mega
An AF motor driver shield
An SM0038 IR receiver
A 12 volt DC power supply
A 47 uF capacitor
Some jumper wires
Step 2: Assemble the Electronics
Check the Arduino code for more info on the wiring connections, download it from the next step.
Step 3: The Software
Upload this code to your Arduino board:
Step 4: Make a Test Layout
Mame a simple loop of track to test your setup.
Step 5: Get Your Locomotive
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.
Step 6: Add It to Your Test Layout
Step 7: Power Up the Setup and Get the Train Running!
I hope you will enjoy making this project. All the best for your build!

Participated in the
Make it Move Contest
6 Comments
Question 4 years ago
hi...
may i use an arduino uno?
Regards
Reply 4 years ago
Yes, but make sure you change the pin connection of the IR receiver in the Arduino code to the pin which is available on the Arduino UNO. Since a motor driver shield used in this project acquires a lot of digital I/O pins of the Arduino board, it is recommended to change the pin connection of the IR receiver to the digital pins 9 or 10 since they are not used by the shield.
Reply 4 years ago
1. Can i use this module (pict) link https://www.ebay.com/itm/Infrared-IR-Wireless-Remo...
2. on code at MEGA :
int pwrpin = 50;//Remove this line if you are connecting your IR sensor's power to VCC.
int recvpin = 46;//Sensorpin
i change code at UNO :
int pwrpin = 12;//Remove this line if you are connecting your IR sensor's power to VCC.
int recvpin = 11;//Sensorpin
Reply 4 years ago
You can use any IR receiver module with any remote, but you will need to change the hexadecimal codes for each function in the Arduino program to let your remote take control of the train layout.
You can connect the VCC terminal of the sensor to the +5-volt pin of the Arduino board and GND terminal of the sensor to the GND pin of the Arduino board. Also, the Adafruit motor driver shield mentioned in the project already uses almost all of the digital I/O pins of the Arduino UNO board, so you will need to change the 'recvpin' to either 9 or 10 since they are not being used by the motor driver shield.
5 years ago on Step 7
Pardon me, boy, is that the Chattanooga Choo Choo?
nice instructable, my friend.
Reply 5 years ago
Are you talking about the music in the video? Well, anyway, thanks!