In completion of the DSP for Embedded Devices course, my final project culminated in an iPhone application with an accompanying protocol, allowing third-party devices to transfer serial data in through the headphone jack.

Wii Nunchuck, meet iPhone

Apple thinks they have the last word with iPhone accessories...

The primary goal of this project was inspired by several applications existing on the App Store; these apps offered an environment through which music and sound could be generated by moving the iPhone itself in 3-D space. This idea, although intriguing, seemed to fall short in permitting intelligible movements to correspond to the changes in aural stimuli produced by the phone accordingly. In the attempt to bridge the gap between intelligible controls for audio synthesis, the plot was formed to use a highly responsive and versatile controller (the Wii Nunchuck) in collaboration with Apple's iPhone to create an unparalleled user experience.

The final implementation of the application (shown on right) and the rig used to allow communication from the Wii Nunchuck to the iPhone is a large step in the right direction. It's fluidity and responsive nature, although not immediate nor 100% accurate, enable the user to intelligibly create music with the wave of a hand. A beneficial (and primary) side-effect of accomplishing what had been set out to do is the creation of the protocol used to communicate between devices. Between colleague Eddie Bertot and myself, this homemade protocol reads sensor data using an Arduino micro-controller, and forwards that information in variable sized packets to the iPhone, which receives the signal through it's line-in conductor in the headphone jack. If you are interested in reading more, this paper goes into detail on the specifications of the implemented system.

Download

For those interested in emulating hackery such as this, the source code for this project (both Arduino and Xcode) is available for download here. Note: this is an open-source project, and there are likely many bugs in the files included within this zip. Please feel free to make changes and pass them along.

Download WiiNunchuck App Source Files

Hardware

Enabling a user to utilize the Wii Nunchuck in collaboration with the iPhone required the marriage of hardware from several sectors of the electronics world. To interface between the data stream from a Wii Nunchuck and an iPhone, the Arduino Duemilanove ATmega 328 micro-controller received and dispatched information. Shown below on the left is the enclosure that held the micro-controller, and a headphone jack protrudes from the side. This headphone jack has 4 conductors, the 4th being used to transmit data to the line-in conductor on the iPhone's 1/8" port.

All Hardware All Hardware

The image above on the right shows a close-up of the circuitry that receives input from the Wii Nunchuck, conditions the signal to a level the iPhone can handle, and sends out the repackaged information in packets of 8-bit words. In the top-left hand corder of the picture, the Wii-Nunchuck breakout board can be seen sticking out of the enclosure (the white plank with 4 soldered connections). The bottom-left corner shows where the 4-conductor 1/8" jack exits the enclosure. The top-right corner indicates where the enclosure can receive a 12V power supply if the device is not connected to a computer via USB, the port for which is in the botton-right corner of the image.

With the rig assembled, the Wii Nunchuck and the iPhone are connected to the enclosure, and headphones can be plugged into the 1/8" output port on the side of the blue box. The setup is shown in the image below on the left. Sample video coming soon showing the app/hardware setup in action! Stay tuned...

All Hardware

Sam Drazin © 2017

Home | About | Contact | Site Map