Stufin
Home Quick Cart Profile

MPU-9250 6-Axis Attitude Gyro and Accelero Sensor Module (Without Magnetometer)

Buy Now

Gyroscope

+ Range250/s
+ Resolution16 bits
+ Bandwidth100 Hz to 10 kHz

Accelerometer

+ Range2g to 16g
+ Resolution16 bits
+ Bandwidth10 Hz to 1 kHz

Supply Voltage

2.4 V to 3.6 V

Current Consumption

3.2 mA (active mode), 10 A (sleep mode)

Interfaces

I2C or SPI (selectable)

Operating Temperature

-40C to +85C

Package

3 mm x 3 mm QFN

Applications

The MPU-9250 6-Axis Attitude Gyro and Accelero Sensor Module is suitable for a wide range of applications, including

Robotics and drone navigation

Autonomous vehicles and GPS systems

IoT and smart home devices

Wearable devices and fitness trackers

Industrial automation and process control

Gaming and virtual reality systems

Pin Configuration

  • MPU-9250 6-Axis Attitude Gyro and Accelerometer Sensor Module (Without Magnetometer) Pinout Explanation
  • The MPU-9250 is a 6-axis attitude gyro and accelerometer sensor module that provides accurate and reliable data for orientation, acceleration, and angular velocity measurements. This documentation explains the pinout of the module, highlighting each pin's function and connection requirements.
  • Pinout Structure:
  • The MPU-9250 module has a total of 16 pins, arranged in two rows of 8 pins each. The pinout is as follows:
  • Row 1 ( Pins 1-8 ):
  • 1. VCC (Pin 1): Power supply pin. Connect to a 3.3V or 5V power source.
  • Connection: +3.3V or +5V power supply
  • 2. GND (Pin 2): Ground pin. Connect to the system ground.
  • Connection: System ground
  • 3. SCL (Pin 3): Clock pin for I2C communication.
  • Connection: I2C clock signal from microcontroller or other I2C master device
  • 4. SDA (Pin 4): Data pin for I2C communication.
  • Connection: I2C data signal from microcontroller or other I2C master device
  • 5. INT (Pin 5): Interrupt pin. Triggers when data is ready or an event occurs.
  • Connection: Interrupt input on microcontroller or other devices
  • 6. FSYNC (Pin 6): Frame synchronization pin. Used for synchronizing data transmission.
  • Connection: FSYNC signal from microcontroller or other devices (optional)
  • 7. XDA (Pin 7): Not connected. No internal connection.
  • Connection: None
  • 8. XCL (Pin 8): Not connected. No internal connection.
  • Connection: None
  • Row 2 (Pins 9-16):
  • 9. VLOGIC (Pin 9): Logic voltage pin. Determines the logic level of the I2C interface.
  • Connection: +3.3V or +5V power supply (same as VCC)
  • 10. CLI (Pin 10): Not connected. No internal connection.
  • Connection: None
  • 11. NCS (Pin 11): Chip select pin for SPI communication. (Not used in I2C mode)
  • Connection: SPI chip select signal from microcontroller or other SPI master device (optional)
  • 12. MOSI (Pin 12): Master out slave in pin for SPI communication. (Not used in I2C mode)
  • Connection: SPI master out signal from microcontroller or other SPI master device (optional)
  • 13. MISO (Pin 13): Master in slave out pin for SPI communication. (Not used in I2C mode)
  • Connection: SPI slave out signal from microcontroller or other SPI slave device (optional)
  • 14. SCK (Pin 14): Clock pin for SPI communication. (Not used in I2C mode)
  • Connection: SPI clock signal from microcontroller or other SPI master device (optional)
  • 15. SDO (Pin 15): Not connected. No internal connection.
  • Connection: None
  • 16. SDI (Pin 16): Not connected. No internal connection.
  • Connection: None
  • Connection Summary:
  • VCC and VLOGIC pins should be connected to a 3.3V or 5V power supply.
  • GND pin should be connected to the system ground.
  • SCL and SDA pins should be connected to the I2C clock and data signals from a microcontroller or other I2C master device.
  • INT pin can be connected to an interrupt input on a microcontroller or other devices.
  • FSYNC pin can be connected to an FSYNC signal from a microcontroller or other devices (optional).
  • The remaining pins (XDA, XCL, CLI, NCS, MOSI, MISO, SCK, SDO, and SDI) are not used or connected in I2C mode.
  • Remember to check the datasheet and the specific microcontroller or device you are using to ensure compatible pin connections and communication protocols.

