Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›MPU9250 9-Axis IMU

Component guide · Intermediate · 4 min read

MPU9250 9-Axis IMU

Pinout, Wiring and Code

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerWhat the MPU9250 isMPU9250 pinoutWiring the MPU9250Example codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Short answer

The MPU9250 is a 9-axis motion sensor: a 3-axis accelerometer and gyroscope (the MPU6500 core) plus an AK8963 3-axis magnetometer in one package. It talks I2C at address 0x68 or SPI. Use it for tilt, heading and orientation in robots, drones and wearables, and check the WHO_AM_I register first, because many modules sold as MPU9250 carry a different chip.

Key specs at a glance

Sensors
3-axis accelerometer, 3-axis gyroscope, 3-axis magnetometer (AK8963)
Accelerometer range
±2, ±4, ±8 or ±16 g
Gyroscope range
±250 to ±2000 °/s
Magnetometer
±4800 µT, 14 or 16-bit
Interface
I2C (0x68, or 0x69 with AD0 high) up to 400 kHz, SPI up to 1 MHz (20 MHz for data reads)
Supply
Chip 2.4 to 3.6 V; most modules have a regulator for 3.3 to 5 V
WHO_AM_I
0x71 (an MPU6500 answers 0x70)
01

What the MPU9250 is

The MPU9250 from InvenSense (now TDK) combines the motion core of the MPU6500 with an AK8963 compass die. The accelerometer measures gravity and movement, the gyroscope measures rotation speed and the magnetometer measures the Earth's magnetic field, so together they can give a heading that does not drift.

The magnetometer sits behind the main chip: in I2C bypass mode it appears as a second device at address 0x0C. The part is no longer made, so some boards sold under this name carry an MPU6500 (no compass) or an MPU9255; reading WHO_AM_I tells you which one you have. For a new design the ICM-20948 is the current 9-axis part.

02

MPU9250 pinout

The pins on the MPU9250 and what each one does.

PinFunction
VCCSupply, 3.3 to 5 V on modules with a regulator
GNDGround
SCL / SCLKI2C clock, or SPI clock
SDA / SDII2C data, or SPI data in
EDA / ECLAuxiliary I2C bus for an external sensor (leave open)
AD0 / SDOI2C address select (GND 0x68, VCC 0x69), or SPI data out
INTInterrupt output (data ready, motion)
NCSSPI chip select; leave high for I2C
FSYNCFrame sync input; tie to GND if unused
PinFunction
VCC
Supply, 3.3 to 5 V on modules with a regulator
GND
Ground
SCL / SCLK
I2C clock, or SPI clock
SDA / SDI
I2C data, or SPI data in
EDA / ECL
Auxiliary I2C bus for an external sensor (leave open)
AD0 / SDO
I2C address select (GND 0x68, VCC 0x69), or SPI data out
INT
Interrupt output (data ready, motion)
NCS
SPI chip select; leave high for I2C
FSYNC
Frame sync input; tie to GND if unused
03

Wiring the MPU9250

Most blue MPU9250 boards have a 3.3 V regulator and pull-up resistors, so they run from the Uno's 5 V pin. The I2C lines are pulled up to 3.3 V, which an Uno reads correctly.

MPU9250 pinArduino UnoESP32
VCC5V (or 3.3V)3V3
GNDGNDGND
SDAA4GPIO 21
SCLA5GPIO 22
AD0GND (address 0x68)GND (address 0x68)
INTD2 (optional)GPIO 4 (optional)
VCC
Arduino Uno:
5V (or 3.3V)
ESP32:
3V3
GND
Arduino Uno:
GND
ESP32:
GND
SDA
Arduino Uno:
A4
ESP32:
GPIO 21
SCL
Arduino Uno:
A5
ESP32:
GPIO 22
AD0
Arduino Uno:
GND (address 0x68)
ESP32:
GND (address 0x68)
INT
Arduino Uno:
D2 (optional)
ESP32:
GPIO 4 (optional)
04

Example code

Lying flat, the Z axis should read about 1.00 g. For heading and fused angles use a library such as MPU9250 by hideakitai or the Bolder Flight MPU9250 library.

Check WHO_AM_I and read the accelerometer (Arduino) · Arduino C++Verify & upload in Electrolark
#include <Wire.h>
const uint8_t MPU = 0x68;

uint8_t readReg(uint8_t reg) {
  Wire.beginTransmission(MPU); Wire.write(reg); Wire.endTransmission(false);
  Wire.requestFrom(MPU, (uint8_t)1);
  return Wire.read();
}

void setup() {
  Serial.begin(115200);
  Wire.begin();
  Wire.beginTransmission(MPU); Wire.write(0x6B); Wire.write(0); Wire.endTransmission(); // wake up
  Serial.print("WHO_AM_I: 0x"); Serial.println(readReg(0x75), HEX);   // 0x71 = MPU9250
}

void loop() {
  Wire.beginTransmission(MPU); Wire.write(0x3B); Wire.endTransmission(false);
  Wire.requestFrom(MPU, (uint8_t)6);
  int16_t ax = Wire.read() << 8 | Wire.read();
  int16_t ay = Wire.read() << 8 | Wire.read();
  int16_t az = Wire.read() << 8 | Wire.read();
  // default range is ±2 g: 16384 counts per g
  Serial.print(ax / 16384.0); Serial.print("  ");
  Serial.print(ay / 16384.0); Serial.print("  ");
  Serial.println(az / 16384.0);
  delay(200);
}
05

