top of page

Interfacing MPU 6050 Sensor with Arduino UNO

Updated: 2 days ago


Learn how to interface the MPU 6050 - Accelerometer & Gyroscope sensor with the Arduino UNO board.


Hardware Components:


1. Arduino Uno:

#ArduinoUno board is used for interfacing the input-output elements to construct a project. It is an open-source microcontroller board that can be programmed according to user requirements.


Arduino Uno
Arduino Uno

2. MPU6050 sensor:

MPU-6050 is a 6 axis motion tracking device generally used in smartphones and wearable sensors. It has 3-axis MEMS (Micro-Electro-Mechanical Systems) gyroscope and accelerometer.

MPU6050 sensor
MPU6050 sensor

3. Jumper wires:

Jumper wires have connectors and pins that are used to connect different components on a breadboard.


Jumper wires
Jumper wires


Circuit Connections:


Circuit Connections
Circuit Connections
  1. Connect the Vcc pin of the MPU6050 to the 5V of the Arduino.

  2. Connect the ground of the sensor to the ground of the Arduino.

  3. Connect the serial clock (SCL) pin of the sensor to the A5 of the Arduino.

  4. Connect the serial data (SDL) pin of the sensor to the A4 of the Arduino.


Code:


Buy the Project code now -


Code Explanation -

  • Download the MPU6050_tockn.h and Wire.h libraries and include them in the Arduino IDE.

  • In void setup(), initialize the MPU6050 sensor pins and the I2C common port. Start the serial monitor output with a 9600 baud rate.

  • Using the mpu6050.calcGyroOffsets(), calculate the offset of the sensor.

  • In void loop(), using the mpu6050.update() function convert the raw data collected from the sensor into useful values.

  • Using the functions like mpu6050.getTemp(), mpu6050.getAccX, mpu6050.getAccAngleX(), etc. print the respective values obtained from the use of those functions.

Working:


The MPU6050 sensor is interfaced with the Arduino. Accelerometric and gyroscopic parameters are printed on the serial monitor output using the necessary functions.


Interfacing MPU 6050 Sensor with Arduino UNO
Interfacing MPU 6050 Sensor with Arduino UNO

Project By - Farhan Ahamed

Written by-

Name- Nagashree R Nadig


See also-

Controlling DC Motor with IR remote

 Interfacing Neopixel strip with Arduino-Tinkercad


Follow us -


Please do follow us i.e #learnelectronicsindia to get daily updates about new blogs, videos, courses, quizzes, and contests.



Want us to help you with the projects, write your inquiry here - Order Projects


Check out our Free Arduino Projects Playlist - Arduino Projects

Check out our Free Raspberry Pi Projects Playlist - Raspberry Pi Projects

Check out our Free TinkerCAD Projects Playlist - TinkerCAD Projects

Check out our Free IoT Projects Playlist - IoT Projects

Check out our Free Home Automation Projects Playlist - Home Automation Projects

Check out our Free NodeMCu Projects Playlist - NodeMCu Projects

495 views2 comments

Related Posts

See All

2 kommentarer


Informative and concise! LearnElectronics India always delivers quality content.

Gilla

Anushka Gupta
Anushka Gupta
19 juli 2023

Learn Electronics India has done an outstanding job with this blog! The article not only covered the basics of interfacing the MPU 6050 Sensor with Arduino UNO but also delved into advanced topics. The real-life examples and troubleshooting tips added immense value. Keep up the excellent work.

Gilla
bottom of page