background image

3/18/2019

Grove - 3-Axis Digitial Compass v2.0 - Seeed Wiki

http://wiki.seeedstudio.com/Grove-3-Axis_Digitial_Compass_v2.0/

1/15

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  eld in three perpendicular axes
and the output can be read out over I2C and SPI interface, perfectly suitable for 3-
Axis mobile applications.

Summary of Contents for 101020492

Page 1: ...ass_v2 0 1 15 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 eld in three perpendicular axes and the output can be read out over I2C and SPI interface perfectly suitable for 3 Axis mobile applications ...

Page 2: ...Grove 3 Axis Digital Compass comparing to the rst version this version can perfectly match the demanding requirements of all 3 Axis applications while the price is almost half of the rst version very cost effective https www seeedstudio com Grove 3 Axis Digital Compass V2 p 3034 html Features High resolution High heading accuracy Easy to use Speci cations ...

Page 3: ...T z axis Magnetic eld resolution 0 3μT Output Degree 0º 360º Interface I2C Working Temperature 40 to 85 Dimensions 20mm x 20mm x 15mm I2C Address 0x13 Platforms Supported Note If you want to use multiplue I2C devices please refer to Software I2C http wiki seeedstudio com Arduino_Software_I2C_user_guide Tip More details about Grove modules please refer to Grove System http wiki seeedstudio com Grov...

Page 4: ...duino Hardware Step 1 Prepare the below stuffs Caution The platforms mentioned above as supported is are an indication of the module s software 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 ...

Page 5: ..._Compass_v2 0 to port I2C of Grove Base Shield Step 3 Plug Grove Base Shield into Seeeduino Step 4 Connect Seeeduino to PC via a USB cable Seeeduino V4 2 Base Shield Grove 3 Axis_D Get One Now http www seeedstudio com Seeeduino V4 2 p 2517 html Get One Now https www seeedstudio com Base Shield V2 p 1378 html Get One Now https www s 3 Axis Digital C 3034 html ...

Page 6: ... http wiki seeedstudio com Grove 3 Axis_Digitial_Compass_v2 0 6 15 Seeeduino_v4 Grove 3 Axis_Digitial_Compass_v2 0 5V VCC GND GND SDA SDA SCL SCL Note If we don t have Grove Base Shield We also can directly connect this module to Seeeduino as below Caution ...

Page 7: ...ples Grove_3_Axis_Compass_V2 0_BMM150 master compass Here is the code 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 https www seeedstudio com Micro USB Cable 48cm p 1475 html to buy 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1...

Page 8: ...33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 void loop bmm150_mag_data value bmm read_mag_data value x bmm raw_mag_data raw_datax value y bmm raw_mag_data raw_datay value z bmm raw_mag_data raw_dataz float xyHeading atan2 value x value y float zxHeading atan2 value z value x float heading xyHeading if heading 0 heading 2 PI if heading 2 PI heading 2 PI float headingDegrees heading 180 ...

Page 9: ...Grove 3 Axis_Digitial_Compass_v2 0 9 15 Step 6 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 Note ...

Page 10: ...lay With Raspberry Pi With Grove Base Hat for Raspberry Pi Hardware Step 1 Things used in this project The compass needs to be calibrated otherwise you will get the inaccurate data Please make sure you have done the Step 5 Tip 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 ...

Page 11: ...Step 3 Connect the 3 axis compass to I2C port of the Base Hat Step 4 Connect the Raspberry Pi to PC through USB cable Raspberry pi Grove Base Hat for RasPi Grove 3 axis Get ONE Now https www seeedstudio com Raspberry Pi 3 Model B p 2625 html Get ONE Now https www seeedstudio com Grove Base Hat for Raspberry Pi p 3186 html Get ONE Now https www 3 Axis Digital 3034 html ...

Page 12: ...on to con gure the development environment Step 2 Download the source le by cloning the grove py library Note You are required to install python mraa and python upm see the instruction here https github com Seeed Studio pi_repo mraa upm package repository for raspberry pi https github com Seeed Studio pi_repo mraa upm package repository for raspberry pi for more information 1 2 cd git clone https ...

Page 13: ...print Error Please install python mraa python upm module r n See instruction here https github com Seeed Studio pi_ def main Instantiate a BMP250E instance using default i2c bus and addr sensor sensorObj BMM150 0 0x13 For SPI bus 0 you would pass 1 as the address and a valid BMM150 0 1 10 Exit handlers This function stops python from printing a stacktrace when yo def SIGINTHandler signum frame rai...

Page 14: ...mat hea time sleep 250 if __name__ __main__ main Success If everything goes well you will be able to see the following result 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 pi raspberrypi grove py grove python grove_3_axis_compass_bmm15 Magnetometer x 34 12 y 36 71 z 21 25 uT heading axis_Y point to 317 10 degree Magnetometer x 34 49 y 38 20 z 16 32 uT heading axis_Y point to 317 92 degree Magnetometer x ...

Page 15: ... Grove_3_Axis_Compass_V2 0_BMM150 PDF BST BMM150 Datasheet https github com SeeedDocument Grove 3 Axis_Digitial_Compass_v2 0 raw master res Datasheet pdf Zip Grove 3 Axis Digital Compass v2_Eagle File https github com SeeedDocument Grove 3 Axis_Digitial_Compass_v2 0 raw master res Eagle File zip Tech Support Please submit any technical issue into our forum http forum seeedstudio com or drop mail t...

Reviews: