Instructables
Picture of USB Mouse Made Out Of A Wii Nunchuck
This instructable will describe how to convert a Nintendo Wii Nunchuck controller into a USB 2-button mouse using a Teensy USB.  The Teensy USB is a very user-friendly development board that can be programmed in an Arduino environment. The Teensy USB development board and necessary software are available at www.pjrc.com

Check out the final product in action!
http://www.youtube.com/watch?v=YBNEImY_uzQ
 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

This is what you'll need:

Components:
-  Nintendo Wii Nunchuck Controller, available at various retailers
-  Teensy 2.0 USB Development Board, available at www.pjrc.com
-  USB cable, available at www.pjrc.com
-  Breadboard (for prototyping), available at www.sparkfun.com
-  22 Gauge Wire, available at www.sparkfun.com
-  Solder, available at www.sparkfun.com

Aside from the components listed above, you should have access to various tools such as a soldering iron and ancillary hand tools. Additionally, you should have basic soldering skill and working knowledge of the Arduino environment before embarking on this journey. 

Step 2: Nunchuck disassembly

Remove the two screws on the underside of the Nunchuck controller using a tri-wing screwdriver and un-clip the top shell of the Nunchuck to expose the electronics.

Remove the electronics and un-clip the two hooks of the white molded plastic part at the center to access the electrical connectors of the x and y-axis potentiometers.

Remove the flexible membrane to access the electrical connectors of the C and Z buttons. The middle connection (red wire) is the Z button and top connection (black wire) is the C button.
mike.t.dixon2 months ago

can this be done without chopping up the nunchuck??

Ravirar9 months ago

is this a mouse as in the joystick is the cursor and the Z/C buttons are right/left click? if so, cool!

Please provide details for where the ground, 5v, and output of each potentiometer is located. It looks like you have some wires that run up underneath the analog stick that aren't in the "pre-instructables" nunchuck...

Did you work out any solution to this? I'm trying also to figure out the outputs of the potentiometers...

