Arduino MS Train Simulator Console

6,348

45

7

About: A recent graduate of Strayer University now holding a Bachelor's in Computer Science and Information Systems . I am currently looking for something in the field of computer science. Meanwhile my second inter...

I am a big train buff loving everything there is about them, This also means I like to play Train Simulator from Microsoft. Using a keyboard to drive a train is not the most prudent way. I looked at rail driver but for 200 dollars, it wasn't my cup of tea. So I had the idea of making a train simulator console for about 50 dollars using the Arduino Leonardo. The Leonardo made it easy to implement controls because it has keyboard emulation that is reconfigurable for any game. It's used to make MAME arcade machine controllers which this is a variant of. I am going to show you how to make one of your own you can improve so I could see and probably improve mine.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Construction Plans

I went to a maker shop and fashioned a 13x5 box out of wood. I used large pieces of wood as a support frame. To support the top. I encircled the interior top with pieces of dowel. I painted it black for a stained wood feel.

The lighted arcade button and joystick holes are 1-1/8

The holes for the reverser switch is 12.2. The other holes are 1/4-4

Step 2: Materials

I'm listing these so you could choose the design of the box you want.

Mame Arcade Controller Stick

Three Lighted Arcade Buttons

Arduino Leonardo (Good for Keyboard Emulator)

SPDT Switch

Various momentary buttons of your choosing.

Step 3: Software

Step 4: Wire the Buttons

The lighted arcade buttons I added to give this project a more spectacular look. You can choose what ever you like but you configure them the same way. Wire all of the buttons here by soldering the arduino GND into the button input. The output line is the NO pin and that is what you connect to the Arduino Pins. For the lighted buttons connect the 5v voltage into the light input line.

Step 5: Wiring Into the Arduino

The Arduino Leonardo is the heart of the console. The Leonardo is good for this implementation because it has a keyboard emulation good for Arcade Controllers. The MAME arcade controllers use this board like in Brainy Bits MAME Arcade Controller. You would do good to look up ASCII keyboard codes so you can design your own configuration.

I used a breadboard to wire the Arduino to the buttons. I would suggest wiring the 5V and GND into the board and connect the buttons to them. The outputs from the button NO goes into the arduino pins and the GND goes into the button power input. This corresponds with the LOW function in the code.

Step 6: Installing the Joysticks

The bread and butter, the joysticks.

The left joystick will be used for brakes. The right joystick will be used for the throttle. Install the joysticks and align them so the poles are dropping down the holes. They allow the sticks to move in the up and down direction.Glue the sticks onto the board after you have found the sweet spot. Wire the joysticks according to the wiring diagram up above.

I wired both so the increase direction is backwards. This simulates the real operation of locomotive levers. They pull backwards to increase speed or braking power because it's more ergonomic. The decrease direction is forward as is in real trains.

Step 7: Give It Life

Now download the program into the Arduino Leonardo. There is a bug I can't seem to figure out that the board will run certain functions from your keyboard disrupting your computer. The computer corrects itself when you disconnect the USB. Run your train simulator program like 2001 Microsoft Train Simulator or Aurans Trainz. Plug it into your computer after you have boarded the train. It will run the train functions well and you will have an inexpensive train console.

Step 8: It's Alive!

See it in action finally alive. It runs a little clunky but if you can live with it., you have an awesome MS Train Console.

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    7 Discussions

    0
    None
    ThomY2

    4 months ago on Introduction

    I hacked a PS2 keyboard to make a diy controller probably the easiest way for a non tech
    person to do this, all this programming gives me a headache. I am going to hack a usb
    keyboard for a Electronic Arts Rail Simulator game. The reason I hacked the PS2 board
    was that MSTS would only work in Windows 7, the pc with PS2 only connections.

    0
    None
    Spawnholio666

    3 years ago

    Forgot to mention I love the end result too. Way more satisfying to build one yourself rather than buy one.

    1 reply
    0
    None
    Spawnholio666

    3 years ago

    I'm not into trains at all, but this is a great instructable. You've given me some ideas for a MAME controller.

    1 reply