Sense the magnetic fields that surround us with this handy triple-axis magnetometer (compass) module. Magnetometers can sense where the strongest magnetic force is coming from, generally used to detect magnetic north, but can also be used for measuring magnetic fields. This sensor tends to be paired with a 6-DoF (degree of freedom) accelerometer/gyroscope to create a 9-DoF inertial measurement unit that can detect its orientation in real-space thanks to Earth's stable magnetic field. It's a great match for the LSM6DSOX from ST!
We based this breakout on ST's LIS3MDL, a great general purpose magnetometer. This compact sensor uses I2C to communicate, and it's very easy to use. Simply download our library and connect the SCL pin to your I2C clock pin, and SDA pin to your I2C data pin and upload our test program to read out magnetic field data. If you'd like, you can also use SPI to receive data (we just happen to prefer I2C here)
This sensor can sense ranges from +-4 gauss (+- 400 uTesla) up to +-16 gauss (+- 1600 uT or 1.6 mT). For ultra-high precision, 155 Hz update rate is recommended - but if you don't mind a little loss of precision, the sensor can output at 1000 Hz.