I'm having a hard time figuring out which wires inside the nunchuck correspond to the buttons/joystick. Could you post some sort of color chart or some other explanation.
toploader1 year ago
I am having trouble downloading the code, could you possibly email it to me, also how would I go about programming a third button to use as a scroll button, like when you click the scroll wheel on a mouse, thanks
Christaky2 years ago
I am having trouble downloading the code. I have the same problem as TheWaddleWaaddle does. I am downloading it as a .tmp file instead of a .pde file. I NEED HELP PLEASE :(
GofishRC0072 years ago
could you use a old computer mouse chip and re solder the wires to the controller wires instead of buying the programing chip?
fkkd3f2 years ago
Hi,

je parle que le français, je sui très intéressé par ton nunchuck.

Je voudrais t'en achté un peut tu m'en faire un je te paie d'avance.

merci de me répondre j'attend avec impatience best regard
Sandisk1duo3 years ago
Would this work for all computers? What i mean is, if you plug the usb plug into another computer without any software, would it run like a regular mouse? I guess what i'm asking is, do you need pre-installed software to be able to use the mouse?
ampu (author)  Sandisk1duo3 years ago
There is no software required. The controller mimics a mouse/keyboard, so it'll work on any PC, not sure about macs. Thanks for your interest!
I'm having trouble figuring out some of the connections, the picture of your breadboard shows 6 wires, going by the directions and my sparse knowledge I end up with 9. I understand the center pin for each POT and the connections for the C and Z buttons, but the voltage and ground are where I'm off. From what I can glean from wiired.org and your pictures 3 of your connections go to the 3rd pin(yellow/clock wire) on the nunchuck, I can't figure out what they are or what they are for. I have a connection from each POT's left pin to the voltage, and a connection from each POT's right pin to the ground, all from the point of view of looking at the bottom side(chip side). So, I guess my question is: Am I supposed to use the linear pin connections? Also, can I just connect Tweeny's voltage and ground to the pin 1(red) and pin 5(white) respectively?
yaly3 years ago
what did you do about the accelerometer in the NunChuck.
ampu (author)  yaly3 years ago
I chose not to use it. We had a "presentation mouse" at a previous job that used accelerometers to point, but it was very shaky and didn't have enough accuracy to be useful.

However, as I understand it, the accelerometers output analog data just like the potentiometers so it would be very difficult to add them for a scrolling function or something else all together. The only tricky part would be to find where the accelerometer outputs are located on the nunchuck circuit board.
zcbaker ampu3 years ago
I would like to use the Nunchuck as a mouse as well as a joystick. How could I do that?

Thanks
I am having troubles with viewing the code. Everytime I click on it it turns into a random jumble of HTML. Does anyone know why this is happening? I have the Arduino IDE, so that's not a problem.

-TheWaddleWaaddle
ampu (author)  TheWaddleWaaddle3 years ago
I just tried and it worked fine for me, maybe the instructables site was acting funny when you first tried it. Please let me know if you have any other issues, if need be I'll be happy to email it to you directly.

Thanks for the interest!
ampu,
I downloaded a different browser to see if it was my browser, but whenever I download it, it turns from "teensy_mouse_clean.pde" to "F0T0YIKGQ5Q49T.tmp", which the Arduino IDE continually refuses to open. I tried converting it to a .pde file, but none of my attempts worked. If you could, could you please email it to me directly? God bless you for your help!

-TheWaddleWaddle
Hey dude I think the idea is great because I have a muscular syndrome that makes holding my arm up at a desk really painful over a period of time. I currently use a thumball mouse but they are hard to come by on the shelf and I'd like to give this a go for comfort.

I haven't got your skills, knowledge and talents I was wondering if I could buy a working model off you? If I can can I use a really groovy nunchuck as the base or do the covers come separate? I'm in my 40's now so a little old to know about the latest gaming platforms as I havent had them due to my condition but this may open my world to a lot of other gaming capabilities through the PC. I would especially like to try a first person shooter but using arrow keys etc has been a really bad experience for me.

Thanks for any feedback dude!
Also does anyone know of a scroll ball type nunchuck?
You could program a macro that when you pressed the second button on the nunchuck and moved the thumbstick it would be like a scroll wheel.
i hear 30 seconds to mars - this is war at the background <3
ampu (author)  ducktape36183 years ago
Good ear!
Use one of those wireless Nunchuks. I know you used the potentiometer readings directly, but you can also communicate with the Nunchuk via I2C, which would solve this problem, allowing you to use wireless Nunchuks.

In your code, you seem to have defined center analog values as constants. Although it works, I'm not sure if the same values would work for everybody. If anybody attempts this project and experiences the mouse cursor slowly "drifting", you would need to make changes to those constants.

This may become a major issue as the Nunchuk becomes older, wear and tear might prevent the joystick from returning to the true center position. Or some "play" might develop in the joystick mechanism.

One technique to solve the above problem is to take one reading upon power-up, making sure that you let go of the joystick during power-up. Use that initial reading as the center reading instead. This technique is essentially re-calibrating the center value upon every power-up

Another technique is to simply implement a "dead zone" in the center such that if the joystick is anywhere within this "dead zone", then you don't actually move the mouse cursor. This technique is implemented inside the Wii Classic Controller's firmware (at least in my knockoff version) and my MadCatz PS2 controller.
ampu (author)  frank260801153 years ago
Excellent observations! I set up the constants and dead band values based on what my nunchuck was outputting. I wrote a simple program that outputted the potentiometer readings to a serial output window using the "serial.print" function. Once I saw the neutral values and how they bounce around (3-4 points above or below), I inputted those values into the constants of the main program.

I'll upload that code shortly. Anyone interested in trying to make one can do this quick check during the breadboards prototyping step.

As for the reading the potentiometer value at start-up. That is a good idea, I'll look into it. Thanks for the input!
PKM3 years ago
Wait... the TeensyUSB can act as a USB mouse or keyboard? Just to clarify, do I need Processing or something running on my computer for this to work? To put it another way, could you plug your Nunchuck-mouse into a computer without any of the Teensy software on it and it would still work?

nerd-potential-gasm

This is the missing piece for a project I've been wanting to do (well, do properly) for so long... I'm going to have to get one.  
ampu (author)  PKM3 years ago
Yes, I can plug in my nunchuck mouse into any computer and it'll work. The Teensy works as a mouse or keyboard if you set it up to do so. Check out www.pjrc.com/teensy/td_mouse.html

The Teensy software is only needed to program it.
brssnkl3 years ago
this is nice but i am not good at hacking things so i use a program called joy to key. ( http://joytokey.webs.com/download.htm )
you can do almost everything with it.
Schmidty8503 years ago
Does this software have the capability to make it a joystick?
pampim3 years ago
could you detail the steps has welded or simplify the schéma

very nice idea
Very nice...I'm highly tempted to try this right now. Nicely written 'ible, too. Kudos!