An accelerometer & gyroscope sensor is a module that measures acceleration and also angular velocity. An accelerometer measures linear acceleration along with a single or more axes. So it works by detecting the caused force by a change within motion or vibration. This force can cause the mass to press a piezoelectric material that generates an electrical charge. The Gyroscope sensor measures angular velocity. This sensor can be used in gaming controllers, robotics & other devices that need motion detection. Examples of accelerometer and gyroscope sensors include MPU6050, ADXL335, Adafruit MSA311, etc. This article briefly explains the MPU6050 module, its working, and its applications.
What is the MPU6050 Module?
The MPU6050 is an accelerometer gyroscope module that includes six axes (merges 3-axis gyroscope and accelerometer) which detects with a 16-bit measurement resolution. So the combination of two sensors is normally called an IMU (Inertial Measurement Unit). This module is very popular due to its high accuracy detection and low cost. This sensor is used in different applications like tablets, mobile phones, satellites, drones, spacecraft, robotics, UAVs, etc. These sensors can also used for orientation, position detection, motion tracking, flight control, and many more.
This module is available with a digital motion processor that performs extremely complex operations or calculations from its side. It provides different motion data like pitch, roll, angles, yaw, portrait sense, landscape, etc.
How MPU6050 Module Work?
MPU6050 module is a combination of accelerometer and gyroscope. The MPU6050 module is a MEMS (Micro-Electro-Mechanical System) that includes a 3-axis accelerometer & 3-axis gyroscope within it. So this helps to measure velocity, acceleration, displacement, orientation & many other motion-related object or system parameters. This module can also include a digital motion processor within it and is powerful enough to execute difficult calculations to free up the function of a microcontroller.
MPU6050 module includes two auxiliary pins, used for interfacing exterior IIC modules similar to a magnetometer. Since the module’s IIC address is configurable above one MPU6050 sensor then it can be interfaced with Microcontroller through the AD0 pin. So this module can also have well-documented & revised libraries thus it is very simple to utilize with Arduino platforms. So, this module is the right choice if you are seeking a sensor for your Drone, RC car, Humanoid, Self-balancing Robot, or Biped to control motion, then this module might be the correct choice.
Pin Configuration:
MPU6050 module includes 8 pins which are explained below.

MPU6050 Module Pin Configuration
- Pin-1 (Vcc): This pin provides a power supply to the module that ranges from +3V to +5V but this module uses +5V.
- Pin-2 (GND): It is a ground pin of the module, connected to the GND of the system.
- Pin-3 (SCL): It is a serial clock pin that provides a CLK signal for I2C communication.
- Pin-4 (SDA): It is a serial data pin used to transfer data through I2C communication.
- Pin-5 (XDA): It is an auxiliary serial data, used to interface I2C modules through MPU6050.
- Pin-6 (XCL): It is an auxiliary serial clock, used to interface I2C modules through MPU6050.
- Pin-7 (AD0): This pin is used to vary the address if the above one MPU6050 module is utilized by a single MCU.
- Pin-8 (INT): It is an interrupt digital output pin of the module that indicates the available data for the microcontroller unit to read.
Features & Specifications:
The features and specifications of the MPU6050 module include the following.
- The MPU6050 is a six-axis IMU (inertial measurement unit) sensor.
- This module is available in the QFN package.
- It is a 3-axis sensor with ±250, ±500, ±1000, or ±2000 degrees per second full-scale range.
- Its sensitivity is 131, 65.5, 32.8 (or) 16.4 LSBs for each dps.
- Output data rate ranges from 8 kHz to 1.25Hz.
- 3-axis sensing with a complete scale range is ±2g, ±4g, ±8g, (or) ±16g.
- Sensitivity is 16384, 8192, 4096, (or) 2048 LSBs for each g
- ODR range is from 8 kHz to 1.25Hz.
- Operating temperature ranges from -40°C to +85°C
- Sensitivity is 340 LSBs for each degree Celsius
- Accuracy is ±3°C.
- Operating voltage ranges from 2.375V to 3.46V for the MPU6050 module and ranges from 2.375V to 5.5V mainly for the MPU-6050A.
- I2C serial interface with 400 kHz max CLK frequency.
- 8-bit & 16-bit register access modes.
- Digital motion processor for complex motion processing
- It has on-chip 16-bit ADCs for accurate ADC.
- Programmable digital filters used for enhanced noise performance
- Interrupts are used for triggering events depending on specific motion conditions
- Power consumption is low for full operation like 3.9mA.
MPU6050 Module Components
MPU6050 module includes different components like a 3-axis gyroscope, 3-axis accelerometer, digital motion processor or DMP, temperature sensor, I2C bus interface & auxiliary I2C bus which are explained below.
- A MEMS rate gyroscope sensor of this module measures angular momentum & revolution along with all three axes.
- A MEMS accelerometer sensor of this module measures stationary acceleration occurred by gravity & dynamic acceleration occured by shock, vibration, or motion.
- DMP is a powerful digital motion processor that performs difficult calculations to free up the tasks of a microcontroller.
- The temperature sensor is an on-chip sensor that measures the temperature.
- The I2C bus interface allows the module to commune with microcontrollers
- The auxiliary I2C bus is an interface that permits the module to communicate with different sensor devices.
- The MPU6050 is a MEMS (Micro-Electro-Mechanical System) that measures velocity, acceleration, displacement, orientation & motion-related parameters.
- The MPU6050 module has MPU6050 IMU chip which is available in a 24-pin QFN package with 4mm x 4mm x 0.9mm dimensions.
- The module has less component count like AP2112K 3.3V regulator, bypass capacitors & I2C pull-up resistors.
- A power LED of this module indicates the power condition of the module.
Equivalents & Alternatives
Equivalents of MPU6050 modules are; LSM6DS3, BNO055, ADXL335, ADXL345 & MPU9250. Alternative accelerometer gyroscope modules are; MPU6050, BMS56M605, LSM6DS0, MPU9250, GY-521, etc.
MPU6050 Sensor Module Interfacing with Arduino
The MPU6050 sensor module interfacing with Arduino is shown below. The required components of this interfacing mainly include; the MPU6050 sensor module, Arduino, and connecting wires.
The connections of this interfacing follow as;
- Connect the 5v/3v pin of Arduino to the VCC pin of the MPU6050 module.
- Connect the GND pin of Arduino to the GND pin of the MPU6050 module.
- The A5 or SCL pin of Arduino is connected to the SCL pin of the module.
- The A4 or SDA pin of Arduino is connected to the SDA pin of the module.

