07 April 2011

Project "DIY FreeTrack IR Headtracking for PC"

i stumbled upon the concept of headtracking for the PC some two years ago when i was very into flight simulators (still am, but there aren't any new simulators that capture my attention). again, like the DIY PS3 mouse and keyboard adapter, i did not create or program this...i just followed the instructions online. 

basically, by using a webcam for the computer and some infrared LEDs, you are able to build your very own headtracking device that would work in games that support it (most flight simulators, racing games, even some first person shooters). so instead of using your hatswitch on your joystick or the buttons on your keyboard to look around in your virtual aircraft's cockpit, you can simple move your head around and your viewpoint would change accordingly.

i actually smashed this setup together nearly two years ago to see if it works (and it did) and then i forgot about it after awhile. i didn't do a good job at all putting it together, but the idea now is to show how it works so just ignore the loose wires and *cough* universal black tape. there are two main versions of the 'rig' which is either mounting the LEDs on the rim of a cap, or mounting them on a 'clip'. many users have posted their builds here: http://www.free-track.net/english/hardware/point_model_gallery.php

the official name for this sort of device is a 'optical motion tracking' game controller. if you know how a Wii remote works then you already have the basic idea because it is very (if not entirely) similar. the official commercial product has been around since 2001 and was known as TrackIR 1, with the most recent version (TrackIR 5) being released in 2009. TrackIR retails for $150USD(!!!), and budgety ol' me doesn't have that kind of cash to blow on what is essentially some LEDs, a webcam and professional software. after looking around on the internet, i found a free(!!!) program created by some geniuses over at http://www.free-track.net/ and the best part of it is you have to DIY a simple rig together to make it work. 

by putting 3 infrared LEDs together in a triangle (or line, depending on whether you're building the cap version or the clip version) of specific dimensions (depth and height), the webcam and software would be able to detect and calculate how much and in which direction you move your head (as mentioned, like a wiimote). using 3 LEDs would enable six degrees of tracking; pitch, yaw, up, down, forwards and backwards. there is a version that uses only 1 LED but then you'll be restricted to just pitch and yaw as there is not enough information to calculate the rest.

looking through the parts list, it is obvious it won't cost you more than a few bucks (cents for me because i already had all of it lying around):

- 1 x resistor
- 1 x standard USB cable
- 1 x cap
- soldering kit + wires

cut away one end of the USB cable and solder the resistors to the positive (red) wire to drop the voltage down to a level the LEDs can operate at. solder the LEDs together in series with enough wire length to space them apart to make the triangle of the specified/desired dimension. ignore the really shoddy build as shown in the picture below, it was hastily put together with nothing but black tape holding everything in place and the cap was the only free cap i had lying around (coincidentally its from the airshow and i use it for my flight sims...)

there are quite a few webcams that are well suited for this program and there is a list here : http://www.free-track.net/english/freetrack/comment-ca-marche.php, i borrowed a microsoft vx-1000 from my brother and it works fine.

if you're wondering why infrared LEDs are used, it is because they do not emit visible light that would distract you and ruin your gaming experience. it is also possible for infrared light to be picked up by the webcam in broad daylight whereas normal LEDs would be overpowered by stray lights. one addition i made was to put a piece of developed but unexposed 35mm film in front of the lens of the webcam to filter out everything but infrared light and it worked spectacularly.

you can tweak the program and set it up to your preference with settings such as deadzone and sensitivity and can save many profiles for use in different games. i won't go through the nitty gritty of how to set it up, but if you're interested there is a handbook on the official website here: http://www.free-track.net/fichiers/manuel21en.pdf

i haven't had any chance to try the TrackIR so i can't compare it with the FreeTrack version, but i'm sure the TrackIR should be more convenient in many ways (especially for people who don't like to DIY).


  1. Great post man! But I still don't know wich resistor to use. Could you help me ?

    1. hey man it has been awhile since i posted this, but i managed to find the same guide i used here: http://forum.free-track.net/index.php?showtopic=1856

      it has information on the resistor values for either serial or parallel LED builds for you to follow,

      hope that helps!