Control Your Model Railroad with a Game Controller! | Wii Nunchuk Train Control with Arduino

A while back, I came across MakersBox's Instructable where he showed how a model locomotive can be controlled using a Wii Nunchuck's joystick using an Arduino microcontroller for communicating with the Nunchuck and an Adafruit Motor Shield V1 for driving the locomotive. The Instructable inspired me to make my own version of the project and I also added a feature for controlling multiple turnouts.

You can watch this project in action and learn the controls from here:

 

 

You can find the Instructable for this project here.

Main Parts of the Setup:

An Arduino Leonardo is the 'brains' of the system. An Adafruit Motor Shield V2 is being used to drive the locomotive and the turnouts. Almost any microcontroller with I2C capability(Required to communicate with the Nunchuk) can be used in the project. Any other type of motor driver can also be used in the project by altering the code.

The Wii Nunchuk communicates with the Arduino microcontroller via I2C. The Nunchuk is powered with 3.3-volts and works well even at a 5-volt logic voltage in the I2C lines. The y-axis movement of the joystick is being used for controlling the locomotive and the x-axis is for controlling the selected turnout. The buttons 'Z' and 'C' are being used for stopping the locomotive with and without deceleration respectively. The Nunchuk also has an accelerometer which proved to be useful in selecting the turnout to control with the joystick by tilting the controller in either direction as shown in the video at the beginning. With the original Nunchuk, we can get a better quality accelerometer and better control over changing the number but the low-cost one also gets the work done pretty well.

A common-cathode 7-segment LED display is being used for showing the number corresponding to the turnout which can be controlled with the joystick.

 

What's for the future?

I am currently working on making the Nunchuk wireless, hopefully, it will be done soon. In the meantime, you can check some of my other projects on Instructables and my YouTube channel.

 

I hope you enjoyed this little blog on my project.

Thank you.

Comments

Jim at BSME's picture

Cool project

This is cool, and I see your instructables have lots of model railroad projects I'll have to check out, especially useful for automated display layouts. BTW: A couple of the pictures are upside down of your instructables.

Thanks for sharing.

- Jim B.
Baltimore Society of Model Engineers, Estd. 1932
O & HO Scale model railroading
Check out BSME on: FacebookInstagram
skiloff's picture

Cool

I used JMRI and a blue tooth receiver to control my trains with a WiiMote about 8 or 9 years ago.  I thought I documented it here, but I can only find references that I was going to try it.  It worked OK.

Dave

Building a TOMA HO Scale '70s/80s era
GMT-6

Thank you.

I have tried rotating the pictures after re-uploading them but I don't know how they turn upside down. I'll try again, hopefully, they will remain in the correct orientation now.

Thank you

Why don't you make an Instructable of your project. On Instructables, people from all across other hobbies can check your project and learn from it, your project might spark a new hobby in someone.

DHfan73's picture

This is very awesome! I

This is very awesome! I seriously might do this once my brother is done playing with our Wii. Or I could just get a controller at a local game store for about 5 bucks.

Harrison

Homeschooler living In upstate NY a.k.a Northern NY.

Modeling the D&H in 1978.

Route of the famous "Montreal Limited"

Thanks!

You can use a Wii Nunchuck breakout adapter which can allow us to make wiring connections without cutting away the connector of the remote, or you can also use an extension cable for the Nunchuk to connect it to the microcontroller.

All the best!

DHfan73's picture

Awesome! I'll look into that.

Awesome! I'll look into that.

Harrison

Homeschooler living In upstate NY a.k.a Northern NY.

Modeling the D&H in 1978.

Route of the famous "Montreal Limited"


>> Posts index


Journals/Blogs

Recent Blog posts: