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 is a 3.0×3.0x0.9mm surface mount 16-pin leadless chip carrier (LCC).
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. These sensors’ solid-state construction is designed to measure both the direction and the magnitude of magnetic fields, from milli-gauss to 8 gauss. Honeywell’s Magnetic Sensors are among the most sensitive and reliable low-field sensors in the industry.
Parts Required
Here are the parts I used
Name | Link | |
ESP32 | ||
HMC5983 | ||
Connecting cables |
Schematic
Code
You will need to install the following library – https://github.com/arduino/HMC5983
#include <HMC5983.h> #include <Wire.h> HMC5983 compass; void setup () { Serial.begin(9600); compass.begin(); // use "true" if you need some debug information } void loop() { float c = -999; c = compass.read(); if (c == -999) { Serial.println("Reading error, discarded"); } else { Serial.println(c); } delay(500); }
Output
Open the serial monitor
41.96
72.31
77.81
75.22
73.74
77.98
80.32
81.14
81.37
82.08