Get the direction right with Triple-axis Accelerometer+Magnetometer (Compass) Board – LSM303! This breakout board features two sensors, a classic 3-axis accelerometer through which direction is down towards the Earth by measuring gravity and a magnetometer which can sense where the strongest magnetic force is coming from – detecting magnetic north. You can get orientation by combining this data.
This breakout uses I2C to communicate and can be easily used with 3 or 5V microcontrollers. Also, there is Data Ready and two Interrupt pins you may utilise. For Arduino, its super easy to get going with Adafruit’s library for this board. Connect SCL pin to Arduino’s I2C clock pin, SDA to Arduino’s I2C data pin and upload Adafruit’s test program to read out accelerometer and magnetic field data.
Buy Triple-axis Accelerometer+Magnetometer (Compass) Board – LSM303 from Pakronics: