

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








The MPU6050 is a highly integrated sensor with the following key specifications:
| Parameter | Value |
|---|---|
| Supply Voltage | 2.375V to 3.46V |
| Logic Voltage Level | 1.8V to VDD |
| Gyroscope Range | ±250, ±500, ±1000, ±2000 °/s |
| Accelerometer Range | ±2g, ±4g, ±8g, ±16g |
| Communication Interface | I2C (up to 400kHz) |
| Operating Temperature | -40°C to +85°C |
| Power Consumption | 3.9mA (typical) |
| Dimensions | 4x4x0.9 mm (QFN package) |
The MPU6050 has 8 pins, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VDD | Power supply input (2.375V to 3.46V). |
| 2 | VLOGIC | Logic voltage input (1.8V to VDD). |
| 3 | GND | Ground connection. |
| 4 | SCL | I2C clock line. |
| 5 | SDA | I2C data line. |
| 6 | AD0 | I2C address select (connect to GND for 0x68 or VDD for 0x69). |
| 7 | INT | Interrupt output (active high, can be used for motion detection). |
| 8 | RESV | Reserved pin (leave unconnected). |
Below is an example of how to interface the MPU6050 with an Arduino UNO using the Wire library:
#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 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); // Initialize serial communication for debugging
// Wake up the MPU6050 (it starts in sleep mode)
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
Wire.beginTransmission(MPU6050_ADDR);
Wire.write(ACCEL_XOUT_H); // Start reading from ACCEL_XOUT_H register
Wire.endTransmission(false); // Send restart condition
Wire.requestFrom(MPU6050_ADDR, 6); // Request 6 bytes (X, Y, Z high and low)
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
Serial.print("Accel X: "); Serial.print(accelX);
Serial.print(" | Accel Y: "); Serial.print(accelY);
Serial.print(" | Accel Z: "); Serial.println(accelZ);
}
delay(500); // Wait 500ms before the next reading
}
No I2C Communication:
Incorrect or No Sensor Data:
Interrupt Pin Not Working:
Q: Can the MPU6050 operate at 5V?
A: No, the MPU6050 operates at a maximum of 3.46V. Use a level shifter for 5V systems.
Q: How do I calibrate the MPU6050?
A: Calibration involves reading raw data from the sensor and calculating offsets for the gyroscope and accelerometer. These offsets can then be subtracted from the raw readings during operation.
Q: What is the maximum sampling rate of the MPU6050?
A: The MPU6050 supports a maximum sampling rate of 1kHz for both the gyroscope and accelerometer.
Q: Can I use the MPU6050 without an interrupt pin?
A: Yes, the interrupt pin is optional. You can poll the sensor data over I2C without using interrupts.