“WiiChuck” Wii Nunchuck Adapter Available

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:

wiichuck_adapter1.jpg

wiichuck_adapter2.jpg

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.

wiichuck-diag.png

This is what it looks like plugged into the Nunchuck by itself.

wiichuck_adapter3.jpg

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.

wiichuck-header.jpg

And then you can plug in a BlinkM right on top.

wiichuck-blinkm.jpg

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.

299 Replies to ““WiiChuck” Wii Nunchuck Adapter Available”

  1. Think I modified your last comment to show what you mean. (have to do “<<” and “>>“)

    And to anyone else: if you want 10-bit range (0-1023) instead of 8-bit range (0-255) from the nunchuck accelerometer, replace the nunchuck_accel{x,y,z}() with the ones JeffH shows.

  2. The formatting didn’t work the second time either. It’s the brackets messing things up. Let’s try this, replace the shift operators with the proper syntax:

    static int nunchuck_accelx()
    {
        return ((int)nunchuck_buf[2] << 2) 
                 + ((nunchuck_buf[5] >> 2) & 0x03);
    }
    

    I could send you my modified nunchuck_funcs.h file if you want. Oh, and of course the 10 bit range should be 0 – 1023 :)

  3. Hi Jeff,

    (fixed the code formatting of your comment, gotta use pre tags)

    For “nunchuck_accelx()” I’ve never seen “<>” as an operator before, what is that supposed to be? Did the formatting get screwed up still? I didn’t include the extra 2-bits of resolution in the accelerometer outputs because a) I’m lazy and b) I find that people really don’t even need 8-bits of accelerometer data.

    And those one-liners for the zbutton and cbutton are much clearer. I think I did the ternary if-then so it was blatantly obvious what the two return values would be.

  4. I’m afraid there are some bit manipulation errors in the accelerometer decoding. The 8 most significant bits are stored in one byte and the 2 lowest bits are stored in byte 5. The function for x should be:

    static int nunchuck_accelx()
    {
        return ((int)nunchuck_buf[2] <> 2) & 0x03);
    }
    

    y and z are similar, just replace buf[2] with 3 and 4 respectively. This should give you the full 10 bit range (0 – 1024).

    The button functions can also be simplified as follows:

    static int nunchuck_zbutton()
    {
        return ((nunchuck_buf[5] & 0x01) == 0x01);
    }
    static int nunchuck_cbutton()
    {
        return ((nunchuck_buf[5] & 0x02) == 0x02);
    }
    

    Keep up the good work!

  5. Ok, thanx for the link FunGizmos.com, it works perfectly to buy 2 nunchuck adaptors. (this is not the case for Tinker.it because of the weight)
    Best regards.

  6. Hi Jack,
    I’m unclear why you think Tinker.it is down. They are very much alive. Did you click on the Tinker.it link above that takes you directly to their wiichuck adapter page where you can add it to your cart?

    If Tinker.it are out, both FunGizmos.com and Sparkfun.com (linked above) have wiichuck adapters and will ship internationally.

  7. Hello,
    Thanx again for your nice job.
    I would like to order 2 nunchuck adaptors on tinker.it but it seems that it is impossible. I contacted them but no answer. Maybe this company is closed ?
    Can i order directly the 2 nunchuck adaptors and header pins to you with Paypal ?
    Best regards.

    Jack

  8. Michael, thank you so much for working on the wireless nunchucks and pointing towards the way to getting the MotionPlus working. I can’t wait to get some time to fix up Nunchuck_funcs.h to use both of these devices!

  9. For the Drum Controller you can try to use the same initialization I used here: http://www.windmeadow.com/node/42#comment-3130 (copy the code beginning at “The whole code put together”).

    This method of initialization disables the encryption to the controller and hpefully works also for the drums.

    To decode the telegrams, you can start using the information from
    http://wiibrew.org/wiki/Wiimote/Extension_Controllers#Guitar_Hero_World_Tour_.28Wii.29_Drums

    You have to adapt the decoding which is done in print().

  10. I’m trying to hack a Tatacon Drum controller with Arduino, too. It is supposed to connect to the Wiimote like the Nunchuk does.

    http://www.dealextreme.com/forums/Forums.dx/Forum.-206~threadid.282467

    Also, I followed the steps from here on how to connect the Nunchuk to an Arduino, and replaced the Nunchuk with the drum controller:
    http://hacknmod.com/hack/how-to-cheap-accelerometer-using-wii-nunchuck/

    The serial debug output shows a feed of data, but I still have to decipher them; appearantly, the drum controller gives off data different from the Nunchuk.

    I am curious, is there anyone who attempted a similar hack out there?

    Thank you.

  11. Yay, glad things are working. Cold solder joints occasionally bite me still too. Getting a loupe or other magnifier can make it easier to inspect the joints.

  12. Todd- My abject apologies; as I started taking macro pictures of the adapter per your request I could see that one of the solder beads was not quite making contact. I resoldered the pin and all is working as expected. – thanks again, BPA

Leave a Reply

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