

The MPU6050 is a 6-axis motion tracking device that combines a 3-axis gyroscope and a 3-axis accelerometer on a single chip. It enables the measurement of angular velocity and acceleration in three-dimensional space, making it a versatile and widely used sensor in motion tracking and orientation detection applications.








The MPU6050 is a highly integrated sensor with the following key specifications:
| Parameter | Value |
|---|---|
| Supply Voltage | 2.375V to 3.46V |
| Operating Current | 3.6 mA (typical) |
| Sleep Mode Current | 5 µA |
| Gyroscope Range | ±250, ±500, ±1000, ±2000 °/s |
| Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
| Communication Interface | I2C (up to 400 kHz) |
| Operating Temperature | -40°C to +85°C |
| Package Type | 24-pin QFN |
The MPU6050 has 8 primary pins for interfacing. Below is the pinout description:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (2.375V to 3.46V) |
| 2 | GND | Ground |
| 3 | SCL | I2C clock line |
| 4 | SDA | I2C data line |
| 5 | AD0 | I2C address select (LOW: 0x68, HIGH: 0x69) |
| 6 | INT | Interrupt output (active HIGH) |
| 7 | FSYNC | Frame synchronization input (optional, active HIGH) |
| 8 | RESV | Reserved (leave unconnected) |
Below is an example of how to interface the MPU6050 with an Arduino UNO using the I2C protocol:
#include <Wire.h>
// MPU6050 I2C address (default is 0x68 when AD0 is LOW)
const int MPU6050_ADDR = 0x68;
// MPU6050 register addresses
const int PWR_MGMT_1 = 0x6B; // Power management register
const int ACCEL_XOUT_H = 0x3B; // Accelerometer X-axis high byte
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication for debugging
// Wake up the MPU6050 (clear sleep mode bit)
Wire.beginTransmission(MPU6050_ADDR);
Wire.write(PWR_MGMT_1); // Access power management register
Wire.write(0); // Set to 0 to wake up the sensor
Wire.endTransmission();
Serial.println("MPU6050 initialized");
}
void loop() {
// Request accelerometer data from MPU6050
Wire.beginTransmission(MPU6050_ADDR);
Wire.write(ACCEL_XOUT_H); // Start reading from ACCEL_XOUT_H register
Wire.endTransmission(false); // Send repeated start condition
Wire.requestFrom(MPU6050_ADDR, 6); // Request 6 bytes (X, Y, Z axes)
if (Wire.available() == 6) {
int16_t accelX = (Wire.read() << 8) | Wire.read(); // Combine high and low bytes
int16_t accelY = (Wire.read() << 8) | Wire.read();
int16_t accelZ = (Wire.read() << 8) | Wire.read();
// Print accelerometer values to the serial monitor
Serial.print("Accel X: "); Serial.print(accelX);
Serial.print(" | Accel Y: "); Serial.print(accelY);
Serial.print(" | Accel Z: "); Serial.println(accelZ);
}
delay(500); // Wait for 500ms before the next reading
}
No Data from Sensor:
Inaccurate Readings:
Sensor Not Responding:
By following this documentation, you can effectively integrate and utilize the MPU6050 in your projects.