Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use MPU6050: Examples, Pinouts, and Specs

Image of MPU6050
Cirkit Designer LogoDesign with MPU6050 in Cirkit Designer

Introduction

The MPU6050, manufactured by SIMAC Electronics GmbH, 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, such as robotics, drones, smartphones, and gaming devices. Its ability to measure angular velocity and linear acceleration makes it an essential component for projects involving motion tracking and stabilization.

Explore Projects Built with MPU6050

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Controlled Multi-MPU6050 and MPU9250 IMU Data Aggregator
Image of gant vr: A project utilizing MPU6050 in a practical application
This circuit features an ESP32 microcontroller interfaced with multiple MPU-6050 sensors and a single MPU-9250 sensor through an Adafruit TCA9548A I2C multiplexer, allowing for the reading of multiple inertial measurement units (IMUs) over the same I2C bus. The ESP32 collects and processes acceleration and gyroscopic data from the sensors to calculate angles in the X and Y axes. Power management is handled by a TP4056 charging module and an AMS1117 voltage regulator, which together with two 18650 Li-ion batteries, provide a stable power supply for the microcontroller and sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and MPU-6050 Based Motion Sensing System
Image of mi: A project utilizing MPU6050 in a practical application
This circuit uses an Arduino UNO to interface with an MPU-6050 accelerometer and gyroscope sensor. The Arduino reads motion data from the MPU-6050 via I2C communication and outputs the processed data to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and MPU-6050 Based Motion Sensing System with I2C Interface
Image of mpu6050new: A project utilizing MPU6050 in a practical application
This circuit features an Arduino UNO connected to an MPU-6050 accelerometer and gyroscope sensor via an I2C module. The Arduino UNO provides power to the sensor and communicates with it using the I2C protocol, enabling the collection of motion and orientation data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and MPU6050-Based Motion Sensing System
Image of SENSORS LAB: A project utilizing MPU6050 in a practical application
This circuit interfaces an MPU6050 Accelerometer and Gyroscope with an Arduino UNO. The MPU6050 is powered by the Arduino's 3.3V and GND pins, and communicates with the Arduino via the I2C protocol using the SDA and SCL lines connected to the Arduino's A4 and A5 pins, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with MPU6050

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of gant vr: A project utilizing MPU6050 in a practical application
ESP32-Controlled Multi-MPU6050 and MPU9250 IMU Data Aggregator
This circuit features an ESP32 microcontroller interfaced with multiple MPU-6050 sensors and a single MPU-9250 sensor through an Adafruit TCA9548A I2C multiplexer, allowing for the reading of multiple inertial measurement units (IMUs) over the same I2C bus. The ESP32 collects and processes acceleration and gyroscopic data from the sensors to calculate angles in the X and Y axes. Power management is handled by a TP4056 charging module and an AMS1117 voltage regulator, which together with two 18650 Li-ion batteries, provide a stable power supply for the microcontroller and sensors.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of mi: A project utilizing MPU6050 in a practical application
Arduino UNO and MPU-6050 Based Motion Sensing System
This circuit uses an Arduino UNO to interface with an MPU-6050 accelerometer and gyroscope sensor. The Arduino reads motion data from the MPU-6050 via I2C communication and outputs the processed data to the serial monitor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of mpu6050new: A project utilizing MPU6050 in a practical application
Arduino UNO and MPU-6050 Based Motion Sensing System with I2C Interface
This circuit features an Arduino UNO connected to an MPU-6050 accelerometer and gyroscope sensor via an I2C module. The Arduino UNO provides power to the sensor and communicates with it using the I2C protocol, enabling the collection of motion and orientation data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of SENSORS LAB: A project utilizing MPU6050 in a practical application
Arduino UNO and MPU6050-Based Motion Sensing System
This circuit interfaces an MPU6050 Accelerometer and Gyroscope with an Arduino UNO. The MPU6050 is powered by the Arduino's 3.3V and GND pins, and communicates with the Arduino via the I2C protocol using the SDA and SCL lines connected to the Arduino's A4 and A5 pins, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

The MPU6050 is designed to deliver high precision and reliability in motion sensing applications. Below are its key technical specifications:

