Grove - 3-Axis Digitial Compass v2.0

The Grove - 3-Axis Digital Compass is a digital compass sensor based on Bosch BMM150. It allows measurement of the magnatic field in three perpendicular axes and the output can be read out over I2C and SPI interface, perfectly suitable for 3-Axis mobile applications.

This is the second generation of Grove - 3-Axis Digital Compass, comparing to the first version, this version can perfectly match the demanding requirements of all 3-Axis applications while the price is almost half of the first version, very cost effective.


  • High resolution
  • High heading accuracy
  • Easy to use


Item Valnue
Working Voltage 3.3V / 5V
Magnetic field range typical ±1300μT(x, y-axis), ±2500μT(z-axis)
Magnetic field resolution 0.3μT
Output Degree 0º ~ 360º
Interface I2C
Working Temperature -40℃ to +85 ℃
Dimensions 20mm x 20mm x 15mm


More details about Grove modules please refer to Grove System

Platforms Supported

Arduino Raspberry Pi BeagleBone Wio LinkIt ONE


The platforms mentioned above as supported is/are an indication of the module's hardware or theoritical compatibility. We only provide software library or code examples for Arduino platform in most cases. It is not possible to provide software library / demo code for all possible MCU platforms. Hence, users have to write their own software library.

Getting Started

With Arduino

You can choose any Arduino compatible board with I2C Port, in this wiki we use seeeduino V4.2.


ReSpeaker Core v2 Grove - PIR Motion Sensor
enter image description here enter image description here
Get ONE Now Get ONE Now

Hardware Connection

  • Step 1. Plug the Grove-3-Axis Digital Compass into Seeeduino V4.2 via the Grove I2C Port.
  • Step 2. Connect the Seeeduino V4.2 board to your computer with an micro-USB cable.


Please plug the USB cable gently, otherwise you may damage the interface.Please use the USB cable with 4 wires inside, the 2 wires cable can't transfer data. If you are not sure about the wire you have, you can click here to buy



If this is the first time you are working with Seeeduino, please refer to this page to learn how to use Seeeduino and download the library.

  • Step 1. Download the library for Grove-3-Axis Digital Compass.

  • Step 2. After you installed the library, you can find the demo in File->Examples->Grove_3_Axis_Compass_V2.0_BMM150-master.

  • Step 3. Make sure you've chosen the right port and Board, for this wiki we choose Seeeduino V4(Atemega328P). Then click upload button at the top left corner, to upload the code. .

  • Step 4. When the message Done Uploading pops up, you can click Tools->Serial Monitor to open the serial monitor. Please set the baud rate as 9600.

  • Step 5. After a while you will see the monitor print the notice Start figure-8 calibration after 3 seconds

Within these 3 seconds, please tilt and rotate the compass back and forth on every axis, as shown in the picture below.

The calibration period time can be changed through the parameter timeout in the fuction calibrate(uint16_t timeout).


The compass needs to be calibrated, otherwise you will get the inaccurate data! Please make sure you have done the Step 5.

Finally, you will see the something like the following picture.


Heading value is in range of 0º ~ 360º, this value is for Y axis, 0º means Y axis points at North, 90º means Y axis points at West, 180º means Y axis points at South, 270º means Y points at East.

Enjoy your compass!


Tech Support

Please do not hesitate to contact techsupport@seeed.cc if you have any technical issue. Or submit the issue into our forum.