Setup and tuning

Find the address

run an I2C scanner. 0x68 or 0x69 is the motion core; 0x0C appears only after bypass mode is enabled.

Gyro offset

keep the board still for a few seconds at start-up and average the gyro readings to remove the zero offset.

Compass calibration

turn the board slowly through every direction (a figure of eight) and record the minimum and maximum of each axis; centre the readings on those values. Recalibrate after you mount it.

Mounting

keep it away from motors, magnets, speakers and steel screws, which bend the magnetic field.

Sample rate

set the digital low-pass filter to cut vibration noise on robots and drones.

06

What you need

Shop this list4 of 5 found in our store · ₹2,946

  • MPU9250 9-axis sensor module: the sensor this guide coversMPU9250 9-Axis Gyro Accelerometer Magnetometer Sensor Module with I2C Interface₹2,369Closest match, check the specs
  • Uno R3 development board: the controller used in the wiring tableFind this part
  • ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389
  • 0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
  • Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
07

Alternatives and when to choose them

  • ✓MPU6050: 6-axis only (no compass), cheaper and very well documented.
  • ✓BNO055: does the sensor fusion on the chip and outputs angles directly.
  • ✓ICM-20948: the current-production 9-axis successor.
  • ✓Magnetometers and 9-axis IMUs: how compass calibration works.
08

Try it: I2c pullup calculator

Change the values and the diagram and results update as you type.

09

Common mistakes to avoid

  • !Reading the compass at 0x0C without enabling I2C bypass first.
  • !Expecting a heading from a board that turns out to be an MPU6500 (WHO_AM_I 0x70).
  • !Mounting it next to a motor or a steel screw and getting a wrong heading.
  • !Using the raw gyro angle without fusion, so it drifts within seconds.
10

Frequently asked questions

What is the I2C address of the MPU9250?

0x68 with AD0 to GND, 0x69 with AD0 to VCC. The AK8963 compass is at 0x0C in bypass mode.

Does the MPU9250 work with 3.3 V boards?

Yes. The chip is a 3.3 V part, and modules with a regulator also accept 5 V.

Why does my MPU9250 show no magnetometer?

Either bypass mode is off, or the board carries an MPU6500 or MPU6515. Check WHO_AM_I: 0x71 is a genuine MPU9250.

Can it give yaw without drift?

Yes, when you fuse the calibrated magnetometer with the gyro, for example with a Madgwick or Mahony filter.

MPU9250 or MPU6050?

Choose the MPU6050 for tilt and balance; choose the MPU9250 when you need a compass heading.

Is the MPU9250 still made?

No, it is end of life. The ICM-20948 is the recommended replacement for new designs.

Parts for this guide

  • MPU9250 9-Axis Gyro Accelerometer Magnetometer Sensor Module with I2C Interface
    ₹2,369View
  • Uno R3 Development Board (No Cable)
    ₹359View
  • ESP32-WROOM-32 38-Pin Development Board
    ₹389View
  • 0.96" OLED Display 128x64
    ₹139View
  • Dupont Jumper Wires (40 pcs)
    ₹49View
Shop Accelerometers, Gyroscopes & IMUs

Calculators

I2c pullup calculator

Terms in this guide

I2CInter-Integrated Circuit: a two-wire bus (SDA and SCL) that connects many devices by address.

Projects that use it

Put this into practice: 1 step-by-step build in our project library uses parts from this guide.

Intermediate · 3 hoursBike trip computer with GNSS speed and a crash alertView project
Browse all 1 project

Keep learning

Component guideIntermediateMPU6050 Accelerometer and GyroscopeThe MPU6050 is a 6-axis motion sensor that combines a 3-axis accelerometer and a 3-axis gyroscope on one chip and talks over I2C at address 0x68.3 min read · SensorsComponent guideIntermediateMagnetometers and 9-Axis IMUsA 9-axis IMU adds a magnetometer to a gyroscope and accelerometer so it can give a stable heading as well as roll and pitch.3 min read · SensorsConcept explainerIntermediateI2C ExplainedI2C is a two-wire bus that lets one microcontroller talk to many sensors and displays using a data line (SDA) and a clock line (SCL).4 min read · Electronics FundamentalsHow-toIntermediateDrone GPS, Compass and RTK ModulesA GPS and compass module lets a drone hold position and return home.3 min read · Drones & FPV

Sources

  • MPU-9250 product specification and register map (InvenSense)
  • AK8963 3-axis electronic compass datasheet (AKM)

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerWhat the MPU9250 isMPU9250 pinoutWiring the MPU9250Example codeSetup and tuningWhat you needAlternatives and when to choose themTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide (Arduino Uno)2 items · ₹2,573

MPU9250 9-Axis Gyro Accelerometer Magnetometer Sensor Module with I2C Interface · Uno R3 CH340G ATmega328p Compatible Development Board

Run itChange the inputs and watch the output

WHO_AM_I 0x71 is a real MPU9250; 0x70 means an MPU6500 (no magnetometer) was fitted.

Serial monitor115200 baud
WHO_AM_I: 0x71
-0.00  -0.00  1.00

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question