3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.


USB Mouse Made Out Of A Wii Nunchuck

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 1Materials

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. 

« Previous StepDownload PDFView All StepsNext Step »
25 comments
Feb 29, 2012. 8:59 PMChristaky says:
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 :(
Feb 15, 2012. 7:01 PMGofishRC007 says:
could you use a old computer mouse chip and re solder the wires to the controller wires instead of buying the programing chip?
Feb 4, 2012. 10:43 AMfkkd3f says:
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
Nov 13, 2011. 7:21 PMalex-sharetskiy says:
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?
Oct 17, 2011. 9:32 PMTheCrawfordGuys says:
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?
Jul 21, 2011. 8:29 AMyaly says:
what did you do about the accelerometer in the NunChuck.
Sep 5, 2011. 12:05 PMzcbaker says:
I would like to use the Nunchuck as a mouse as well as a joystick. How could I do that?

Thanks
Aug 26, 2011. 6:38 PMTheWaddleWaaddle says:
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
Sep 5, 2011. 9:15 AMTheWaddleWaaddle says:
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
Jul 28, 2011. 3:56 PMFutrixEnterprises says:
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!
Aug 3, 2011. 6:19 PMFutrixEnterprises says:
Also does anyone know of a scroll ball type nunchuck?
Aug 4, 2011. 7:01 AMo0ICE0o says:
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.
Jul 21, 2011. 10:41 AMducktape3618 says:
i hear 30 seconds to mars - this is war at the background <3
Jul 20, 2011. 9:57 PMfrank26080115 says:
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.
Jul 20, 2011. 10:07 AMPKM says:
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.  
Jul 21, 2011. 8:11 AMbrssnkl says:
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.
Jul 20, 2011. 5:44 PMSchmidty850 says:
Does this software have the capability to make it a joystick?
Jul 20, 2011. 2:28 PMpampim says:
could you detail the steps has welded or simplify the schéma

very nice idea
Jul 20, 2011. 7:21 AMvalhallas_end says:
Very nice...I'm highly tempted to try this right now. Nicely written 'ible, too. Kudos!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
6
Followers
1
Author:ampu