MPU 6050 working specification circuit Arduino proteus Library
In this article we will learn how to make MPU 6050 Pinout.
In the last post we will learn how to make Automatic Street Light control using Arduino project. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.
Here is a Relevant Project:
Controlling of Servo motor with Arduino and MPU 6050.
What is MPU6050?
The MPU6050 is a popular integrated circuit (IC) that combines a 3-axis gyroscope and a 3-axis accelerometer into a single chip. It’s commonly used for motion tracking and orientation sensing in various electronic devices like drones, gaming controllers, smart phones, and other gadgets. The MPU6050 provides precise motion sensing capabilities, measuring acceleration along three perpendicular axes and rotational velocity or angular rate around those same axes. It communicates using protocols like I2C (Inter-Integrated Circuit) or SPI (Serial Peripheral Interface), making it relatively easy to interface with microcontrollers and other digital systems.
Specification of MPU6050:
Chip Model | MPU 6050 |
Power Supply | 3-5V |
Communication Protocol | I2C |
Gyroscope
· Range · Sensitivity · Resolution · Output |
±250, ±500, ±1000, ±2000 degrees per second (dps) Configurable for the ranges above 16-bit ADC for each axis Digital output via I2C interface |
Accelerometer
· Range · Sensitivity · Resolution · Output |
±2g, ±4g, ±8g, ±16g
±2g, ±4g, ±8g, ±16g Configurable for the ranges above 16-bit ADC for each axis Digital output via I2C interface |
MPU 6050 Pinout:
- Pin 1 of MPU 6050 is VCC where we give +3.3v to +5v
- Pin 2 of MPU 6050 is GND where we connect –ve
- Pin 3 of MPU 6050 is SCL (Serial Clock) pin
- Pin 4 of MPU 6050 is SDA ( Serial Data) pin
- Pin 5 of MPU 6050 is XDA which means (Auxiliary Serial Data) pin
- Pin 6 of MPU 6050 is XCL which means (Auxiliary Serial Clock) pin
- Pin 7 of MPU 6050 is AD0 which means (I2C Address Select) pin
- Pin 8 of MPU 6050 is INT which means (Interrupt) pin
These are all pins of MPU 6050 and detail of how we connect and where we connect, I hope you understand them well۔
MPU 6050 Pinout diagram:
MPU 6050 Circuit Diagram:
MPU6050 Register Map:
Amazon Links:
Liquid Crystal LCD display 16×2
Other Tools and Components:
Super Starter kit for Beginners
PCB small portable drill machines
MPU 6050 Library:
I2CDevLib:
This is a popular C/C++ library that provides support for various sensors, including the MPU-6050. It offers example codes and functions for easy interfacing.
Adafruit MPU6050:
Adafruit, a well-known electronics company, provides their own Arduino library for the MPU-6050.
Usage of MPU 6050:
- Motion Sensing:
The MPU-6050 can detect and measure acceleration, enabling it to determine the movement of an object in three dimensions.
- Gyroscope:
It contains a gyroscope that measures angular velocity, allowing it to determine the rate of rotation around various axes.
- Gesture Recognition:
By combining data from the accelerometer and gyroscope, the MPU-6050 can recognize certain gestures or movements, which is useful in applications like gesture-controlled devices or games.
- Navigation and Positioning:
In combination with other sensors or algorithms, the MPU-6050 can contribute to determining an object’s position or orientation in space.
- Robotics and IoT:
It’s utilized in various robotics projects and Internet of Things (IoT) devices where accurate motion sensing is required.
Arduino Coding Program:
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#include <LiquidCrystal.h>
Adafruit_MPU6050 mpu;
// Define LCD screen parameters
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // RS, E, D4, D5, D6, D7
void setup(void) {
Serial.begin(115200);
// Initialize the LCD
lcd.begin(16, 4);
lcd.clear();
// Try to initialize MPU6050
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);
// Clear the LCD screen
lcd.clear();
// Display accelerometer readings
lcd.setCursor(0, 0);
lcd.print(“Accel X: “);
lcd.print(a.acceleration.x);
lcd.print(” m/s^2″);
lcd.setCursor(0, 1);
lcd.print(“Accel Y: “);
lcd.print(a.acceleration.y);
lcd.print(” m/s^2″);
lcd.setCursor(0, 2);
lcd.print(“Accel Z: “);
lcd.print(a.acceleration.z);
lcd.print(” m/s^2″);
// Display gyroscope readings
lcd.setCursor(0, 3);
lcd.print(“Gyro X: “);
lcd.print(g.gyro.x);
lcd.print(” rad/s”);
lcd.setCursor(0, 0);
lcd.print(“Gyro Y: “);
lcd.print(g.gyro.y);
lcd.print(” rad/s”);
lcd.setCursor(0, 1);
lcd.print(“Gyro Z: “);
lcd.print(g.gyro.z);
lcd.print(” rad/s”);
// Delay for readability
delay(500);
}