

The SparkFun IMU Breakout ICM-20948 is a compact and versatile inertial measurement unit (IMU) that integrates a 9-axis motion sensor. It combines a 3-axis gyroscope, a 3-axis accelerometer, and a 3-axis magnetometer into a single package, enabling precise motion tracking and orientation detection. This component is ideal for applications requiring motion sensing, such as robotics, drones, wearable devices, and gaming controllers.








The following table outlines the key technical specifications of the SparkFun IMU Breakout ICM-20948:
| Parameter | Specification |
|---|---|
| Gyroscope Range | ±250, ±500, ±1000, ±2000 dps |
| Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
| Magnetometer Range | ±4900 µT |
| Operating Voltage | 1.8V (logic) / 3.3V (power supply) |
| Communication Interface | I²C (up to 400 kHz) / SPI (up to 7 MHz) |
| Operating Temperature | -40°C to +85°C |
| Dimensions | 1.0" x 1.0" (25.4mm x 25.4mm) |
The SparkFun IMU Breakout ICM-20948 features the following pinout:
| Pin Name | Description |
|---|---|
| GND | Ground connection |
| 3.3V | Power supply input (3.3V) |
| SDA | I²C data line (or SPI data input in SPI mode) |
| SCL | I²C clock line (or SPI clock in SPI mode) |
| CS | Chip select for SPI communication (active low) |
| INT | Interrupt output (can be configured for motion detection or data ready) |
| RST | Reset pin (active low, used to reset the device) |
3.3V pin to a 3.3V power source and the GND pin to ground.SDA and SCL pins to the corresponding I²C lines on your microcontroller.CS, SDA (MOSI), SCL (SCK), and optionally the INT pin for interrupt handling.SDA and SCL lines.INT pin to a GPIO pin on your microcontroller to handle interrupts for motion detection or data-ready signals.Below is an example of how to interface the SparkFun IMU Breakout ICM-20948 with an Arduino UNO using I²C:
#include <Wire.h>
#include <SparkFun_ICM-20948_ArduinoLibrary.h> // Include the SparkFun library
ICM_20948_I2C myICM; // Create an ICM-20948 object
void setup() {
Serial.begin(115200); // Initialize serial communication
Wire.begin(); // Initialize I²C communication
// Initialize the IMU
if (myICM.begin(Wire, 0x69) != ICM_20948_Stat_Ok) {
Serial.println("IMU initialization failed!");
while (1); // Halt if initialization fails
}
Serial.println("IMU initialized successfully!");
}
void loop() {
// Check if new data is available
if (myICM.dataReady()) {
myICM.getAGMT(); // Read accelerometer, gyroscope, and magnetometer data
// Print accelerometer data
Serial.print("Accel X: ");
Serial.print(myICM.accX());
Serial.print(" Y: ");
Serial.print(myICM.accY());
Serial.print(" Z: ");
Serial.println(myICM.accZ());
// Print gyroscope data
Serial.print("Gyro X: ");
Serial.print(myICM.gyrX());
Serial.print(" Y: ");
Serial.print(myICM.gyrY());
Serial.print(" Z: ");
Serial.println(myICM.gyrZ());
// Print magnetometer data
Serial.print("Mag X: ");
Serial.print(myICM.magX());
Serial.print(" Y: ");
Serial.print(myICM.magY());
Serial.print(" Z: ");
Serial.println(myICM.magZ());
delay(100); // Delay for readability
}
}
IMU Not Detected:
0x69) matches the configuration in your code.SDA and SCL connections and check for proper pull-up resistors.Incorrect or No Data:
Interrupts Not Triggering:
INT pin is connected to a GPIO pin on your microcontroller.CS pin is correctly configured and pulled low during communication.By following this documentation, you can effectively integrate the SparkFun IMU Breakout ICM-20948 into your projects for precise motion sensing and orientation tracking.