Web Site: www.parallax.com Office: (916) 624-8333 Forums: forums.parallax.com Fax: (916) 624-8003 Sales: sales parallax.com Sales: (888) 512-1024 Technical: support parallax.com Tech Support: (888) 997-8267 Compass Module 3-Axis HMC5883L ( 29133) The Compass Module 3-Axis HMC5883L is a low-field magnetic sensing device with a digital interface. The compass module converts any magnetic field to a differential voltage output on 3 axes. 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. The module is designed for use with a large variety of microcontrollers with different voltage requirements. Features 3-Axis magneto-resistive sensor 1 to 2 degree compass heading accuracy Wide magnetic field range (+/-8 gauss) Fast 160 Hz maximum output rate Precision in-axis sensitivity and linearity Measures Earths magnetic field, from milli-gauss to 8 gauss Key Specifications Power Requirements: 2.7 to 6.5 VDC Communication Interface: IC (up to 400 kHz) Operating temperature: -22 to +185 F (-30 to +85 C) Dimensions: 0.73 x .65 in ( 1.8 x 1.7 cm) Application Ideas Auto and personal navigation UAV systems Robotic navigation Location-based services (LBS) Resources and Downloads Check for the latest version of this document, free software, and example programs from the Compass Module 3-Axis HMC5883L product page. Go to www.parallax.com and search for part number 29133. Copyright Parallax Inc. Compass Module 3-Axis HMC5883L ( 29133) v1.0 11/4/2011 Page 1 of 6 Quick-Start Guide The following is a very basic procedure to get started initializing and reading values from the Compass Module. This module is equipped with 4.7 k pull-up resistors on the SDA line and a 2.2K resistor on the SCL line. There is no need for any external hardware to operate. The schematic is available from the 29133 product page at www.parallax.com. 1. With main power off, make the proper connections between the compass module and a microcontroller as shown above. The voltage connected to the VIN pin should be the same as the voltage powering the microcontroller communicating with the device. 2. Power on the device and load the BASIC Stamp or Propeller microcontroller sample code provided on the 29133 product page. Note: For other microcontrollers first, setup the module for continues output mode by writing (0x3C) 0x00 to the MODE register (0x02). Once running in continues mode set a pointer to OUTPUT X MSB by writing (0x3C) 0x03 to the device. Now the compass module will output raw data from OUTPUT X MSB - OUTPUT Y LSB. The compass will automatically index through these registers there is no need to set pointers for each of these registers. The last step would be to read from each of the six output registers, 8 bits of data per register. For more details on these modes and registers please see the datasheet on the 29133 product page at www.parallax.com. Precautions This module is VERY sensitive to ferrous material, metal objects, magnets and power supplies, etc. Any of these items in close range may affect performance. If youre experiencing adverse results, check your environment for anything that may influence magnetic fields. It is recommended to connect the unit with wires, keeping it away from a breadboard. Without tilt compensation the device will need to be level for accurate headings. For tilt compensation, you will need an accelerometer. See the application notes available on the 29133 product page for details on tilt compensation. Copyright Parallax Inc. Compass Module 3-Axis HMC5883L ( 29133) v1.0 11/4/2011 Page 2 of 6