Magnetometer Compass Module for Arduino Projects

Provides accurate compass bearings

SKU: TA0057


$8.95
RRP $17.95
In Stock

Buy In Bulk & Save!
Buy 4 to 10: Pay $8.50 ea
Buy 11 to 20: Pay $8.07 ea
Buy 21 to 100: Pay $7.26 ea
Buy 101 to 300: Pay $6.90 ea
Buy 301 to 1,000: Pay $6.21 ea




Calculate Shipping

HMC5883L Magnetometer Compass Module for Arduino Projects

 

Provides accurate compass bearings 

The HMC5883L is 3-Axis Magnetic Electronic Compass Module is designed for low-field magnetic sensing with a digital interface and it is perfect to give precise heading information. This compact sensor fits into small projects such as UAVs and robot navigation systems. The sensor converts any magnetic field to a differential voltage output on 3 axis. This voltage shift is the raw digital output value, which can then be used to calculate headings or sense magnetic fields coming from different directions.

Specification:

  • 3-axis magnetic electronic compass
  • Precise heading information
  • Fits into small projects easily
  • I2C communication
  • HMC5883L chip
  • Operating Voltage: 3V-5V DC
  • Chipset HMC5883L
  • Communication: I2C protocol
  • Measuring range: ± 1.3-8 Gauss
  • Dimensions: 14.8mm x 13.5mm x 3.5mm

Download Library CLICK Below

HMC5883L

Sample code:

#include <Wire.h> //I2C Arduino Library

#define address 0x1E //0011110b, I2C 7bit address of HMC5883

void setup(){
  //Initialize Serial and I2C communications
  Serial.begin(9600);
  Wire.begin();
  
  //Put the HMC5883 IC into the correct operating mode
  Wire.beginTransmission(address); //open communication with HMC5883
  Wire.send(0x02); //select mode register
  Wire.send(0x00); //continuous measurement mode
  Wire.endTransmission();
}
  void loop(){
  
  int x,y,z; //triple axis data

  //Tell the HMC5883L where to begin reading data
  Wire.beginTransmission(address);
  Wire.send(0x03); //select register 3, X MSB register
  Wire.endTransmission();
  
 
 //Read data from each axis, 2 registers per axis
  Wire.requestFrom(address, 6);
  if(6<=Wire.available()){
    x = Wire.receive()<<8; //X msb
    x |= Wire.receive(); //X lsb
    z = Wire.receive()<<8; //Z msb
    z |= Wire.receive(); //Z lsb
    y = Wire.receive()<<8; //Y msb
    y |= Wire.receive(); //Y lsb
  }
  
  //Print out values of each axis
  Serial.print("x: ");
  Serial.print(x);
  Serial.print("  y: ");
  Serial.print(y);
  Serial.print("  z: ");
  Serial.println(z);
  
  delay(250);
}

 

 

3 Month Warranty

SKU TA0057
Barcode # 9351634002917
Brand iDuino
Shipping Weight 0.0300kg
Shipping Width 0.140m
Shipping Height 0.020m
Shipping Length 0.090m
Shipping Cubic 0.000252000m3
Unit Of Measure ea

Magnetometer

By: on 10 March 2019
It's just arrived - lots of work to integrate it into our project
(5)

Does the job and a great price

By: on 17 February 2019
Does the job I needed without any trouble. Works nicely with Linux PC using an AVR i2c-usb bridge board. Would have preferred the headers not soldered on the board but I would imagine if they were left off someone will say "Would prefer headers soldered on" A small degree of uncertainty regarding what the proper power connection options and pinouts due to lack of datasheet/layout for the board but a couple of minutes of searching on the internet and enough information was located. MIT licenced source code available at - https://github.com/inflex/compass-switch
(4)

HMC5883L

By: on 28 May 2017
Awesome sensor. Super sensitive. Easy to use.
(5)

Write a product review

Others Also Bought

More From This Category