Code Examples

MPU-9250 6-Axis Attitude Gyro and Accelerometer Sensor Module (Without Magnetometer) Documentation
Overview
The MPU-9250 is a 6-axis attitude gyro and accelerometer sensor module that combines a 3-axis gyroscope, a 3-axis accelerometer, and a digital motion processing unit (DMP) in a single chip. This module is widely used in robotics, drone, and IoT applications that require precise motion tracking and stabilization. The MPU-9250 does not include a magnetometer, which is typically used for magnetic field measurements.
Pinouts and Interface
The MPU-9250 module typically comes with a 16-pin interface, including:
VCC: Power supply (3.3V or 5V)
 GND: Ground
 SCL: I2C clock
 SDA: I2C data
 INT: Interrupt
 AD0: Address pin (optional)
 FSYNC: Frame sync pin (optional)
Communication Protocol
The MPU-9250 uses the I2C (Inter-Integrated Circuit) protocol for communication with microcontrollers or other devices. The I2C bus consists of two wires: SCL (clock) and SDA (data).
Code Examples
### Example 1: Basic I2C Communication with Arduino
This example demonstrates how to read accelerometer and gyroscope data from the MPU-9250 using an Arduino board.
```cpp
#include <Wire.h>
#define MPU9250_ADDRESS 0x68 // default address of MPU-9250
void setup() {
  Serial.begin(9600);
  Wire.begin(); // initialize I2C bus
}
void loop() {
  // read accelerometer data
  int16_t ax, ay, az;
  Wire.beginTransmission(MPU9250_ADDRESS);
  Wire.write(0x3B); // start address for accelerometer data
  Wire.endTransmission();
  Wire.requestFrom(MPU9250_ADDRESS, 6);
  ax = Wire.read() << 8 | Wire.read();
  ay = Wire.read() << 8 | Wire.read();
  az = Wire.read() << 8 | Wire.read();
// read gyroscope data
  int16_t gx, gy, gz;
  Wire.beginTransmission(MPU9250_ADDRESS);
  Wire.write(0x43); // start address for gyroscope data
  Wire.endTransmission();
  Wire.requestFrom(MPU9250_ADDRESS, 6);
  gx = Wire.read() << 8 | Wire.read();
  gy = Wire.read() << 8 | Wire.read();
  gz = Wire.read() << 8 | Wire.read();
Serial.print("Accelerometer: ");
  Serial.print(ax); Serial.print(" ");
  Serial.print(ay); Serial.print(" ");
  Serial.println(az);
  Serial.print("Gyroscope: ");
  Serial.print(gx); Serial.print(" ");
  Serial.print(gy); Serial.print(" ");
  Serial.println(gz);
delay(100);
}
```
### Example 2: DMP (Digital Motion Processing) with Raspberry Pi (Python)
This example demonstrates how to use the MPU-9250's DMP feature to calculate the device's orientation (quaternion) and temperature using a Raspberry Pi and Python.
```python
import smbus
import time
# MPU-9250 I2C address
MPU9250_ADDRESS = 0x68
# DMP-related registers
DMP_BANK = 0x04
DMP_START_ADDR = 0x32
DMP_GET_QUAT = 0x52
DMP_GET_TEMP = 0x51
bus = smbus.SMBus(1)  # use I2C bus 1 on Raspberry Pi
def read quaternion():
  bus.write_byte(MPU9250_ADDRESS, DMP_BANK)
  bus.write_byte(MPU9250_ADDRESS, DMP_GET_QUAT)
  data = bus.read_i2c_block_data(MPU9250_ADDRESS, DMP_START_ADDR, 16)
  return data
def read_temperature():
  bus.write_byte(MPU9250_ADDRESS, DMP_BANK)
  bus.write_byte(MPU9250_ADDRESS, DMP_GET_TEMP)
  data = bus.read_byte(MPU9250_ADDRESS, DMP_START_ADDR)
  return data
while True:
  quat = read_quaternion()
  temp = read_temperature()
  print("Quaternion: w={}, x={}, y={}, z={}".format(quat[0], quat[1], quat[2], quat[3]))
  print("Temperature: {}C".format(temp))
  time.sleep(0.1)
```
Note: These examples are for illustration purposes only and may require modifications to work with specific hardware configurations or firmware versions. Always consult the official datasheet and documentation for the MPU-9250 and your microcontroller or development board for more information.