Want to hook up a Wii Nunchuck to an Arduino but don’t want to cut up the cord on your Nunchuck? Yeah me too. So I made some of these:
It’s a small PCB that adapts the Wii Nunchuck connector to standard 4-pin header. I call it the “wiichuck adapter”. It plugs directly into the Arduino, no wiring necessary. You can get one too for $4.
Available from the following wonderful shops:
– FunGizmos.com. FREE DOMESTIC SHIPPING. International shipping for $1 more.
– Little Bird Electronics (Australia)
– SparkFun. Ships domestic & internationally. Be sure to order header pins too!
– and just about any SparkFun distributor
One of the coolest things about the Wii (to me) is that the expansion port on the bottom of the Wii remote is an I2C serial connection. This means that anything that plugs into that port can work with microcontrollers like the Arduino or Basic Stamp or others. Of the available peripherals, the Wii Nunchuck is one of the best. It contains a 3-axis accelerometer, a 2-axis joystick, and two buttons. Hooking up a Wii Nunchuck to Arduino is easy and I have class notes describing how to do it. But cutting off the connector of the Nunchuck to get at the wires is a little drastic.
This “wiichuck adapter” let’s you play with the Wii Nunchuck and other Wii remote peripherals without needing you to cut cables. Just plug it into the Wii Nunchuck, then into the Arduino, in to Analog In pins 2,3,4,5. Pins 4&5 are the I2C communication pins and Pins 2&3 can act as the power supply for the Nunchuck.
This is what it looks like plugged into the Nunchuck by itself.
Nunchuck and Other I2C Devices (like BlinkM)
You can use other I2C devices at the same time as the Nunchuck. The I2C bus allows for multiple devices. For instance, if you have a BlinkM and also want to use a Nunchuck, no problem. The pinout of the BlinkM and the wiichuck adpater are the same. Just solder a little 4-pin socket header to the top of the wiichuck adapter.
And then you can plug in a BlinkM right on top.
Software
To make it a little easier to play with the Nunchuck, I made a little Nunchuck library for Arduino and demo:
– nunchuck_funcs.h
– WiichuckDemo.ino
(Or better yet, check out the github repository for it all zipped up. Just unzip and open the .ino in Arduino)
It is based off the original research done by Chad Philips of Windmeadow Labs. The library uses the Wiring I2C library called “Wire”. This library is built-in to Arduino, as long as you have the latest Arduino development environment (0010 currently). To see another Arduino sketch using this library, you can check out the BlinkMChuck example that’s part of the BlinkM examples.
The library functions are:
– nunchuck_setpowerpins()
— power up a nunchuck plugged directly into an Arduino on analog pins 2,3,4,5.
– nunchuck_init()
— init a nunchuck connected to an Arduino
– nunchuck_get_data()
— get a data packet from the Nunchuck
Then you can get at the data packet using various helper functions like:
– nunchuck_accelx()
— get X-axis acceleration
– nunchuck_zbutton()
— get Z-button state
– …and so on, see the header file for a complete list
Nunchuck Information
– Wiimote/Extension Controllers/Nunchuk — info page about the Nunchuck on WiiLi (Linux for Wii) site
– “Wiimote Accessory Bus” — docs about the Nunchuck’s connector.
Getting One / How to Order
Available from the following wonderful shops:
– FunGizmos.com. International shipping for $1 more.
– Tinker.it (UK)
– Little Bird Electronics (Australia)
Update 20 Feb 2008: Over 200 wiichuck adapters sold to more than 50 people in 5 countries. I still have some available if anyone wants one. To those who ordered up to now, you’ll be getting them in the post in a few days.
Update 29 Feb 2008: Over 300 wiichuck adapters sold and I still have many more left. Get yours if you want one. :-) Anyone that’s ordered before today should receive their adapters via first class post soon. I’ll be unable to mail out any orders for the first week of March.
Update 24 Mar 2008: I still have several left. If you’re in AU, you can also get the adapter kit from Little Bird Electronics.
Update 11 Apr 2008: Updated the nunchuck_funcs.h
library to easily work with a nunchuck plugged directly into an Arduino by adding a nunchuck_init_with_power()
function (see comments below). Also, I still have several adapter kits for sale.
Update 6 May 2008: All Out! But I’ll be doing another board run in a few days and will update here when I have more available.
Update 8 Jun 2008: FunGizmos.com is now carrying Wiichuck adapters! They also have lots of other cool things, like BlinkMs. :-)
Update 7 Jan 2009: Both FunGizmos.com (US) and Tinker.It(UK) carry the Wiichuck adapter.
Update 31 Mar 2009: Fixed small bug that made it not compile under more recent Arduino, and fixed links. Also: if you’re having problems getting this to work, in the Arduino software, go to the “Boards” menu, switch to a different Arduino board type, compile, then switch back to your type. This forces a recompile of the Arduino I2C/TWI library that sometimes doesn’t get compiled correctly.
Update 18 Feb 2010: Updated API description to note that “nunchuck_init_with_power()” was removed in favor of “nunchuck_setpowerpins(); nunchuck_init();”.
Update 6 Dec 2011: Updated to work with Arduino 1.0 (still works with Arudino 0023 too). Changed download links to github repository.
Hi Cody,
If you want the Wii nunchuck to be a true mouse for Windows XP, then you’ll probably want to connect it to a Wii remote and then connect that via Bluetooth to your PC. There are several programs and libraries out there that take the Wii remote data (including Nunchuck info) and turn it into system events. Do searches on Hackaday.com and Makezine.com or just search for “wii remote hacking” or similar.
But because I think Arduino is so awesome, I think you should also get an Arduino and play with the Wii nunchuck that way. :) The Arduino looks like a serial port to your PC, so any programming language on Windows can access it. (but you’d have to write the program on the PC to take data from the Arduino and do something with it)
I am trying to find a way to use a wiichuck for a mouse on windows xp. Is this adapter and the Arduino the right things to get? I have no previous experience modding or using something like the arduino. Thanks.
How long does it take for the wii adaptor to arrive after we ordered it?
Hi Tod, the fix to get nunchuck_funcs.h to work correctly under Arduino 0012 is actually pretty simple.
Only one line needs to be modified:
#include
changes to
#include “WProgram.h”
This seems to work pretty well on my Diecimila, with no side-effects that I have found…
Hi Christopher,
Yes, soldering the female header on top is tricky. And requires you have 4 hands. :) What I did was to hold the adapter in a helping hands tool. Then as I was holding the female header aligned to the top of the adapter, I used a soldering iron that had a bit of fresh solder on its tip to tack down one of the header pins. With that one pin tacked, the female header stayed in place, so the other three pins could be properly soldered. Finish it off by properly soldering the tacked pin.
You’re probably saying to yourself that the result sounds like a pretty mechanically flimsy result. And you’re right, it can be because it’s just solder holding it together. You can minimize this by pushing the female header pin in the hole a bit while the solder is liquid.
I can not figure out how to solder the example at the top of the page for adding the female header to the wiichuck board. I’m pretty new to soldering. Both sets of header pins will not fit thru the hole. Am I just supposed to “do my best” or is there some sort of secret? Thanks.
Hi Mau,
Are you using Arduino 0012? There have been some changes in Arduino 0012 that make it harder to use the nunchuck_funcs.h library (and other “libraries” contained in a .h file)
To get around this, either use Arduino 0011 (you can have both on your computer at the same time with no problem). The other way is to insert some code statements above the #include line, like this:
Hi tod, i have some troubles with adding the nunchuck_funcs.h library, i just move the .h file into the arduino’s libraries folder. But i cant use it, some errors appear when i try to include in some other code. So, can i ask you for a ZIP folder with your nunchuck_funcs library from arduino’s libraries?? do i need .cpp and .o files too??
Hey Tod,
I’ve used this great adapter in both my electric canoe and espresso machine. It’s awesome. One thing I’ve noticed after extended use and in rough environments (a vibrating motorized boat or hot and steamy espresso machine) is that the connection can begin to gently fail. I assume from the combination of connector stress, maybe some tarnishing, and de-springing of the contacts. Since i2c connection loss appears to crash everything, even a momentary tickle is trouble! Picture me quickly shutting down a boat I just lost control of. Luckily, the solution is only a few tiny solder blobs away. I dabbed on small (< .5 mm) solder blobs on the contacts, and this seems to cure the trouble. On my first pass, I dabbed on a little too much, and just filed it down to where it doesn’t get difficult to plug in.
Anyways, a little tip for anyone with extended use apps.
Hi Oscar,
As mentioned in the post, FunGizmos.com sells them. And they’ll ship to Mexico.
paypal is still accepted? can you ship it to mexico?
> can anyone make one of these for an ipod?
Like this? Not sure if this is what you’re looking for.
http://www.sparkfun.com/commerce/product_info.php?products_id=8295#
can anyone make one of these for an ipod?
Hi,
I don’t have the shipping for the adapters quite right in the store yet. The plan is to only charge an additional $1 for international adapter orders. Until I get it fixed go ahead and make an order and the shipping will be free! (Wii Adpaters Only)
Will