Simple head tracking setup

A budget head tracking setup for all your flight sim needs!

Ever played a sim game and felt limited by the screen, or constantly breaking your immersion by touching the mouse to look around? I had the same problem so I started to look into VR headsets but got discouraged by the pricing. I finally landed on a cheaper solution, an IR tracking unit.

What even is an IR tracker? It works in a fairly simple way. The tracker itself is a camera running some software that calculates the relation of three or more points in space. But how do we determine what points we want to track with an IR tracker? As the name suggests, we are looking for infrared light. More specifically, we are limiting what the camera can see to only infrared light. The last and simplest part is to supply the camera with three IR lights and we have a poor man's VR.


The concept is simple, but what about the execution? What do I even need?
You need an IR camera, IR LEDs in a simple arrangement, and a piece of software.

The biggest hurdle would be the software part because you would need to constantly calculate how and where the LEDs are located, then covert their location into a new input similar to one of a joystick. Luckily, I am not the first one that said "I can make that, no problem!" and the software needed is already written and it is called Opentrack.

GitHub - opentrack/opentrack: Head tracking software for MS Windows, Linux, and Apple OSX
Head tracking software for MS Windows, Linux, and Apple OSX - GitHub - opentrack/opentrack: Head tracking software for MS Windows, Linux, and Apple OSX

In this post, I won't be diving into a detailed description of how to use Opentrack and its numerous settings, since it will be different for every setup.

Now we get to the fun part breaking a webcam, 3D printing, and making some dodgy circuits with LEDs and a resistor.

So how do we properly break a webcam?
We choose a sacrificial cam and start to disassemble it.

We need to remove the IR filter from the camera lens. This step is not absolutely necessary but recommended for best results. It should be as simple as disassembling the cam and removing the filter, which is a lens with a blueish or purplish hue to it. I can't stress this enough, be very careful while doing this because in most cases you expose the camera sensor and you don't want to ruin that. To top it off, in most cases the filter is glued in place, therefore it usually breaks or can't be put back.

At this point, you can put the cam back together and plug it in, the image should have a reddish tint to it and IR LEDs should be much brighter than before.

Why stop here, we've already ruined a webcam let's make it even better. The best improvement we can make is to block all visible light so only IR light can get to the sensor. The best and cheapest way to achieve that, is to return back to our old friend the floppy disk. The foil inside it has the desired effect of blocking visible light and letting IR light through. You can just cut a piece the size of the sensor and gently place it over or put it over the lens.

The image from the camera should look something like this if you shine an IR LED at it.

The only thing missing now are the IR LEDs in an arrangement similar to the picture above. In my case, I didn't want to do anything fancy so I used an old USB cable to power everything. Since USB voltage output is 5 volts and each of my LEDs needs 1.6V, I had to throw in a small 10-ohm resistor. In the end, I had a simple series circuit with 3 LEDs and a resistor.
To mount everything to the headset and to achieve the needed arrangement of LEDs I 3D printed a mount I found on Thingiverse.

Headtracking Clips for FreeTrack by sorcererlc
6DOF headtracking clips to be used with FreeTrack, TrackHat or other similar headtracking systems.Inspired by http://www.thingiverse.com/thing:62827.I created two versions of clips to keep the two halves of the arms together. One version leaves the LEDs exposed while the other is to be used as a lā€¦
Head tracking

And that's it!

It was a fun experience tinkering with passive components for a change and demolishing an old webcam. Now I can finally land a plane as it should be landed and not like throwing a rock onto the runway.