HMC5883L Triple Axis Compass Magnetometer Sensor Module
Now available from PMD Way are these great value HMC5883L Triple Axis Compass Magnetometer Sensor Modules.
Using the HMC5883L you can sense both the direction and the magnitude of Earth’s magnetic fields. Using this data you can then determine within a degree or two your heading towards magnetic north (not true north!) So you can have fun with various tasks - from making a simple compass to helping an autonomous device navigate.
As this detects magnetic field strength, the more magentic interference received from electrical devices (etc) - the less accurate the results will be.
Module is compatible with both 3.3V and 5V systems. Inline header pins are included however will require soldering.
- I2C interface - bus address is 0x1E
- Works with both 3.3V and 5V
- Accuracy +/- 1~2 degrees
- Update rate up to 160Hz
- Range of -8 to +8 Gauss
- For complete details and specfications, download the data sheet
Quick Arduino demonstration:
First, download and install the HMC5883L library from here. Next, solder the inline header pins to the module. Then connect your module to the Arduino with the following connections:
- Module Vcc to Arduino 5V
- Module SDA to Arduino A4
- Module SCL to Arduino A5
- Module GND to ... Arduino GND!
Now connect your Arduino to the computer, open the IDE and upload the example sketch included with the HMC5883L library. Open the serial monitor, set the data rate to 9600 and you should be presented with the raw and position data, for example: