

The InvenSense MPU6050 is a 6-axis motion tracking device that integrates a 3-axis gyroscope and a 3-axis accelerometer into a single chip. This compact and versatile sensor is widely used in applications requiring precise motion detection and orientation tracking. Its ability to measure both angular velocity and linear acceleration makes it ideal for use in smartphones, drones, gaming controllers, robotics, and wearable devices.








The following table outlines the key technical details of the MPU6050:
| Parameter | Value |
|---|---|
| Manufacturer | InvenSense |
| Part ID | MPU-6050 |
| Supply Voltage (VDD) | 2.375V to 3.46V |
| I/O Voltage (VLOGIC) | 1.8V to VDD |
| Gyroscope Range | ±250, ±500, ±1000, ±2000 °/s |
| Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
| Communication Interface | I2C (up to 400kHz) or SPI |
| Operating Temperature | -40°C to +85°C |
| Power Consumption | 3.9mA (typical, in full operation mode) |
| Package | 4x4x0.9 mm QFN |
The MPU6050 has 24 pins, but the most commonly used pins for basic operation are listed below:
| Pin Name | Pin Number | Description |
|---|---|---|
| VDD | 1 | Power supply input (2.375V to 3.46V) |
| VLOGIC | 2 | Logic voltage input (1.8V to VDD) |
| GND | 3 | Ground |
| SCL | 6 | I2C clock line |
| SDA | 7 | I2C data line |
| AD0 | 8 | I2C address select (0 or 1) |
| INT | 12 | Interrupt output |
| FSYNC | 14 | Frame synchronization input |
For a complete pinout, refer to the official datasheet.
The MPU6050 communicates via the I2C protocol, which requires only two data lines: SCL (clock) and SDA (data). Below is a simple wiring guide for connecting the MPU6050 to an Arduino UNO:
| MPU6050 Pin | Arduino UNO Pin |
|---|---|
| VDD | 3.3V |
| GND | GND |
| SCL | A5 (I2C Clock) |
| SDA | A4 (I2C Data) |
| AD0 | GND (I2C Address 0) |
The following Arduino sketch demonstrates how to initialize the MPU6050 and read raw accelerometer and gyroscope data:
#include <Wire.h>
// MPU6050 I2C address (default is 0x68 when AD0 is connected to GND)
const int MPU6050_ADDR = 0x68;
// MPU6050 register addresses
const int ACCEL_XOUT_H = 0x3B; // Accelerometer X-axis high byte
const int GYRO_XOUT_H = 0x43; // Gyroscope X-axis high byte
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication for debugging
// Wake up the MPU6050 (set power management register to 0)
Wire.beginTransmission(MPU6050_ADDR);
Wire.write(0x6B); // Power management register
Wire.write(0); // Set to 0 to wake up the sensor
Wire.endTransmission();
}
void loop() {
int16_t accelX = readMPU6050(ACCEL_XOUT_H); // Read accelerometer X-axis
int16_t gyroX = readMPU6050(GYRO_XOUT_H); // Read gyroscope X-axis
// Print the raw data to the Serial Monitor
Serial.print("Accel X: ");
Serial.print(accelX);
Serial.print(" | Gyro X: ");
Serial.println(gyroX);
delay(500); // Delay for readability
}
// Function to read 16-bit data from the MPU6050
int16_t readMPU6050(int reg) {
Wire.beginTransmission(MPU6050_ADDR);
Wire.write(reg); // Specify the register to read from
Wire.endTransmission(false); // Restart I2C communication
Wire.requestFrom(MPU6050_ADDR, 2); // Request 2 bytes of data
// Combine high and low bytes into a 16-bit value
int16_t value = (Wire.read() << 8) | Wire.read();
return value;
}
0x68. If the AD0 pin is connected to VDD, the address changes to 0x69.No Data from the Sensor
Inconsistent or Noisy Readings
I2C Communication Errors
Q: Can the MPU6050 measure temperature?
A: Yes, the MPU6050 includes an onboard temperature sensor. The raw temperature data can be read from registers 0x41 and 0x42.
Q: What is the maximum sampling rate of the MPU6050?
A: The MPU6050 supports a maximum sampling rate of 1kHz for both the accelerometer and gyroscope.
Q: Can I use the MPU6050 with a 5V microcontroller?
A: Yes, but you must use a logic level shifter or ensure the MPU6050's VLOGIC pin is set to 3.3V to avoid damage.
Q: How do I calibrate the MPU6050?
A: Calibration involves determining and compensating for sensor offsets. This can be done in software by averaging readings when the sensor is stationary and subtracting the offsets from subsequent measurements.