MPU6050 1-Axis Gimbal

by Aced Inventor in Circuits > Arduino

4024 Views, 9 Favorites, 0 Comments

MPU6050 1-Axis Gimbal

MPU6050 1-Axis Gimbal | Arduino

In this project, we will be building a "1 - Axis Gimbal with an MPU6050." After you plug your Arduino into a power source, keep the sensor on a leveled surface for a few seconds for more accurate results. Now if you move the sensor clockwise the roll values from the MPU6050 will decrease and the servo position will increase and when you move the sensor counter-clockwise the roll values from the MPU6050 will increase the servo position will decrease. This allows the servo to always stay level on the roll axis.

This project can still be improved.

Supplies

Commponents.png

The components needed to make the project are:

MPU6050 Wiring

MPU6050Wiring.jpg

Connect the MPU6050 as following:

Arduino >> MPU6050

GND >> GND

5V >> VCC

A4 >> SDA

A5 >> SCL

INT >> D2

Servo Wiring

ServoWiring.jpg

Connect the Servo as following:

Arduino >> Servo

GND >> GND

5V >> VCC

Signal >> D4

Uploading the Program

Arduino IDE.png
image_2021-04-14_110250.png

Open the program on Arduino IDE. Once it is open, you will have to download the "MPU6050" library from electronic cats. After that, you can download the servo library. Compile the sketch to see if it is clear of error and upload it. After uploading the program, the servo will rotate to zero degrees and then back. Open serial monitor to see the reading for the roll and servo position.

For more information about this, please visit my Patreon:
https://www.patreon.com/acedinventor

Testing the Project

Testing the Project.jpg

Connect the Arduino Nano to a power source to see if the project is up and running. The servo will rotate to zero degrees before returning to its original position. Before you begin checking the sensor, make sure it is on a leveled surface for a few seconds. Now, rotating the sensor clockwise causes the servo to rotate counterclockwise, and rotating the sensor counterclockwise causes the servo to rotate clockwise. This helps the servo to hold the surface level at all times. You may also attach a small object to the servo, such as a button, and rotate it clockwise and counterclockwise. You'll notice that the object does not fall off.

If there is still something you don't understand, you can comment down below.