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

How to Use InvenSense MPU6050: Examples, Pinouts, and Specs

Image of InvenSense MPU6050
Cirkit Designer LogoDesign with InvenSense MPU6050 in Cirkit Designer

Introduction

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.

Explore Projects Built with InvenSense 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!
Gesture-Controlled Wheelchair with Arduino UNO, Arduino Nano, and HC-05 Bluetooth Modules
Image of Gesture Control Wheelchair: A project utilizing InvenSense MPU6050 in a practical application
This circuit features an Arduino Nano interfaced with an InvenSense MPU6050 accelerometer/gyroscope for motion sensing and an HC-05 Bluetooth module for wireless communication. The Arduino Nano processes the MPU6050 data to interpret gestures and sends corresponding commands via Bluetooth. Additionally, an Arduino UNO is connected to an L298N motor driver to control two DC motors, receiving commands from a separate HC-05 module, likely for remote maneuvering of a vehicle or robotic platform.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and MPU6050-Based Motion Sensing System
Image of ESP MPU6050 accelerometer: A project utilizing InvenSense MPU6050 in a practical application
This circuit integrates an ESP32 microcontroller with an MPU6050 accelerometer and gyroscope sensor. The ESP32 communicates with the MPU6050 via I2C protocol, with connections for power, ground, SCL, and SDA lines, enabling the ESP32 to read motion and orientation data from the sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Multi-MPU6050 and MPU9250 IMU Data Aggregator
Image of gant vr: A project utilizing InvenSense 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 Controlled Motion Detection and Wireless Communication System
Image of Hand_UAV_Controller: A project utilizing InvenSense MPU6050 in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an InvenSense MPU6050 accelerometer/gyroscope for motion sensing and an NRF24L01 module for wireless communication. The Arduino reads the MPU6050 data to determine orientation and motion, and uses button inputs to trigger different wireless commands sent via the NRF24L01. The circuit likely serves as a wireless motion-controlled interface for applications such as remote-controlled devices or interactive systems.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with InvenSense 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 Gesture Control Wheelchair: A project utilizing InvenSense MPU6050 in a practical application
Gesture-Controlled Wheelchair with Arduino UNO, Arduino Nano, and HC-05 Bluetooth Modules
This circuit features an Arduino Nano interfaced with an InvenSense MPU6050 accelerometer/gyroscope for motion sensing and an HC-05 Bluetooth module for wireless communication. The Arduino Nano processes the MPU6050 data to interpret gestures and sends corresponding commands via Bluetooth. Additionally, an Arduino UNO is connected to an L298N motor driver to control two DC motors, receiving commands from a separate HC-05 module, likely for remote maneuvering of a vehicle or robotic platform.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ESP MPU6050 accelerometer: A project utilizing InvenSense MPU6050 in a practical application
ESP32 and MPU6050-Based Motion Sensing System
This circuit integrates an ESP32 microcontroller with an MPU6050 accelerometer and gyroscope sensor. The ESP32 communicates with the MPU6050 via I2C protocol, with connections for power, ground, SCL, and SDA lines, enabling the ESP32 to read motion and orientation data from the sensor.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of gant vr: A project utilizing InvenSense 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 Hand_UAV_Controller: A project utilizing InvenSense MPU6050 in a practical application
Arduino UNO Controlled Motion Detection and Wireless Communication System
This circuit features an Arduino UNO microcontroller interfaced with an InvenSense MPU6050 accelerometer/gyroscope for motion sensing and an NRF24L01 module for wireless communication. The Arduino reads the MPU6050 data to determine orientation and motion, and uses button inputs to trigger different wireless commands sent via the NRF24L01. The circuit likely serves as a wireless motion-controlled interface for applications such as remote-controlled devices or interactive systems.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Motion tracking in smartphones and tablets
  • Stabilization systems for drones and robotics
  • Gesture recognition in gaming controllers
  • Wearable fitness and health monitoring devices
  • Industrial equipment monitoring

Technical Specifications

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

Pin Configuration

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.

Usage Instructions

Connecting the MPU6050 to an Arduino UNO

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)

Sample Arduino Code

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

Important Considerations

  1. Power Supply: Ensure the MPU6050 is powered with a stable voltage within the specified range (2.375V to 3.46V for VDD).
  2. Pull-Up Resistors: The I2C lines (SCL and SDA) require pull-up resistors (typically 4.7kΩ) for proper operation. Some breakout boards include these resistors.
  3. I2C Address: The default I2C address is 0x68. If the AD0 pin is connected to VDD, the address changes to 0x69.
  4. Interrupt Pin: The INT pin can be used to trigger an interrupt on the microcontroller when new data is available.

Troubleshooting and FAQs

Common Issues

  1. No Data from the Sensor

    • Ensure the MPU6050 is properly powered and connected to the correct I2C pins.
    • Verify that the I2C address matches the configuration in your code.
  2. Inconsistent or Noisy Readings

    • Check for loose connections or poor soldering.
    • Use proper decoupling capacitors near the power pins to reduce noise.
  3. I2C Communication Errors

    • Ensure pull-up resistors are present on the SCL and SDA lines.
    • Verify that the I2C clock speed does not exceed 400kHz.

FAQs

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.