

The MPU6050, manufactured by ST with the part ID GY-25, is a 6-axis motion tracking device that integrates a 3-axis gyroscope and a 3-axis accelerometer on a single chip. This compact and versatile sensor is widely used in applications requiring motion sensing and orientation detection. Its ability to measure angular velocity and linear acceleration makes it ideal for robotics, drones, smartphones, gaming devices, and wearable technology.








The MPU6050 offers a range of features and specifications that make it a popular choice for motion sensing applications. Below are the key technical details:
| Parameter | Value |
|---|---|
| Supply Voltage | 2.375V to 3.46V |
| Operating Current | 3.6 mA (typical) |
| Gyroscope Range | ±250, ±500, ±1000, ±2000 °/s |
| Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
| Communication Interface | I2C (up to 400 kHz) or SPI (up to 1 MHz) |
| Operating Temperature | -40°C to +85°C |
| Package Type | QFN-24 |
The MPU6050 has 8 primary pins for interfacing. Below is the pinout description:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (2.375V to 3.46V) |
| 2 | GND | Ground connection |
| 3 | SCL | I2C clock line |
| 4 | SDA | I2C data line |
| 5 | AD0 | I2C address select (connect to GND or VCC) |
| 6 | INT | Interrupt output |
| 7 | FSYNC | Frame synchronization input |
| 8 | CLKIN | Optional external clock input |
The MPU6050 is straightforward to use in a circuit, especially with microcontrollers like the Arduino UNO. Below are the steps and best practices for integrating the sensor:
Below is an example of how to read data from the MPU6050 using the Arduino IDE and the Wire library:
#include <Wire.h>
const int MPU_ADDR = 0x68; // I2C address of the MPU6050 (default is 0x68)
void setup() {
Wire.begin(); // Initialize I2C communication
Serial.begin(9600); // Start serial communication for debugging
// Wake up the MPU6050 (it starts in sleep mode)
Wire.beginTransmission(MPU_ADDR);
Wire.write(0x6B); // Access the power management register
Wire.write(0); // Set to 0 to wake up the sensor
Wire.endTransmission();
}
void loop() {
Wire.beginTransmission(MPU_ADDR);
Wire.write(0x3B); // Starting register for accelerometer data
Wire.endTransmission(false);
Wire.requestFrom(MPU_ADDR, 6, true); // Request 6 bytes of data
// Read accelerometer data (2 bytes each for X, Y, Z axes)
int16_t accelX = (Wire.read() << 8) | Wire.read();
int16_t accelY = (Wire.read() << 8) | Wire.read();
int16_t accelZ = (Wire.read() << 8) | Wire.read();
// Print the accelerometer data 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); // Delay for readability
}
No Data or Incorrect Readings:
Sensor Not Detected:
Unstable or Noisy Data:
Interrupt Pin Not Working:
Q1: Can the MPU6050 be used with a 5V microcontroller?
Yes, the GY-25 breakout board includes a voltage regulator, allowing it to work with 5V microcontrollers like the Arduino UNO.
Q2: What is the maximum sampling rate of the MPU6050?
The MPU6050 supports a maximum sampling rate of 1 kHz.
Q3: Can I use SPI instead of I2C?
The MPU6050 supports SPI communication, but the GY-25 breakout board is typically configured for I2C by default.
Q4: How do I calibrate the MPU6050?
Calibration involves reading the raw sensor data and calculating offsets for the gyroscope and accelerometer. Libraries like MPU6050 or MPU6050_DMP can simplify this process.
By following this documentation, you can effectively integrate and use the MPU6050 in your projects.