IR Cam Headtracker

This project is a continuation on my last headtracking project. One of the main issues I had on that one was the difficulty in getting the Wiimote to stay connected (pairing) and having a laptop between the wiimote and the controller. I decided instead to remove the camera from the Wiimote and use a microcontroller communicating with the xbox mod over Zigbee (Xbee) radios.

This project is to show the IR camera removed from the Wiimote and communicating directly with the FEZ Panda over I2C. The reason for doing this is to eliminate the need to have a laptop that was needed in the previous headtracking project to initialize the bluetooth connection to the Wiimote. This also allows the FEZ Panda to consume the data (i.e IR x, y for 3 points) and distill that down to just 2 values that represent the slope (orientation) or the angle at which the user is looking at the camera. That way the FEZ Panda only needs to transfer essentially one x and y instead of the 3 sets of x and y’s.

The IR Camera from the Wiimote is difficult to remove and requires a special circuit for timing. Most of the information that I have found online is translated from some japanese guy named kako that orginally published the circuit, but many have translated it and this is the best details I have found with wiring diagrams and everything in english:

I also used this article from that has really good info on how to remove the camera:

To use the little I2C camera I first needed to create a way of accessing the very small pins. The instructions have details on how to remove the camera from the board, but I thought the board would give me some structure so I soldered pins onto it so that it could be used in a breakboard if needed.

Then I cut that from the main board:

Next I had to build the special circuit to allow the camera to communicate over I2C. The instructions and the wiring digram are in the links above. Here is a picture of the completed circuit:

Underneath (messy but it works):

The camera mounts into the circuit like this:

I have moved forward a little more now. I cut down the IR Cam circut board and stuffed the whole thing into a small project enclosure box from radio shack. Here is a picture of what it looks like (on the inside):

Here is it completely enclosed. It is the Pixart camera taken out of a Wiimote attached to the necessary circuitry to make it a stand alone I2C device that outputs just the x and y coordinates of any IR lights that it sees in its field of vision:

My next steps in the evolution of this is to move to the FEZ mini and enclose both the mini and the xbee radio in the encosure so that I have a stand alone camera that relays its info over xbee. I have also started using the Saleae USB Logic Analyzer to watch both the data coming out of the I2C setup as well as look at the data coming over the xbee radios serial. It is truly awesome to see and will be very helpful in debugging and maxing out my throughput.

UPDATE 3/3/2012
After using the logic analyzer I was able to simplify the communication by sending just 2 bytes (instead of a text string that had to be parsed). This dropped the amount of time between posts from ~20ms to 8ms and made it much easier for the receiver to process (i.e. no string spliting needed). I also replaced the FEZ Panda with a much smaller FEZ Mini so that I could fit the whole thing in a smaller project enclosure. I am still just testing what i am now calling the IR Cam HEadtracker with just the laptop receiver to make sure that i have the most efficient transmission of data before I move on to connecting it back to the Xbox 360 controller.

I recorded a video to demo the functionality, speed and accuracy of my current setup. The video is here:

10 Responses to IR Cam Headtracker

  1. trandi says:

    Hi there,

    Nice project, I’m glad that you found my post useful !


  2. farhan says:


    what about the program of Xbee and the FEZ?

    can you share it..

  3. what are you trying to do? maybe I can help. The whole app wont work for you unless you have built the Wiimote camera board (as shown), but i have some class files that wrap the Xbee communication using the FEZ board if that will help.

  4. missorrow says:

    Seems like a brilliant idea.

  5. artinweb says:

    Hello! how to send x and y values ​​to the xbox 360?
    I tried to search but did not find anything, it would be a good starting point for a tutorial, if you can contact me on twitter @aresbraccia

    • james wolf says:

      Artinweb, thanks for the question. The X and Y values are captured by evaluating the triangle produced by the IR LED’s and sent via xbee to a Netduino that is connected to the Xbox 360 controller. The netduino tricks the controller by hacking the joysticks on the controller with a digital potentiometer (that works much like the real potentiometers built into the joysticks). It essentially takes the X and Y and tricks the controller into thinking that the joystick has been moved to that X and Y position. Let me know if that makes sense.

      • artinweb says:

        then you have bypassed the potentiometer joystick with the welds? or is there a method is not “invasive”: P … PS: it makes sense, nice work :)

      • james wolf says:

        Artinweb, originally I removed the joysticks from the controller entirely and just controlled the head movement with the digital potentiometer, but found that I needed the joystick for fine tuned control when aiming. The final version had the digital potentiometer connected where the joystick had been but the joystick was then mounted on top and when I pulled the left trigger to aim (in the game) the control switched from headtracking back to joystick control. The joystick potentiometers were fed into the netduino controlling the digital potentiometer, so it could relay their positions to the xbox360 controller board. This way I could use both headtracking control as well as manual control with the pressing of the trigger to switch between.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s