Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use SparkFun IMU Breakout ICM-20948: Examples, Pinouts, and Specs

Image of SparkFun IMU Breakout ICM-20948
Cirkit Designer LogoDesign with SparkFun IMU Breakout ICM-20948 in Cirkit Designer

Introduction

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.

Explore Projects Built with SparkFun IMU Breakout ICM-20948

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Motion Tracking System with ICM20948 Sensor
Image of ICM20948: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
This circuit features a SparkFun ESP32 Thing Plus microcontroller interfaced with an Adafruit ICM20948 9-axis motion sensor via an Adafruit TXB0104 4-channel bi-directional level shifter. The ESP32 reads data from the ICM20948 sensor, calculates orientation angles such as pitch, roll, yaw, and azimuth, and outputs these values to the serial monitor. The level shifter ensures compatibility between the 3.3V logic levels of the ESP32 and the 1.8V logic levels required by the ICM20948.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Multi-MPU6050 and MPU9250 IMU Data Aggregator
Image of gant vr: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
This circuit features an ESP32 microcontroller interfaced with multiple MPU-6050 sensors and a single MPU-9250 sensor through an Adafruit TCA9548A I2C multiplexer, allowing for the reading of multiple inertial measurement units (IMUs) over the same I2C bus. The ESP32 collects and processes acceleration and gyroscopic data from the sensors to calculate angles in the X and Y axes. Power management is handled by a TP4056 charging module and an AMS1117 voltage regulator, which together with two 18650 Li-ion batteries, provide a stable power supply for the microcontroller and sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer
SparkFun Pro Micro Based Motion Tracking System with BMI160 and EEPROM Data Logging
Image of Basic Arduino Sparkfun Pro Micro + BMI160: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
This circuit is designed for motion sensing and data logging applications. It features a SparkFun Pro Micro microcontroller interfaced with a BMI160 6DOF sensor for motion detection and two 24LC512 EEPROM chips for extended data storage. The microcontroller reads gyroscopic and accelerometer data from the BMI160 sensor, processes it, and stores it in the EEPROM, with power supplied by a Polymer Lithium Ion Battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
ATmega328P-Based Sensor Hub with OLED Display and LIDAR
Image of TILTPCB: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
This circuit features an Mtiny Uno ATmega328P microcontroller as its central processing unit, interfacing with a variety of sensors and peripherals. It includes a 0.96" OLED display and an MPU6050 accelerometer/gyroscope for user interface and motion sensing, respectively. The circuit also integrates a TF LUNA LIDAR for distance measurement, a DHT11 sensor for temperature and humidity readings, and uses a 9V battery with a 7805 voltage regulator for power management. Communication with a computer for programming and data exchange is facilitated by an Adafruit FTDI Friend module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with SparkFun IMU Breakout ICM-20948

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ICM20948: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
ESP32-Based Motion Tracking System with ICM20948 Sensor
This circuit features a SparkFun ESP32 Thing Plus microcontroller interfaced with an Adafruit ICM20948 9-axis motion sensor via an Adafruit TXB0104 4-channel bi-directional level shifter. The ESP32 reads data from the ICM20948 sensor, calculates orientation angles such as pitch, roll, yaw, and azimuth, and outputs these values to the serial monitor. The level shifter ensures compatibility between the 3.3V logic levels of the ESP32 and the 1.8V logic levels required by the ICM20948.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of gant vr: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
ESP32-Controlled Multi-MPU6050 and MPU9250 IMU Data Aggregator
This circuit features an ESP32 microcontroller interfaced with multiple MPU-6050 sensors and a single MPU-9250 sensor through an Adafruit TCA9548A I2C multiplexer, allowing for the reading of multiple inertial measurement units (IMUs) over the same I2C bus. The ESP32 collects and processes acceleration and gyroscopic data from the sensors to calculate angles in the X and Y axes. Power management is handled by a TP4056 charging module and an AMS1117 voltage regulator, which together with two 18650 Li-ion batteries, provide a stable power supply for the microcontroller and sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Basic Arduino Sparkfun Pro Micro + BMI160: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
SparkFun Pro Micro Based Motion Tracking System with BMI160 and EEPROM Data Logging
This circuit is designed for motion sensing and data logging applications. It features a SparkFun Pro Micro microcontroller interfaced with a BMI160 6DOF sensor for motion detection and two 24LC512 EEPROM chips for extended data storage. The microcontroller reads gyroscopic and accelerometer data from the BMI160 sensor, processes it, and stores it in the EEPROM, with power supplied by a Polymer Lithium Ion Battery.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of TILTPCB: A project utilizing SparkFun IMU Breakout ICM-20948 in a practical application
ATmega328P-Based Sensor Hub with OLED Display and LIDAR
This circuit features an Mtiny Uno ATmega328P microcontroller as its central processing unit, interfacing with a variety of sensors and peripherals. It includes a 0.96" OLED display and an MPU6050 accelerometer/gyroscope for user interface and motion sensing, respectively. The circuit also integrates a TF LUNA LIDAR for distance measurement, a DHT11 sensor for temperature and humidity readings, and uses a 9V battery with a 7805 voltage regulator for power management. Communication with a computer for programming and data exchange is facilitated by an Adafruit FTDI Friend module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Robotics for motion tracking and navigation
  • Drones for stabilization and orientation control
  • Wearable devices for activity monitoring
  • Gaming controllers for motion-based input
  • Industrial equipment for vibration analysis and monitoring

