Learn how to interface the MPU 6050 - Accelerometer & Gyroscope sensor with the Arduino UNO board.
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.
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.
3. Jumper wires:
Jumper wires have connectors and pins that are used to connect different components on a breadboard.
Connect the Vcc pin of the MPU6050 to the 5V of the Arduino.
Connect the ground of the sensor to the ground of the Arduino.
Connect the serial clock (SCL) pin of the sensor to the A5 of the Arduino.
Connect the serial data (SDL) pin of the sensor to the A4 of the Arduino.
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.
The MPU6050 sensor is interfaced with the Arduino. Accelerometric and gyroscopic parameters are printed on the serial monitor output using the necessary functions.
Project By - Farhan Ahamed
Name- Nagashree R Nadig
Portfolio Link- https://www.learnelectronicsindia.com/team/nagashree-r-nadig
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