Key Specifications

  • Supply Voltage: 2.375V to 3.46V (typical 3.3V)
  • Communication Interface: I2C (up to 400kHz)
  • Gyroscope Range: ±250, ±500, ±1000, ±2000 degrees/second
  • Accelerometer Range: ±2g, ±4g, ±8g, ±16g
  • Operating Temperature: -40°C to +85°C
  • Power Consumption: 3.9mA (typical in active mode)
  • Package: 24-pin QFN (4x4x0.9mm)

Pin Configuration and Descriptions

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).
GND 2 Ground connection.
SCL 6 I2C clock line.
SDA 7 I2C data line.
AD0 8 I2C address select (logic high: 0x69, logic low: 0x68).
INT 12 Interrupt output pin for motion detection or data ready signals.
FSYNC 9 Frame synchronization input (optional, used for external synchronization).
AUX_DA 22 Auxiliary I2C data line for external sensors (optional).
AUX_CL 23 Auxiliary I2C clock line for external sensors (optional).

For a complete pinout, refer to the official datasheet provided by SIMAC Electronics GmbH.

Usage Instructions

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 MPU6050 into your project:

Connecting the MPU6050 to an Arduino UNO

  1. Power Supply: Connect the VDD pin to the 3.3V output of the Arduino and the GND pin to the Arduino's GND.
  2. I2C Communication: Connect the SCL pin to the Arduino's A5 pin and the SDA pin to the Arduino's A4 pin (for older boards) or to the dedicated I2C pins on newer boards.
  3. Address Selection: Connect the AD0 pin to GND for the default I2C address (0x68) or to VDD for the alternate address (0x69).
  4. Interrupts (Optional): If using interrupts, connect the INT pin to a digital input pin on the Arduino.

Sample Arduino Code

The following code demonstrates how to read raw accelerometer and gyroscope data from the MPU6050 using the Arduino IDE:

#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; // High byte of accelerometer X-axis data
const int GYRO_XOUT_H = 0x43;  // High byte of gyroscope X-axis data

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, gyroX;

  // Read accelerometer X-axis data
  Wire.beginTransmission(MPU6050_ADDR);
  Wire.write(ACCEL_XOUT_H); // Request high byte of accelerometer X-axis
  Wire.endTransmission(false);
  Wire.requestFrom(MPU6050_ADDR, 2); // Request 2 bytes
  accelX = (Wire.read() << 8) | Wire.read(); // Combine high and low bytes

  // Read gyroscope X-axis data
  Wire.beginTransmission(MPU6050_ADDR);
  Wire.write(GYRO_XOUT_H); // Request high byte of gyroscope X-axis
  Wire.endTransmission(false);
  Wire.requestFrom(MPU6050_ADDR, 2); // Request 2 bytes
  gyroX = (Wire.read() << 8) | Wire.read(); // Combine high and low bytes

  // 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
}

Best Practices

  • Use pull-up resistors (4.7kΩ to 10kΩ) on the SCL and SDA lines if not already included on your breakout board.
  • Ensure the MPU6050 is powered with a stable 3.3V supply to avoid damage.
  • Avoid placing the sensor near sources of vibration or electromagnetic interference for accurate readings.
  • Calibrate the sensor before use to improve accuracy.

Troubleshooting and FAQs

Common Issues

  1. No Data or Incorrect Readings:

    • Ensure the I2C connections (SCL and SDA) are correct and secure.
    • Verify the I2C address (default is 0x68) and adjust the code if using the alternate address (0x69).
  2. Device Not Detected:

    • Check the power supply voltage (must be between 2.375V and 3.46V).
    • Use an I2C scanner sketch to confirm the device address.
  3. Inconsistent or Noisy Data:

    • Perform sensor calibration to account for offsets and biases.
    • Use software filtering (e.g., a complementary filter) to smooth the data.

FAQs

Q: Can the MPU6050 be used with 5V logic microcontrollers?
A: Yes, but a logic level shifter is required to safely interface the 3.3V MPU6050 with 5V logic.

Q: How do I calibrate the MPU6050?
A: Calibration involves reading the raw sensor data while the device is stationary and calculating offsets for each axis. These offsets can then be subtracted from subsequent readings.

Q: Can I use the MPU6050 with SPI instead of I2C?
A: No, the MPU6050 only supports I2C communication.

By following this documentation, you can effectively integrate the MPU6050 into your projects and troubleshoot common issues. For more advanced features, refer to the official datasheet and application notes provided by SIMAC Electronics GmbH.