Sunday, January 29, 2006

XBox Headtracking system....

Last week, I was driving home and thinking about servos, the basic stamp and a few other things when ,as is the way the mind works, I recalled a simple "robot" my friend built based on the basic stamp that used 2 photoresistors to track the brightest light in the room.

Inspiration struck. Out of nowhere, came an idea that I found brilliant. I had wished there was a headtracker system for the xbox ever since it came out. Current console systems have a ton of rendering power and being an old school geek, wondered why there was no one exploiting the power of these systems for vr. I have a HMD and gaming on it is great, but I have always longed for a head tracking system to make it truly immersive.

How about a headtracker system for the xbox? There are commercial headtrackers for PC games and expensive systems for real vr use. Why does it need to be complicated? Why not use photoresistors to replace the pots in the analog thumbsticks? As long as the resistances are right it should work fine.

I decided on a system of 4 photoresistors (henceforth called pr's so I don't have to keep typing that) mounted in a diamond pattern. I had envisioned using a pic microcontroller to translate the resistances into the appropriate resistances that the xbox could understand. Turns out the control circuitry wasn't needed.

Here's the original concept sketch I showed my good friend B.



Here's what he proposed to simply replace the pots with the photoresistors.


In essence the resistance drops in the direction your going. So for example, if you look down the top photoresistor get illuminated and thus drops the resistance. So in essence you have to wire the board upside down and backwards. Though often in games you can reverse the cameras movements in the settings but not always. Best thing is to screw around and play with it and make sure it works before finalizing your design.

So here's what I needed.

1. An xbox controller I didn't care if it got trashed.
2. 4 Photoresistors.
3. A bunch of wire.
4. An activating light (I used a led based head mounted flashlight)

First I tore down an old style xbox controller. I never used it, I always thought it was to big.




Next we made the board that mounted the pr's. We kept it real simple. Good old fashioned cardboard. We started mounting the pr's then wired them all together.








Next up was soldering the wires to the xbox controllers pcb. Not bad, just 6 lines. Remember to thread them through the hole in the controller's case or your gonna be stuck. It was fun trying to figure out how to wire it up, looking at the pcb upside down and then looking at the analog stick right side up, and trying to figure which is necessary who need more resistance and less, was a pain. It took 2 of us to do it. One to use the multimeter and one to move the stick which was in the vice. So yes I took that pic while moving the stick and he was checking resistance.






Next we had to reassemble the controller. In this iteration the sensor board is soldered directly to the controller, but I will probably get around to putting a small 6 conductor connector on the controller so I can separate the 2 pieces.

Next was put on the led headlamp, hmd, plug it in and test.






It worked great. The only short coming was the fact that the headlight I used was so focused it was kind of an all or nothing affair. I'm going to switch to a normal flashlight bulb and things should be perfect. Here's a few screenshots of the game I was playing. I was kicking ass.





Video is coming as soon as I find my s-video cable so I can capture it from my camcorder. Hope you guys like this and you can use it. It's not polished but it works as is. A better light and fine tuning of distances is all it needs. I have some decent video of me using it in first person mode of "Buffy the Vampire Slayer" (yes I'm a fan, so sue me ;) ). Can't wait to play "Call of Duty" and "Medal of Honor". Should be great as that is what this was really designed for, FPS's.

Total cost was around $6 bucks. Needed 2 packs of the assorted PR's so I could get 4 that matched. Everything else I had.

Here's a video of it in action.





XBox Headtracker

17 Comments:

At 7:25 AM, Anonymous Anonymous said...

A step up in complexity, but more accuracy/less jerkyness could be gotten by interfaceing to an acceleratometer.

 
At 8:30 AM, Blogger Ryan said...

True, that would do it. Of course though I was going for a solution on the cheap. I think my next modification of it is going to place it much closer to me, a smaller sensor plate, and a fimple incandecsent flashlight bulb. The flashlight bulb without a reflector should give a nicer gradient and be a bit more stable.

Another idea would be use an ir led with no optics, and replace the photoresistors with ir photodiodes. Hopefully that would make it less susceptible to visible light. As it was we had to calibrate it with small bits of tape covering the photoresistors.

I'll post photos of the completed unit later. As well as a video tonight.

 
At 2:40 PM, Anonymous Anonymous said...

Ok so what all is really needed for a person to make one of these?? I got the list you left on here but as I look it over it seems you had alot of the stuff needed just sitting arround.
I know I need the controller, Photoresistors, wire, And a led head based light. But what else do I need??? Thanxs,
David

 
At 3:30 PM, Anonymous James B said...

Great project. An alternative you might find to the standard flashlight bulb is a white led (and though its a bit late if you look around you might find a box of christmas lights that use em).

