Wii Nunchuck Adapter

Introduction: Wii Nunchuck Adapter

This tutorial is for all those people who have an arduino and want to use there Wii nunchuck as an input device, but dont realy feel like cutting open the cord and ruining the nunchuck FOREVER!!!!!!!!

well youve come to the right place!

Step 1: Supplies

These are the supplies you will needmost can be found at radioshack and at hardware stores.if you cant find any etchant solution i made my own on STEP 6.+ iron+scisors+tape+soft gloss photo paper+arduino+wii nunchuck+LED's+brake cleaner+etchant solution (is makeable, see step 6)+double sided PCB .062" thick (you do have a bit of lee way)+solder+hack saw

Step 2: Printing Our Transfers

For those of you who want to do it old school style...
start by downloading DipTracehttp://www.diptrace.com/download.php
and the Wii Nunchuck layouthttp://www.megaupload.com/?d=0212FN11
1. install diptrace by following all the on screen instructions
2. Start Diptrace
3. go to file>open and locate "wii_nun_chuck_adapter.dip" (image 2)
4. click open
5. go to view> click mirror (so it is checked)
6. now it should look like image 3
7. Load a piece of photo soft gloss paper into your printer (image 4)
8. now go to file>print> and select your laser printer (image 5)
9. press PRINT.
10. now you should have a nice looking transfer.
WOOO HOOOO we are almost there. sorta

Step 3: Preping the Transfer

1) no that you have your printed sheet of PCB transfer. pick one and cut it out like i have in image 1. 2) Now what we want to do is fold the paper so the two sides line up. you can use a light to help you look through the paper. 3) once its lined up make a nice clean crease. (image 2)4) now we use some tape to make sort of a tube that the PCB will slide into. (image 3)5) the transfer is readynext step is to cut and prep the board.

Step 4: Cutting and Preping the PCB

for this step i dont have very many pictures but its pretty much straight forrow1) Remove your new board you just bought at radioshack from its bag2) I recomend cutting out one of the transfers and using it as a template to get the dimensions right3) place the transfer on the corner of the board and with a knife score around it4) Then i placed the board in my vice and used a hack saw to cut itor if you can get your hands on a band saw that would be much easier5) once the board is cut out. (image 1) take a peice of 800 grit sand paper and sand down the edges6) finaly clean of the board with some rubbing alcohal or water making sure to dry it good if used waternext we will transfer the design onto the board

Step 5: Transfering the Design

So we have our tube like transfer and out cut to size board. 1) take your board and slowly slide it into the transfer 2) next use some object (i used a paper clip) to try to adjust the board so it lines up with the design 3) now place the transfer and board on some surface. i put a paper bag down so it wouldnt mess up my desk. 4) now what ever iron you are using turn it up to the HIGH POSSIBLE SETTING (image 4) 5) once the iron is warmed up take it and press down on the board with about 20lbs of force for 20 seconds. (image 5) 6) turn it over and press for another 20 seconds. 7) turn it over again and let it cool for 1 minute or so and press for another 10 seconds. 8) turn it over again and press for another 10 seconds. 9) let it sit for 2 minutes. 10) now you can cut the tape and peel off the paper. hopefully the toner adheared to the baord. (image 6) 11) now go to your sink and using a paper towel and scrub off the white paper until you can see your crispy black lines. 12) if not use the brake cleaner and clean off the PCB completely and start over :(

Step 6: Etching the PCB

now that we have our PCB transfered and ready for etching.... um lets etch itMAKE YOUR OWN ETCHANT:Supplies+Muratic Acid (image 1)+Hydrogen Peroxide (image 2)+PLASTIC measureing spoon (CANT BE METAL CAUSE THE ACID WILL EAT IT!!!!!) (image 3)+and a PLATIC bowl (SAME REASONS)1) Measure out 2 quantities of hydrogen peroxide and pour it in your bowl.2) Measure out 1 quantity of muratic acid. Ex. 2 tbls of hydrogen peroxide, and 1 tbls of muratic acid. Keep in mind the 3 A's from high school chemistry class Always Add Acidalways pour acid into water or what ever you mixing not water into acid! 3) Now you have your own etchant solution.

