Introduction: USB Mouse Made Out of a Wii Nunchuck

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

Check out the final product in action!

Step 1: Materials

Picture of Materials

This is what you'll need:

-  Nintendo Wii Nunchuck Controller, available at various retailers
-  Teensy 2.0 USB Development Board, available at
-  USB cable, available at
-  Breadboard (for prototyping), available at
-  22 Gauge Wire, available at
-  Solder, available at

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

Picture of 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.

Step 3: Prototyping on Breadboard

Picture of Prototyping on Breadboard

As good practice you should always prototype your project on a breadboard. The Teensy 2.0 comes with optional header pins making prototyping a breeze. Connect the Teensy controller to the inputs of the Nunchuck controller in the following manner:

Teensy              Nunchuck
GND                  Ground (each potentiometer and buttons)
+5V                    5 Volts (each potentiometer)
F0                      X-axis potentiometer output
F4                      Y-axis potentiometer output
D2                     C button
D3                     Z button

Once you've connected everything per the table above, you're ready to program. In addition to putting the attached code into the Arduino window, make sure the settings are correct for this project. The board should be identified as "Teensy 2.0" and the USB Type "Keyboard + Mouse".

Upload the code and press the reset button on the Teensy. Play around with the joystick and both buttons to confirm everything is working the way it should. A simple mistake would be to mix up the X and Y directions or the C and Z buttons, but that can be easily fixed by swapping the connections on the breadboard (another good reason you should always prototype everything).

Step 4: Final Assembly

Picture of Final Assembly

Once you have the code right on the Teensy it's time to prepare all the components for final assembly.

Nunchuck shell modifications
- Trim both halves of the shell as detailed in the pictures to make room for the additional hardware

Electronics modifications
- Using a soldering iron, remove all header pins from Teensy board
- Trim and strip all wires coming from the Nunchuck electronics and solder them directly into the Teensy board. You're working with in  snug quarters so make sure you make your assembly nice and tight.

After those simple modifications have completed the electronics should fit right into the lower half of the shell. Once the electronics are in, all you need to do is snap the halves back together and install the screw into the remaining screw hole. Plug it in and enjoy!


RobinZ14 (author)2017-03-08

Im making my own wii nunchuck mouse, but swapped the joystick for 1 with a button in it. I had some trouble hooking up the C and Z buttons, and found out you apparently made a mistake. The black wire goes to ground, the red and white wire are for the C and Z buttons (use INPUT_PULLUP).

TheWaddleWaaddle (author)2011-08-26

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.


After some trying i decided to download the code, but chose file type as 'all types', and added .pde after the file name (making it a .pde file). After that i opend the file in Code::Blocks and...tada! the code! (I hope) Im gonna test it after hooking it all up, but it seems to be it :D Heres the code:

signed int xanal;

signed int yanal;

int mouse_l;

int mouse_r;

unsigned int i = 0;

#define x_t_low 190

#define x_db_low 480

#define x_ctr 123

#define x_db_hi 505

#define x_t_hi 772

#define y_t_low 222

#define y_db_low 520

#define y_ctr 133

#define y_db_hi 550

#define y_t_hi 831

void setup() {




void loop() {

signed int xmove = 0;

signed int ymove = 0;



// linear - low speed

if (xanal < x_db_low && xanal > x_t_low || xanal > x_db_hi && xanal < x_t_hi) {

xmove = ((xanal / 4) - x_ctr)/18;


if (yanal < y_db_low && yanal > y_t_low || yanal > y_db_hi && xanal < x_t_hi) {

ymove = (-1*((yanal / 4) - y_ctr))/18;


// linear - turbo

if (xanal < x_t_low || xanal > x_t_hi) {

xmove = ((xanal / 4) - x_ctr)/12;


if (yanal < y_t_low || yanal > y_t_hi) {

ymove = (-1*((yanal / 4) - y_ctr))/12;



// click and drag

// right click

if(digitalRead(7) == HIGH)

{ if(digitalRead(7) == LOW)


mouse_r = 1;

} else {

mouse_r = 0;


} else {

mouse_r = 1;


// left click

if(digitalRead(8) == HIGH)

{ if(digitalRead(8) == LOW)


mouse_l = 1;

} else {

mouse_l = 0;


} else {

mouse_l = 1;


Mouse.set_buttons(mouse_r, 0, mouse_l);


ampu (author)TheWaddleWaaddle2011-09-05

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!

RobinZ14 (author)ampu2017-02-17

same problem here... cant download code propperly. Maybe post the code as a comment, so we can copy paste it?

TheWaddleWaaddle (author)ampu2011-09-05

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!


KevinM486 (author)2016-11-20

Fantastic project! Could you please include a photo showing how the wires connect to the nunchuck pcbs? You cannot see that at all in your photos. THNX!!

Sandisk1duo (author)2011-11-13

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)Sandisk1duo2011-11-14

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!

Nickw50 (author)ampu2016-03-31

what 'bout chrome os?!?!?!?!

BenjaminK15 (author)Nickw502016-05-23

The controller mimics a mouse/keyboard.

TricksterG (author)ampu2015-12-07

It should work on a mac.

cndg (author)2016-02-27

It would seem a much better idea to connect the nunchuck using it's existing wires instead of pulling it apart.

Here is how:

D4rk_F1r3 (author)2015-09-18

Is it work with teensy 3.1.

mike.t.dixon (author)2014-09-25

can this be done without chopping up the nunchuck??

Ravirar (author)2014-03-13

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

juanbajista (author)2013-09-26

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...

haikala (author)juanbajista2014-01-14

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

cdougherty3 (author)2013-06-07

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.

toploader (author)2013-02-13

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

Christaky (author)2012-02-29

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 :(

GofishRC007 (author)2012-02-15

could you use a old computer mouse chip and re solder the wires to the controller wires instead of buying the programing chip?

fkkd3f (author)2012-02-04


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

TheCrawfordGuys (author)2011-10-17

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 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?

FutrixEnterprises (author)2011-07-28

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.

yaly (author)2011-07-21

what did you do about the accelerometer in the NunChuck.

ampu (author)yaly2011-07-21

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.

ducktape3618 (author)2011-07-21

i hear 30 seconds to mars - this is war at the background <3

ampu (author)ducktape36182011-07-21

Good ear!

frank26080115 (author)2011-07-20

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)frank260801152011-07-21

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!

PKM (author)2011-07-20

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?


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)PKM2011-07-21

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

The Teensy software is only needed to program it.

brssnkl (author)2011-07-21

this is nice but i am not good at hacking things so i use a program called joy to key. ( )
you can do almost everything with it.

Schmidty850 (author)2011-07-20

Does this software have the capability to make it a joystick?

pampim (author)2011-07-20

could you detail the steps has welded or simplify the schéma

very nice idea

valhallas_end (author)2011-07-20

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

About This Instructable




More by ampu:USB Mouse Made Out Of A Wii Nunchuck
Add instructable to: