Control Toy Train With Wii Nunchuck

- by - in Games

FE21LDUG4D5XD8M.LARGE

Most techies of a certain age will have fond memories of a certain tech in their childhood: toy train sets. Countless hours were spent making tracks around the living room – running the track around the couch and under tables. It’s only natural for such a childhood memory to be manipulated by makers, especially as it uses low DC voltage to power the trains. So what part do we hack? The train controller!

The usual way to control the movement of a model train is to use some kind of potentiometer to control the voltage to the train track lines. This is all well and good, but simply applying some power to the model doesn’t give any kind of real-world feel. A train doesn’t instantly set off at 100mph; it slowly accelerates. Ken from MakersBox has created a guide to show how to hack a Wii Nunchuck to be a train controller.

The train is controlled via an Arduino and motor shield
The train is controlled via an Arduino and motor shield

Combining an Arduino with a motor shield allows the control of a motor in a similar manner to a potentiometer. Instead of changing the resistance of the circuit (and thus reducing the voltage), this circuit uses PWM to provide variable power to the train motor. Hacking the Wii controller allows access to the various controls: a 2 axis joystick, a 3 axis accelerometer, and a couple of push buttons.

Controlling the train is simple and intuitive. Move the joystick to control the direction the train accelerates. Once the train is moving, releasing the joystick will let the train ‘coast’ based on a drag coefficient. Pressing the Z button applies the brakes, and the C button activates cruise control. Adding this level of control makes operating the train both easier, and more fun. Ken has made this project in a way that’s easy for a child to operate, sharing the fun of his train set.

You can read about the build at the Instructables page. If you decide to build your own, you can take advantage of the accelerometer, possibly changing signals with the flick of a wrist. It’s a great project, that is not only fun, but shows how a Wii Nunchuck can be used creatively in a project.

Adam RogersAdam RogersI am the the founder and editor of Codeduino. I'm a developer by trade, and a maker by night. I've been 'making' ever since being introduced to Arduino at university - my final year project was an Ableton Live controller based on Arduino.

SHARE THIS

Leave a Reply

Your email address will not be published. Required fields are marked *