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 instructables.com 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.
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: