The Honeywell HMC5983 is a temperature compensated three-axis integrated circuit magnetometer. This surface-mount, multi-chip module is designed for low-field magnetic sensing for applications such as automotive and personal navigation, vehicle detection, and pointing.
The HMC5983 includes our state-of-the-art, high-resolution HMC118X series magnetoresistive sensors plus an ASIC containing amplification, automatic degaussing strap drivers, offset cancellation, and a 12-bit ADC that enables 1° to 2° compass heading accuracy. The I²C or SPI serial bus allows for easy interface.
The HMC5983 utilizes Honeywell’s Anisotropic Magnetoresistive (AMR) technology that provides advantages over other magnetic sensor technologies. Honeywell’s anisotropic, directional sensors excel in linearity, low hysteresis, null output and scale factor stability over temperature, and with very low cross-axis sensitivity.
Schematic and Connection
Code
I2C1.setup( { scl: B6, sda: B7 } ); var compass=require("HMC5883").connect(I2C1,C11,0); compass.setGain(1); compass.setup(0,0); compass.reads(function(a) {console.log(a);});
Output
{ “x”: 131.56000238656, “y”: -299.92000544071, “z”: -35.88000065088, “overflow”: false }
{ “x”: 202.40000367164, “y”: -42.32000076770, “z”: 89.24000161886, “overflow”: false }
{ “x”: 214.36000388860, “y”: -47.84000086784, “z”: 75.44000136852, “overflow”: false }
Links
https://www.espruino.com/HMC5883