Technical Specifications

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)

Pin Configuration and Descriptions

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)

Usage Instructions

How to Use the Component in a Circuit

  1. Power Supply: Connect the 3.3V pin to a 3.3V power source and the GND pin to ground.
  2. Communication Interface: Choose between I²C or SPI communication:
    • For I²C, connect the SDA and SCL pins to the corresponding I²C lines on your microcontroller.
    • For SPI, connect the CS, SDA (MOSI), SCL (SCK), and optionally the INT pin for interrupt handling.
  3. Pull-Up Resistors: If using I²C, ensure pull-up resistors (typically 4.7kΩ) are present on the SDA and SCL lines.
  4. Interrupts: Optionally, connect the INT pin to a GPIO pin on your microcontroller to handle interrupts for motion detection or data-ready signals.

Important Considerations and Best Practices

  • Voltage Levels: Ensure the logic levels of your microcontroller match the 1.8V logic level of the ICM-20948. Use a level shifter if necessary.
  • Magnetometer Calibration: Perform a magnetometer calibration to account for environmental magnetic interference.
  • Data Rates: Configure the data output rates appropriately to balance performance and power consumption.
  • Mounting: Secure the breakout board firmly to minimize vibrations and improve measurement accuracy.

Example Code for Arduino UNO

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
  }
}

Troubleshooting and FAQs

Common Issues

  1. IMU Not Detected:

    • Ensure the I²C address (default 0x69) matches the configuration in your code.
    • Verify the SDA and SCL connections and check for proper pull-up resistors.
    • Confirm the power supply voltage is 3.3V.
  2. Incorrect or No Data:

    • Check for loose or incorrect wiring.
    • Ensure the IMU is properly mounted to avoid excessive vibrations.
    • Perform a magnetometer calibration if magnetic readings are inaccurate.
  3. Interrupts Not Triggering:

    • Verify the INT pin is connected to a GPIO pin on your microcontroller.
    • Check the interrupt configuration in your code.

Solutions and Tips

  • Use a logic level shifter if your microcontroller operates at 5V logic levels.
  • For SPI communication, ensure the CS pin is correctly configured and pulled low during communication.
  • Refer to the SparkFun ICM-20948 datasheet for advanced configuration options and register settings.

By following this documentation, you can effectively integrate the SparkFun IMU Breakout ICM-20948 into your projects for precise motion sensing and orientation tracking.