MPU6050 Sensor Module Interfacing with Arduino
Code
The required code for this interfacing includes the following.
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h> <Wire.h>
Adafruit_MPU6050 mpu;
void setup(void) {
Serial.begin(115200);
// Try to initialize!
if (!mpu.begin()) {
Serial.println(“Failed to find MPU6050 chip”);
while (1) {
delay(10);
}
}
Serial.println(“MPU6050 Found!”);
// set accelerometer range to +-8G
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
// set gyro range to +- 500 deg/s
mpu.setGyroRange(MPU6050_RANGE_500_DEG);
// set filter bandwidth to 21 Hz
mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
delay(100);
}
void loop() {
/* Get new sensor events with the readings */
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
/* Print out the readings */
Serial.print(“Acceleration X: “);
Serial.print(a.acceleration.x);
Serial.print(“, Y: “);
Serial.print(a.acceleration.y);
Serial.print(“, Z: “);
Serial.print(a.acceleration.z);
Serial.println(” m/s^2″);
Serial.print(“Rotation X: “);
Serial.print(g.gyro.x);
Serial.print(“, Y: “);
Serial.print(g.gyro.y);
Serial.print(“, Z: “);
Serial.print(g.gyro.z);
Serial.println(” rad/s”);
Serial.print(“Temperature: “);
Serial.print(temp.temperature);
Serial.println(” degC”);
Serial.println(“”);
delay(1000);
}
Working
At the beginning of the code, we include the libraries required to communicate with the MPU6050 module and obtain the readings. After that, we generate a new instance known as mpu, which we use to get the readings from the module.
In the above setup function, we initialize the serial communication and the MPU6050. After that, we set the ranges of the accelerometer, gyroscope, and filter bandwidth parameters. These parameters will affect the accuracy of the readings. Thus, if required, we can modify these.
In the above loop function of the code, the MPU6050 reads the values using the Adafruit library. After that, the code prints the values on the serial monitor, and this process repeats every second.
By using this interfacing, we can read the accelerometer, temperature, and gyroscope data from the module and print it on the serial monitor. For that, the necessary libraries must be installed. So open the library manager within the Arduino IDE to install the libraries then search & install the libraries like Adafruit MPU6050 library, Adafruit Bus IO Library & Adafruit Unified Sensor Library.
Once you install these libraries, make a new sketch and paste this code into it. After that, compile the code and upload it to the Arduino board. When you upload it, open the serial monitor, and it will display the reading there. Whenever you turn the module, the value will change based on the rotation axis.
Advantages & Disadvantages
The advantages of the MPU6050 module include the following.
- The MPU6050 module is a 6-axis motion tracking device that merges a 3-axis accelerometer & a 3-axis gyroscope.
- This module provides consistent measurements of linear acceleration & angular velocity.
- It has a digital-output temperature sensor.
- The DMP offloads difficult calculations from the host processor.
- This module includes an embedded algorithm for compass calibration & run-time bias.
- It can be interfaced easily with a microcontroller (or) other device with an I2C connection.
- This module consumes less power.
- This module provides exact tracking for both gradual & quick movements.
- It is less costly.
- It has high performance.
The disadvantages of the MPU6050 module include the following.
- The sensor values can significantly change whenever it starts up, particularly the yaw data. So this is because of the sensor drift, which can take 40 seconds to complete.
- Using the voltage supply above the recommended range causes the module to break down, perform poorly, or be damaged.
- The core values must be changed in practical applications to obtain more precise readings.
- The calibration procedure of this module can take a longer or minute time based on how much the module moves.
- Strong winds can cause the system to modify orientation, so it can affect the measurements.
Applications
The applications of the MPU6050 module include the following.
- The Blur-free technology uses the MPU6050 module for video and still image stabilization.
- Developers use this module for authentication, security, and navigation purposes.
- Motion command technology utilizes it mainly for gesture shortcuts.
- Manufacturers use this module in handsets, gesture recognition, portable gaming equipment, 3D mice, 3D remote controllers, and more.
- Developers use this module in gesture command control, gaming, viewing, panoramic photo capture, motion-based games, smartphones, gaming controllers, and more.
- Engineers incorporate this module in humanoid robots, self-balancing robots, robotic arms, and others.
- Pilots use it in quadcopters and drones for stabilization and position control.
- Manufacturers implement this module in health tracking, fitness devices, gesture recognition, authentication systems, smartphones, various toys, and more.
Please refer to this link for the MPU6050 module datasheet.
The MPU6050 module is a six-axis motion tracking device that notices changes within angular position & acceleration. So it is an essential component used in various systems like robotics, drones, and gaming controllers for various complicated processes. The MPU6050 module’s low cost and high accuracy make it popular with the DIY community. Its DMP (Digital Motion Processor) calculates motion processing algorithms by providing data like yaw angles, pitch, roll, etc. The MPU6050 module’s gyroscope can drift by introducing errors within the output eventually. Here is a question for you, what is MPU9250?