ETCHING THE PCB:1) Go ahead and pour some etchant into a tuper ware bowl (if you made it you should already have it a bowl)2) Use a plastic fork to slowly lower the PCB into your etchant solution. being carful not to splash.3) Let it sit in the solution until you canot see any more copper, ecationaly lifting the board with the plastic fork just to get it all even.4) Once you think its done remove the board and rinse it off with water.5) get the brake cleaner and spray some on the board and scrub with a paper towel untill all the toner is off. Checking to make sure that all your traces are good and not broken.yess we are so close to finishing this thing i can almost taste it.

Step 7: Drilling Holes

DRILLING HOLES:this step is pretty self explanatory but....1) I would rather use a fine drill bit but those are hard to find so I went to the hardware store and bought a dremel bit set for 5 bucks. (image 1)2) Pick out the bit you want making sure that its not too big or too small, and put it in your drill press. (image 2)3) I put a piece of wood under my PCB (not actually the PCB cause I forgot to take pictures) so that it will be on a flat surface.4) Drill all the way through the tabs where we will put our header pins. DRILL DRILL AWAY. (image 4)

Step 8: Soldering on the Header Pins

SOLDERING ON THE HEADER PINS:+header pins+soldering iron+electronic solder (with flux perferd)this is kinda a pain cause we dont have the privalage of through hole soldering, so we have to solder on both sides of the PCB.1) place your header pin in the board2) Solder in each pin on the side that says "TOP"3) let cool4) turn the board over and romove the black plastic it should just slide right off.5) here comes the sort of hard part. solder the bottom of the pin and try to keep it relativly straight, or else it woulnt fit in the arduino. You must to this because we have a double sided pcb.6) try inserting it into the arduino and if it doesnt fit heat up the solder and adjust the pins as needed.

Step 9: Testing the Adapter

If you dont have the Arduino program installed yet then go to www.arduino.cc/en/Guide/HomePage and follow the arduino getting started tutorial.Part I1) DOWNLOAD these 2 fileswww.megaupload.com/www.megaupload.com/2) Create a new folder called "WiiChuckDemo" without the quotes.3) Place those 2 files in the folder4) Open up arduino IDE and goto file> open> and open "WiichuckDemo.pde"5) Upload that sketch to your arduino6) we are done with part 1

Part II+various jumper wires+4 leds+the nunchuck adapter+bread board or protoshield+and a wii nunchuck1) Plug in the adapter into analog pins 5,4,3, and 2 like image 1 shows.2) Now were are going to put in all our ground jumpers, in a "daisy chain" style. (image 2)3) Now put in all the wire going from the LED's positive legs to there coresponding pins on the arduino. (image 3)UP led= digital pin 4DOWN led= digital pin 5LEFT led= digital pin 2RIGHT led= digital pin 34) Now its time to place our leds into the bread board making sure that the short leg or the flat side on the led is in the ground, and the long leg is in the positive (or the wire going to the arduino digital pins) (image 4)5) plug in you wii nunchuck 6) power up your arduino7) and hopfully it will work if now leave a comment and i will try my best to help you.8) heres a demo video

Yeah, ditto on the "Megaupload got shut down by the FBI so what now?" problem. The Arduino forums allow up to four attachments (4 MB combined size) per Topic post, so that might be a solid option. Plus you're far less likely to be consorting with federal criminals!

hi,excuse me but i am really a newbee in arduino...i am trying to make this instructable, but when i want to load the sketch i have this error:-------------------------------------------------------------------------------------------------------------------In file included from WiiChuckDemo.cpp:2:/nunchuck_funcs.h:13:22: error: WProgram.h: No such file or directoryIn file included from WiiChuckDemo.cpp:2:/nunchuck_funcs.h: In function 'void nunchuck_setpowerpins()':nunchuck_funcs.h:24: error: 'delay' was not declared in this scope/nunchuck_funcs.h: In function 'void nunchuck_init()':nunchuck_funcs.h:33: error: 'class TwoWire' has no member named 'send'

As of Arduino 1.0, the Wire.send() function was renamed to Wire.write() for consistency with other libraries.

nunchuck_funcs.h:34: error: 'class TwoWire' has no member named 'send'

As of Arduino 1.0, the Wire.send() function was renamed to Wire.write() for consistency with other libraries.

/nunchuck_funcs.h: In function 'void nunchuck_send_request()':nunchuck_funcs.h:43: error: 'class TwoWire' has no member named 'send'

As of Arduino 1.0, the Wire.send() function was renamed to Wire.write() for consistency with other libraries.

/nunchuck_funcs.h: In function 'int nunchuck_get_data()':nunchuck_funcs.h:63: error: 'class TwoWire' has no member named 'receive'

As of Arduino 1.0, the Wire.receive() function was renamed to Wire.read() for consistency with other libraries.

/nunchuck_funcs.h: In function 'void nunchuck_print_data()':nunchuck_funcs.h:114: error: 'Serial' was not declared in this scope

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////i also tested various sketches from other instructables and i always have errors !with the included libraries i have no problem !!!what is it happening ?please help me !PS:i have the Arduino Mega Atmega1280 and use Arduino V1.0

Sorry i didnt reply earlier. Yeah i hate that new arduino 1.0, there's too many changes. All my libaries from before don't work on it. I'm just using Arduino 22 until they male some changes. See if it works with that

hello and happy new yearthanks for answering that quick !so it is due to the V1 ?!? i was searching the Arduino 22, but i cant find it ! could you please send me that version by mail please? tha would be very friendly...regards

hy, yes i found them, but nothing works, i mean, the sketches seem to install correctly, but nothing happens, only sometimes the led 13 keeping alive and my up and left led staying lighting with no change from nunchuck.the leds are new, the nunchuk too and even better i cutted the cable to connect directly on the board, so no false contact... but nothing...have tryed to send only the pde, then i try to send pde and h files and nothing... disapointed ! :( i think i'll wait you V1 version !thanks

hy again,now i placed the folder in C:\Documents and Settings\mich\My documents\Arduino\i open the .ino i converted before, start loading and now:----------------------------------------------------------------------------------------------------------------------In file included from WiiChuckDemo.cpp:2:/nunchuck_funcs.h:13:22: error: WProgram.h: No such file or directoryIn file included from WiiChuckDemo.cpp:2:/nunchuck_funcs.h: In function 'void nunchuck_setpowerpins()':nunchuck_funcs.h:24: error: 'delay' was not declared in this scope/nunchuck_funcs.h: In function 'void nunchuck_init()':nunchuck_funcs.h:33: error: 'class TwoWire' has no member named 'send'

As of Arduino 1.0, the Wire.send() function was renamed to Wire.write() for consistency with other libraries.

nunchuck_funcs.h:34: error: 'class TwoWire' has no member named 'send'

As of Arduino 1.0, the Wire.send() function was renamed to Wire.write() for consistency with other libraries.

/nunchuck_funcs.h: In function 'void nunchuck_send_request()':nunchuck_funcs.h:43: error: 'class TwoWire' has no member named 'send'

As of Arduino 1.0, the Wire.send() function was renamed to Wire.write() for consistency with other libraries.

/nunchuck_funcs.h: In function 'int nunchuck_get_data()':nunchuck_funcs.h:63: error: 'class TwoWire' has no member named 'receive'

As of Arduino 1.0, the Wire.receive() function was renamed to Wire.read() for consistency with other libraries.

hello again, i placed the .pde and the .h files to: libraries\Servo\examples\WiiChuckDemothen i renamed .pde to .inoi restart loading and now here is the error:----------------------------------------------------------------------------------------------------------------------sketch_jan01a.cpp:3:28: error: nunchuck_funcs.h: No such file or directorysketch_jan01a.cpp: In function 'void setup()':WiichuckDemo:16: error: 'nunchuck_setpowerpins' was not declared in this scopeWiichuckDemo:17: error: 'nunchuck_init' was not declared in this scopesketch_jan01a.cpp: In function 'void loop()':WiichuckDemo:27: error: 'nunchuck_get_data' was not declared in this scopeWiichuckDemo:29: error: 'nunchuck_accelx' was not declared in this scopeWiichuckDemo:30: error: 'nunchuck_accely' was not declared in this scopeWiichuckDemo:31: error: 'nunchuck_accelz' was not declared in this scopeWiichuckDemo:32: error: 'nunchuck_joyx' was not declared in this scopeWiichuckDemo:33: error: 'nunchuck_joyy' was not declared in this scopeWiichuckDemo:34: error: 'nunchuck_zbutton' was not declared in this scopeWiichuckDemo:35: error: 'nunchuck_cbutton' was not declared in this scope-------------------------------------------------------------------------------------------------------------------it looks like no finding the.h file ...what i am doing wrong ?please help !thank you in advance.

maybe it is a dumb question... I tested, works fine(only with original nunchuck... a spare chinese one fails-works on wii)... I understand how its works :D

understand joyy, joyx, accy and accx... but I can't understand accz... what kind of move change accz value? I shake the nunchuk, the value changes, but i cant understand exactly which move change this value

You can skip the computer part and draw the circuit with a sharpie saving you some good time. Besides, this version uses a straight header pins which causes you to lose an extra analog pin due to the board size.

In the Arduinolog's version, he used a 90 degree header pin leaving the anlog pins free to use.

Solarbotics: Any chance you could open source the layout for your design? I'd like to re-use your awesome connector including the locking tabs in a larger open-source hardware project, but couldn't track down your layout files. Thanks!

A simpilar and cheaper way of doing this would be to plug in wire into the little notches at the end of the connector. The connector pins are like this.Look for wiichuck they have a library. Nc and Att are not used. Clk NC Gnd __---__---__ __---__---__ Pwr Att Dat

Hey guys, I have a little problem, I guess someone may be able to help me. I followed all the instructions and used the same code, but when I try it, the LED's connected to the digital output pins barely light on... It doesn't happen with any other programs,, any ideas?

dany32412's sketch doesn't set the pinMode of the LED pins, which sounds like the problem you're seeing. Add: pinMode(Lledpin, OUTPUT); pinMode(Rledpin, OUTPUT); pinMode(Uledpin, OUTPUT); pinMode(Dledpin, OUTPUT); anywhere in the "setup()" function and see if it makes a difference.

Also, I see no current-limiting resistors in his circuit. Some LEDs work fine without them in certain situations, but most will burn out or have greatly reduced life. (and you might damage your Arduino too) Be sure to add a 220 ohm resistor in series with each LED.

And thank you RazorConcepts and JohnPark for the clarifications. FunGizmos.com does indeed stock my Wiichuck adapter for $4, and that includes the 4-pos pin header needed and free domestic shipping.

I hadn't logged in to instructables until right now and this morning I realized what you say about the 'pinMode's. Didn't try it because I was in a rush, but I did use the resistors since the beggining... I'll try setting the pins as outputs right now, because I already tried using a different power supply for the nunchuck and it didn't make a difference. Thanks!

I tried it and it actually worked, sounds logic... So the code needs to set the pinMode for every output in order to work fine...

Right now I'm working on a project for school, I'm making a Nunchuck/Arduino controlled mechanic arm, it has 3 DC motors for moving the base and 2 parts of the arm and 1 step motor to control the gripper. I might upload my own code, along with a video and pictures of the arm itself, maybe even write an instructable about the whole thing. The code was based on this one but more complex. This is my first time using Arduino and I liked it, I'll see what else comes to mind.

They are really really dim, I have to turn off the lights and look at them from above in order to see the difference between being on and off... I can see them turning on and off when I tilt the nunchuck but they're too dim. Have you found any solution? have you tried maybe powering the nunchuck with an external power source? I'll try it and see if it makes any difference.

yeah probably powering it with and external source would be the answer, no more than 5 volts from what i understand thats pushing it. try pluging it into a bread board and connect the 2 data cables the same way but connect 3v to power and gnd to gnd. not sure if that will make a difference cause im not sure of what voltage they have the power set at when it connected directly ontop of the analog header. tell me how that works out

Also check out Fungizmos, they ship them for free, so it's just $4. http://store.fungizmos.com/index.php?main_page=product_info&products_id=212 (full disclosure, I'm friends with both Tod of ThingM and Will from Fungizmos). I believe in both making your own and buying one; whichever works better for you!

Nice and detailed post. I was wondering whether you could post the PCB traces in some sort of image file (pdf, jpeg or similar)? It would be a lot easier than installing a whole PCB design suite I won't use again.