This electronic compass provides magnetic field and acceleration measurements in 3 dimensions. Together these readings provide heading information and can be used as a heading-orientation sensor (electronic compass). The readings are accessed with an I2C interface which is compatible with 3.3V and 5V systems. The module can also provide information on orientation (X,Y, and Z axis). This product is provided as open-source hardware with all design files available for use, re-use, or modification.
Module documentation and application info are available to get you started right away. This is open source hardware, all design files are available.
User datasheet
Schematic and bill-of-materials
Arduino Code Example - basic communication, reading/writing to registers
Arduino Code Example - simple compass
Arduino Code Example - calibration
Arduino Code Example - tilt compensated compass
ST Micro Application note on calibrations of LSM303DLHC