Control Your Model Train Layout With Your KEYBOARD!
by KushagraK7 in Circuits > Arduino
4219 Views, 16 Favorites, 0 Comments
Control Your Model Train Layout With Your KEYBOARD!

In one of my previous Instructable, I showed you how you can control your model train with your TV remote. You can check out an upgraded version also here. In this Instructable, I will show you how to control a model train layout with a keyboard through a computer using Processing. So, let's get started!
Get All the Stuff!


So, before starting with the build, make sure you have all of these;
Any Arduino board compatible with Adafruit motor driver shield
An Adafruit motor driver shield
A crosshead screwdriver
3 pairs of male to male jumper wires(2 pairs for the turnouts and the third one for the power feeder track)
A power feeder track
2 turnout tracks(you can add as many as you want by modifying the Arduino and processing codes)
A 12 volt DC power supply
A suitable USB cable to connect your Arduino board to a computer
An external keyboard (Optional)
Get the Arduino Code and Upload It to Your Board

Make sure you have the Adafruit motor shield library installed in your computer.
Plug on the Motor Driver Shield to Your Board

Connect the Jumper Wires to the Motor Driver Shield

Set Up Your Train Layout


Get your tracks and set up your model railway layout.
Set Up Your PC

Connect the Power Feeder Track and the Turnout Switches to the Motor Driver Shield

Set Up the Locomotive and Rolling Stock on the Tracks


Connect the Arduino Board to Power

Wait! before powering up your setup make sure there are no loose connections, faulty components and derailed rolling stock or locomotive(s).
Connect the Arduino Board to the PC Via USB


Launch the Processing 3 IDE and Open the Code

Download the Processing IDE from here. Download the given code and open it in the IDE.
Test Your Layout

Feel free to add more features to this layout by altering the codes, adding more turnouts and motor drivers. It's all up to you. I hope you will enjoy making this project. All the best for your build!