Issue with data from Grove 3-Axis Digital Compass


I am having some problems with the Grove 3-Axis Digital Compass. The main issue I have is that the raw data is not consistent. I am using the compass with the Hercules Dual 15A 6-20V Motor Controller (Also from Seeed) through it’s I2C Grove port. Everything else works perfectly except for this one thing.

The example code found on the wiki kind of work (it compiles and uploads just fine, it convert the raw data to an heading, ect). The problem is that the raw data itself is incredibly inconsistent. For example, if I point the compass straight north and note the values, do a 360 degree turn and then return it to the exact same location and heading it was originally, the raw values will be very different. After conversion, it can easily mean 60 degree difference in heading for the exact same location. Needless to say, it’s completely useless in its current state.

On the product page ( … ath=25_129), one user states that he was getting incorrect data with an Arduino Yun, but that it worked correctly with a Uno. I do not have an Uno to test unfortunately.

The question is: Do I have a faulty compass, or is the Grove 3-Axis Digital Compass incompatible with the Grove I2C port from Seeed’s own Hercules board? The compass would be extremely useful for my project, and there doesn’t seem to be another compass alternative for it considering the limited pinouts on the board.