Arduino Mega + Devantech CMPS10 compass

Digital 3-axis compass

Photo

I2C protocol5 volts

I wanted the Ardunio to be able to detect the direction it is pointing - thus a compass. It's important to get a Tilt Compensation Compass as otherwise if it's not level you will not get a proper bearing. You also get the advantange of being able to measure pitch and roll.

The Arduino Mega has pins 20 and pin 21 for the i2C SDA and SLC connectors.

Fritzing

Sketch