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.

Nunchuk-controlled Helicopter

Nunchuk-controlled Helicopter
Welcome to my 3rd Instructable everyone !

Today we're going to build a 'device' to control a mini-sized helicopter with a Wii Nunchuk.
The helicopter that we're using is a cheap (26$) 3-channel (yaw, throttle, pitch) helicopter that I bought a 1 month back from Dealextreme.com . I can say that it is a VERY durable heli : I have crashed more thant 100 times and it's still working ! It is not radio-controlled, but rather Infrared-controlled, so easier to reverse-engineer. I should also say that in this instructable, the original remote won't be harmed, everything can be done without opening it or even opening the helicopter itself. That means we have nothing to lose :D


In this instructable we're going to take a look at reverse-engineering the Infrared communication with a IR demodulator (very cheap), we'll also learn to use our beloved Arduino as a 1Mhz 'full-featured' logic analyzer. Finally, at the end, there's loads of fun flying the heli around with a nunchuk !

But be warned : as I'm away from home, I won't be able to provide you with a clean PCB to arrange all the components, this is more a quick-and-dirty hack than a real (and finished) project.

Please rate this Instructable ! And also, if you're actually building the thing (or have problems building it), please post a quick comment, I'm always happy to learn I've helped people out !

If you're in, let's go : step 1, the required stuff
 
Remove these adsRemove these ads by Signing Up
 

Step 1Required stuff

Required stuff
Required tools:

- soldering iron
- solder wire

Required parts:

- Arduino (I use a Mega, but any Arduino will be just fine)
- Mini-Helicopter (This project can easely be ported to work on a Syma S107, and any other heli if you reverse-engineer the IR pulse yourself)
- Wii Nunchuk
- 9v battery with 9v battery clip an jack
- TIP120 transistor
- 38kHz IR detector/demodulator
- 10kOhm potentiometer
- 10 ohm resistor
- 4x AA batteries
- 4x AA battery holder (optional, used if you don't want to break your original remote)
- 3x IR leds (used if you don't want to break your original remote)

Required software (for now) :

- Arduino IDE, get it here
- SUMP OpenLogicSniffer client (special version), get it here .

Ok, I think everything's here, so let's head to step 2...
« Previous StepDownload PDFView All StepsNext Step »
22 comments
Jan 23, 2012. 3:25 PMgl1tch says:
First many thanks on this instructable, wanted to do something similar and do not even know where to start.

At this very step after i started the capture with OLS which is always aborted with the following error.

"Capture aborted! Duplicate key: 0x30!"

And i do not know how to go from here at all :(
I am using a Arduino Deumilanove and the latest arduino IDE v1, and i get the same error rather i am on Windows or Ubuntu. Any thoughts on why this is happening?
Feb 6, 2012. 2:12 AMamquad says:
Had the same problem Found I needed a new Arduino file

Downloaded at https://github.com/gillham/logic_analyzer

Works fine now. Hope this helps others :-)
Feb 11, 2012. 3:11 PMgl1tch says:
Nice, thank you that totally solved the problem =)
Dec 9, 2011. 10:04 PMGibber8 says:
Thanks for the inspiration!

I decided to try this with a helicopter that looks identical to yours but the Brand name is Xinxun and the model is X-02. From what I could see, the remote looks identical as well but looks seems to be where the similarity ends.

My remote has a switch next to the right stick labeled I/II. This provides high or low rate for the pitch motor. It also has a button labelled "change" that both changes the "band" of operation as indicated by the three LEDs just above the power indicator, and also turns the LED headlight on the heli on or off.

The IR pulse arrangement is completely different. Mine uses a series of 41 pulses. Each pulse is represented in the IR stream by either high (1) or low (0) (38 kHz off or on) state with a 0 being 450 microseconds long and a 1 being 900 microseconds. There are 6 bits each for throttle, yaw, trim and pitch, 4 unused bits (always 0), 2 bits to encode which "band" the remote and heli are operating on, one bit to send the status of the pitch dual rate switch, one bit to send the status of the change button, and then 9 bits that change depending on the values of the previous 32 bits, sort of like a checksum or encryption key.

This is the part I have not figured out yet. I can duplicate a sequence of pulses that I have captured using the logic analyser and the heli will decode it but I don't know how to code those last 9 bits for any variable pulse stream as generated by the nunchuck inputs. If the last 9 bits are not correctly set the heli just ignores that series of pulses and shuts down.

If anyone else has run into this type of coding and sorted it out please respond back.
Dec 21, 2011. 5:47 PMGibber8 says:
I have attached a screen shot of the pulse from logic sniffer, captured when throttle = minimum, yaw and pitch = neutral, trim = max left, and hi/lo rate = lo. The pulse reads (000000 000000 011111 000000 000001 000011 01010) Note that I added the spaces to make transcribing easier.

I thing I almost have it figured out. The last bit is always 0 so that leaves 8 bits to decode and it looks like these are a combination of the four variables. I just need to determine if the combination is boolean and if so what (and, or, xor),

Thanks for your time.
Dec 20, 2011. 10:22 AMgolaky says:
Thanks a lot ,now the OLS works but nothing append, i follow all your instruction and i tested with an oscilloscope and with another analyzer the pin data of the IR demodulator and i can see an output but not over arduino and OLS.
Bye
Dec 19, 2011. 10:39 AMgolaky says:
Thanks for the great idea.
I'll try to capture the data but i got allways fro ols programm the following error:
Device type dos not match selected type!......
I'm using arduino mega.
Can you help me?
Nov 15, 2011. 10:14 PMMic100 says:
Bonjour,
I'm French to and my english in not very good !

I've made an Arduino Severino (It is pin-compatible with the Arduino Diecimila) with ATmega 168, i've tested it with processing and it work fine. this pcb has no USB port but a serial RS232 interface.
I've compiled your program under Arduino without the makefile and I uploaded it I run the sniffer but when I start the acquisition, he said device not found my question is is it because my arduino does not have a USB port?

Thank you for this Instructables :)
Nov 19, 2011. 12:13 PMMic100 says:
OK merci je vais faire des essais :)
Nov 11, 2011. 2:30 PMcarlsands says:
well that would make controling the rc helicopter easier
Nov 9, 2011. 2:27 AMfjohn says:
can we use the accelerometer in the nunchuck?
Nov 2, 2011. 1:13 PMnerd7473 says:
good use for the wii nunchuck
Nov 1, 2011. 4:05 PMHougashucka says:
ever think of adding a camera? so youd see first person on your andriod
Nov 1, 2011. 2:26 PMtheawesomedude92 says:
Can this work with the classic controller? I would really like to know, great mod. =)

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!
38
Followers
4
Author:a1r(A1Rstudios.com)
My name is Jonathan Rico, I'm 17, I'm french and I live in Morocco near Casablanca. I'm in Terminale S (French equivalent to 12th grade) at the CNED (homeschool, but controlled by the french governmen...
more »