Today, more and more devices are using motion control. From tablets to cellphones to game consoles, people are getting used to interacting with electronics using gestures. Personal computers, however, have lagged behind a bit. Unable to find a suitable gestural controller for my Windows PC on the consumer market, I set out to build my own.
I based my design on the Wii Nunchuk controller for several reasons. First, it’s a versatile, comfortable, well-designed controller; second, it‘s cheap and easy to find; and third, its native I2C serial protocol is easy to interface with Arduino. As a bonus, the connector will accept standard jumper wires, so there’s no need to cut up the cable or use a dedicated adapter.
The Arduino runs a sketch that reads data from the controller and prints to the computer’s serial port. The computer runs a Python script, which receives serial data and emulates a mouse.
- Nintendo Wii Nunchuk controller — $17; third-party controllers may not work.
- Arduino Uno microcontroller — item #MKSP11 from Maker Shed (makershed.com), $35
- 140mm male/male jumper wires (4) — item #MKSEEED3 from Maker Shed, $9/65
- Windows PC — Mac/Linux users will have to adapt the Python script.
- Download the Arduino IDE for Windows at arduino.cc/en/Main/Software.
- Download the ArduinoNunchuk library at github.com/GabrielBianconi/ArduinoNunchuk.
- Download Python 2.7.2 for Windows at python.org/ftp/python/2.7.2/python-2.7.2.msi.
- Download the pyserial module at pypi.python.org/pypi/pyserial.
- Download pywin32 at makezine.com/go/pywin32.
- Download the Python script at makezine.com/go/nunchuk.
MAKE Volume 33 features our special Software for Makers section covering apps for circuit board design, 3D design and printing, microcontrollers, and programming for kids. Also, meet our new Arduino-powered Rovera robot and get started with Raspberry Pi. As usual, you’ll also find fascinating makers inside, like the maniacs on our cover, the hackers behind the popular Power Racing Series events at Maker Faire.
Try your hand at 22 great DIY projects, like the Optical Tremolo guitar effects box, "Panjolele" cake-pan ukelele, Wii Nunchuk Mouse, CNC joinery tricks, treat-dispensing cat scratching post, laser-cut flexing wooden books, sake brewing, growing incredibly hot “ghost chili” peppers, and much more.