The IR photodiodes might present a problem if the room your using is lit via halogen light (the sort found in most schools and office buildings). These sort of lights emit quite a bit of IR light that tend to cause problems with simple IR based range sensors, causing false positives and making the robot act erraticly (this was during a Robotics club meeting).

 
At 3:54 PM, Blogger Ryan said...

James, I had thought of that, however I dont expect the light to be quite as difuse as I want. Most that i have seen seem to project a nice round spot of more or less even brightness even without any optics.

Good call on the ir however. I may need to rethink that as i do have halogen torches in my living room.

Anonymous #2 Really all i needed to get was those parts listed. With the exception of the cardboard, I just used some scrap from an old shipping box. You do need the xbox, and it's nicer to use this system with a HMD (lcd goggles), but a tv is fine also. I found mine cheaply on ebay, total was 102 including shipping.

If your curious about tools, the your standards apply. You'll need wirecutters and strippers, a phillips head screwdriver, soldering iron, desoldering tool (I like the plunger type as opposed to the solder wicks),solder, and electrical tape. Thats all I can think of.

Any other questions and comments are welcome.

 
At 5:08 PM, Anonymous david_stroisch2000 said...

what kind of projector is that in the picture?

 
At 5:13 PM, Anonymous Anonymous said...

OK thanxs for the help, so I dont need a projector for this to work?? it will work if my xbox is hooked up to my tv??

 
At 6:04 PM, Blogger Ryan said...

David- The projector was just one we had laying about thew shop. Nothing new or special. We just didn't have a tv. We were just using it show what the screen looks like. I saw everything througfh the HMD. It was just for testing purposes, and for the video.

Anonymous- Nope, you dont need the projector. See above. We just didn't have another way of showing the video without the HMD (funny looking goggles I'm wearing in the pictures).

Just captured the video, I'll post it in a few minutes.

 
At 6:27 PM, Blogger Ryan said...

This comment has been removed by a blog administrator.

 
At 6:29 PM, Blogger Ryan said...

Here's the video of the headtracker in action. the sound is just static (i'm unsure why) and its dark but it shows it all. Enjoy.

XBox Headtracker

 
At 12:07 AM, Anonymous James B said...

Not quite with the white leds, with the christmas lights I got the leds were encased in plastic globes that diffused the light(though perhaps a bit much for what you need)instead of concentrating it.

---------------

This is just a minor idea and may end up becoming more complex then your current system but it might allow you to use IR without having to worry too much about interference from halogen lights.

Although I don't think it would work too well with your HMD, but for someone using a television....

The basic idea is to use the IR not to track head movement but eye movement by mounting the sensors in the frame of a cheap pair of glasses (after removing the lenses of course).

I saw something like that about seven+ years ago on a technology show where a woman could only move her head and the doctor made her a IR sensor for her so she could continue to type, eye movements controlled the curser while blinking let her 'click' on the icon or letter on the screen, though that system covered one eye.

 
At 8:45 AM, Blogger Ryan said...

I just recently saw an article for eyetracking somewhere, they had mounted both an ir transmitter and ir camera to work glasses frames. The pupil didn't reflect back the light so they they cued off the the black in the image(pupil) and tracked movemnet that way.

Neat idea. Do you have a picture of the led's your talking about? With the plastic globes? That might be an ideal solution.

 
At 1:38 AM, Anonymous James B said...

I just sent you a picture though I only had a old webcam available so its a bit small and the resolution isn't so good.

I saw a few articles on that too though I was looking more for hobbyist type stuff then official research.

Though I was thinking that the IR components from computer mice might be useful for this depending upon how a person wanted to use it. For instance if the game being played didn't require the player to look down or up all the time then all they would need would be emmitters/sensors mounted to the left and right of the eye, then perhaps a thumbwheel could be used for up and down viewing movements.

 
At 5:45 PM, Anonymous Anonymous said...

Good idea, but looks like you might have to move your head just a bit to far especially if you have a small tv it might not work as well.

 
At 6:42 PM, Anonymous Anonymous said...

When you get closer to doing something let us know. We are in the thick of it when it comes to distribution for the gamming channels. see TrackIR or compuexpert.com for additional products we market

 
At 8:29 AM, Anonymous Arno, the netherlands said...

Hello,

Very nice. I would also like to built one of those but with capacity sensoring. Can somebody please tell me what the resistor values should be? I reckon the potentiometer in the xbox is variable one and I should use similar values but I don't know what the values are? What is the value when the stick is in the center? And what is the value when the thumbstick is moved to the most outer position? And what are the values in between? Is this lineair?

Thank you very very much for your replies.

Greeting Arno, the Netherlands

 
At 7:49 AM, Anonymous clarksburg said...

Iv been looking around the internet for some good quality scart cables so far they have either been really cheap and rubbish or expensive and good but I don’t want to be forking out loads of money every time I need a scart cable. I have ordered a few 1.5 metre scart cable for my projector to my xbox, its amazing.

 

Post a Comment

<< Home