The Compass Module 3-Axis HMC5883L is designed for low-field magnetic sensing with a digital interface. 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 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. Example code in PBASIC, Spin, and C are provided below in the Downloads. Click over to the KickStart Guide to see how to use the compass module, complete with wiring diagrams and sample code for the BASIC Stamp, Propeller, and Arduino.
Note: For tilt compensation, you will need to use an accelerometer along with this module. See the application notes for details on tilt compensation.
Downloads & Resources:KickStart Guide with wiring examples and sample code
Compass Datasheet (.pdf)
Compass Example Spin Source Code (.zip)
Compass Example BS2 Source Code (.zip)
Compass Example PDE Source Code (.zip)
Compass AppNote 1 (.pdf)
Compass AppNote 2 (.pdf)
Report a problem
Suggest a product