The Adafruit Precision 9-DoF LSM6DSOX + LIS3MDL FeatherWing is a comprehensive motion sensing solution that combines a 3-axis accelerometer, a 3-axis gyroscope, and a 3-axis magnetometer into a single module. This FeatherWing is designed to interface seamlessly with Adafruit's Feather development boards, providing a powerful tool for creating projects that require orientation tracking, motion sensing, and navigational functionalities. Common applications include drones, robotics, gesture control, and augmented reality devices.
Accelerometer/Gyroscope (LSM6DSOX):
Magnetometer (LIS3MDL):
Operating Voltage: 3.3V
Interface: I2C
I2C Addresses:
Pin | Function | Description |
---|---|---|
GND | Ground | Common ground for power and logic |
3V | Power | 3.3V power supply input |
SCL | I2C Clock | Serial Clock for I2C communication |
SDA | I2C Data | Serial Data for I2C communication |
INT1 | Interrupt 1 | Configurable interrupt for LSM6DSOX |
INT2 | Interrupt 2 | Configurable interrupt for LIS3MDL |
To use the Adafruit Precision 9-DoF LSM6DSOX + LIS3MDL FeatherWing with a Feather board:
Below is an example code snippet for interfacing the Adafruit Precision 9-DoF LSM6DSOX + LIS3MDL FeatherWing with an Arduino UNO. This code initializes the sensor and reads the accelerometer, gyroscope, and magnetometer data.
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM6DSOX.h>
#include <Adafruit_LIS3MDL.h>
// Create sensor instances
Adafruit_LSM6DSOX sox = Adafruit_LSM6DSOX();
Adafruit_LIS3MDL mdl = Adafruit_LIS3MDL();
void setup() {
Serial.begin(115200);
// Wait for serial monitor to open
while (!Serial) { delay(10); }
// Initialize LSM6DSOX
if (!sox.begin_I2C()) {
Serial.println("Failed to find LSM6DSOX chip");
while (1) { delay(10); }
}
// Initialize LIS3MDL
if (!mdl.begin_I2C()) {
Serial.println("Failed to find LIS3MDL chip");
while (1) { delay(10); }
}
Serial.println("LSM6DSOX + LIS3MDL FeatherWing started!");
}
void loop() {
// Read accelerometer and gyroscope
sensors_event_t accel;
sensors_event_t gyro;
sensors_event_t mag;
sox.getEvent(&accel, &gyro, NULL);
// Read magnetometer
mdl.getEvent(&mag);
// Print values to serial monitor
Serial.print("Accel X: "); Serial.print(accel.acceleration.x); Serial.print(" m/s^2 ");
Serial.print("Y: "); Serial.print(accel.acceleration.y); Serial.print(" m/s^2 ");
Serial.print("Z: "); Serial.print(accel.acceleration.z); Serial.println(" m/s^2 ");
Serial.print("Gyro X: "); Serial.print(gyro.gyro.x); Serial.print(" dps ");
Serial.print("Y: "); Serial.print(gyro.gyro.y); Serial.print(" dps ");
Serial.print("Z: "); Serial.print(gyro.gyro.z); Serial.println(" dps ");
Serial.print("Mag X: "); Serial.print(mag.magnetic.x); Serial.print(" uT ");
Serial.print("Y: "); Serial.print(mag.magnetic.y); Serial.print(" uT ");
Serial.print("Z: "); Serial.print(mag.magnetic.z); Serial.println(" uT ");
delay(100);
}
Q: Can I use this FeatherWing with a 5V microcontroller? A: Yes, but you must use a logic level converter to step down the 5V signals to 3.3V to avoid damaging the sensors.
Q: How do I calibrate the magnetometer? A: Adafruit provides a calibration sketch and instructions on their website. Follow the guide to perform the calibration.
Q: What is the maximum sampling rate for the sensors? A: The LSM6DSOX can sample up to 6.66 kHz for the gyroscope and 1.66 kHz for the accelerometer. The LIS3MDL can sample up to 155 Hz.
For further assistance, consult the Adafruit forums or the detailed datasheets for the LSM6DSOX and LIS3MDL sensors.