MPU6050

6-axis MotionTracking sensor that combines a 3-axis gyroscope and 3-axis accelerometer on one I2C chip, with an on-chip Digital Motion Processor for offloaded sensor fusion.

MPU6050: Accelerometer and gyroscope

What is the MPU6050?

The MPU-6050 (InvenSense, now TDK) is a 6-axis inertial measurement unit that integrates a 3-axis gyroscope and a 3-axis accelerometer on a single die. Each of the six channels is digitized by its own 16-bit ADC, so the part streams true digital values rather than analog voltages. The gyroscope has a user-programmable full-scale range of plus or minus 250, 500, 1000, and 2000 degrees per second, and the accelerometer is configurable to plus or minus 2, 4, 8, and 16 g. An on-chip temperature sensor is included as well, and all of it is read over I2C at clock speeds up to 400 kHz.

On common breakout boards (the GY-521 is the usual one), the chip is broken out to 8 pins with an onboard voltage regulator and I2C pull-up resistors. The regulator lets the VCC pin accept a 3.3-5V supply, which is why the module drops onto both 3.3V and 5V microcontrollers, even though the bare MPU-6050 die itself runs at 3.3V. The default I2C address is 0x68, and pulling the AD0 pin high changes it to 0x69, so two of these can share one bus. An embedded Digital Motion Processor (DMP) and a 1024-byte FIFO can buffer and pre-process motion data to reduce host-processor load.

The device also exposes an auxiliary I2C master bus on the XDA and XCL pins. Connecting an external magnetometer to this bus lets the MPU-6050 gather a full 9-axis dataset for MotionFusion without extra work from the main processor. A dedicated INT (interrupt) pin can signal data-ready, motion-detection, and FIFO events so the host does not have to poll continuously.

MPU6050 pinout

PinFunctionType
VCC VCC (3.3-5V)PowerPower in
GND GNDPowerPower in
SCL SCLI²C SCLBidirectional (GPIO)
SDA SDAI²C SDABidirectional (GPIO)
XDA XDA (Aux)I²C SDABidirectional (GPIO)
XCL XCL (Aux)I²C SCLBidirectional (GPIO)
AD0 AD0 (Addr)DigitalDigital input
INT INTDigitalDigital output

Specifications

Operating voltage
3.3 V (max 5 V)
Interface
I²C
I²C address
0x68
I²C pull-ups
On-board (no external resistors)
Dimensions
21 × 16 × 3 mm

Verified from the Tinkered component library.

Circuit requirements

  • Power the VCC pin from 3.3V or 5V on a GY-521-style breakout; its onboard regulator produces the 3.3V the sensor die needs. A bare MPU-6050 chip with no regulator must be supplied at 3.3V and will be damaged by 5V.
  • Communication is I2C only: connect SCL and SDA to the microcontroller's I2C bus (A5/A4 on an Arduino Uno) and run the bus at 100 or 400 kHz.
  • Most breakout boards include I2C pull-up resistors on SDA and SCL, so external pull-ups are usually not required; avoid stacking many pulled-up modules on one bus.
  • Set the 7-bit I2C address with AD0: tie it low (or leave it to the board default) for 0x68, or drive it high for 0x69. Do not leave AD0 floating.
  • The INT pin is optional and only needs wiring if you want hardware interrupts for data-ready, motion, or FIFO events.
  • The XDA and XCL auxiliary pins are for attaching an external sensor such as a magnetometer; leave them unconnected unless you are building a 9-axis setup.

Board compatibility

The MPU6050 connects to any of the microcontrollers supported in Tinkered. Mind the 3.3 V logic level on 3.3 V boards.

Simulate the MPU6050 in your browser

The MPU6050 is fully simulated in Tinkered. Wire it into a circuit, write your firmware, and read real values back with no physical hardware. Test your logic before you touch a breadboard.

Open it in the simulator

Common MPU6050 mistakes

Forgetting the sensor powers up asleep

The MPU-6050 boots into sleep mode. If you get all-zero or frozen readings, you likely never cleared the SLEEP bit in the PWR_MGMT_1 register (0x6B). Most libraries do this in their begin()/initialize() call, so calling that first is essential.

Leaving AD0 floating

An unconnected AD0 pin lets the I2C address drift between 0x68 and 0x69, causing intermittent 'device not found' errors. Tie AD0 to GND for 0x68 or to VCC/3.3V for 0x69, especially when two units share the bus.

Expecting ready-made angles from raw data

The accelerometer and gyroscope output raw acceleration and angular-rate values, not tilt or heading. Usable orientation requires fusing the two (complementary or Kalman filter) or using the on-chip DMP; raw gyro integration alone drifts over time.

Powering the bare chip at 5V

It is the breakout board's regulator that tolerates 5V, not the MPU-6050 itself. Wiring 5V directly to the sensor die's VDD (on a custom board without a regulator) exceeds its rating and can destroy it.

Skipping gyro offset calibration

Every unit has a small zero-rate bias, so a stationary sensor still reports a nonzero rotation that accumulates into angle drift. Averaging a few hundred samples while the board sits still and subtracting that offset greatly improves results.

MPU6050 datasheet

Official MPU6050 datasheet

Popular MPU6050 projects

Self-balancing robot

Fuse the accelerometer and gyroscope to estimate tilt in real time and drive the motors that keep a two-wheeled robot upright.

Drone or quadcopter flight controller

Use the six axes as the core attitude sensor in a flight-stabilization loop, taking advantage of the high-rate gyro and selectable ranges.

Digital level and inclinometer

Read gravity direction from the accelerometer to build a tilt meter or electronic spirit level with degree readouts.

Gesture and motion detection

Detect taps, shakes, and free-fall using the INT pin and motion thresholds to trigger actions without polling.

Head tracking and VR input

Track head or controller orientation for immersive interfaces, optionally adding a magnetometer on the auxiliary bus for 9-axis heading.

Build with the MPU6050.

Drop the MPU6050 into a circuit, write firmware, and simulate it in your browser, then deploy to real hardware. All in one editable Tinkered project.