This application note gives a detailed explanation of creating your very own digital compass. This can be implemented in either simple or complex applications but requires mid-level design experience.
Digi-Key distributes Honeywell's HMC5983 3-Axis Digital Compass IC as part of its global distribution agreement. This product is a temperature compensated, three-axis, integrated circuit magnetometer.