Electronic Compass
To make the head tracking system, we have employed a commercial electronic compass: the CMPS03 (click ongoogle and you will find dealers for it).

Phillips describes in an application note more detailed information about the electronic compass mounted with their magnetoresistive sensors: AN00022
In our case, we substitute the microcontroller which comes with the compass by a PIC16F876 programmed by us.
It is possible to implement the project without removing the PIC that comes with the electronic compass using directly the I2C lines (SDA and SCL ) from it and accessing to the original PIC registers.
I prefered to read directly the magnetoresistive sensors to easily migrate the project from phillips sensors to honeywell sensors.
Magnetoresistive sensors require reading the sensors 2 times using the flipping technique explained in the phillips application AN00022. This is not really a problem in practice: first you put a 0 in the "flip" control line, you read the value of the sensor and after you put a 1 in the "flip" control line and you read the value of the sensor. But this task is performed by the PIC16F876.