Adafruit LIS2MDL Triple-axis Magnetometer Breakout Board is based on the STM LIS2MDL, a general-purpose magnetometer. This sensor tends to be paired with a 6 Degree-of-Freedom (DoF) accelerometer/gyroscope to create a 9-DoF inertial measurement unit that can detect its orientation in real space. The compact sensor uses I2C to communicate since it is very easy to use and users can also use SPI to receive data. The user can simply download the library and connect the SCL pin to the I2C clock pin and the SDA pin to the I2C data pin. The Adafruit test program can be uploaded to read magnetic field data. The LIS2MDL triple-axis magnetometer can sense ranges from ±50 gauss (±5000uTesla) with no range-setting required. For high resolution, a 100Hz update rate is recommended, and with little loss of precision, the sensor can output at 150Hz.
The integrated LIS2MDL sensor onto a breakout PCB, along with support circuitry, helps the user to use 3.3V (Feather/Raspberry Pi) or 5V (Arduino/Metro328) logic levels. The triple-axis magnetometer breakout board includes SparkFun Qwiic compatible STEMMA QT connectors for the I2C bus that avoids soldering. The CircuitPython/Python or Arduino drivers can easily interface with the LIS2MDL and get magnetic measurements using MCU.