How to control servo using MPU6050 Gyroscope with Arduino:
In this quick tutorial we will control an SG90 servo or any generic servo using MPU6050 triple-axis Gyroscope and accelerometer module.
MPU6050 Wiring:
SCL – A5
SDA – A4
VCC – 3.3V
GND – GND
INT – PIN3
Servo Wiring:
VCC – 5V
GND – GND
Control - PIN3
Please note you can use other pins but you will have to change it in the code.
Download the sketch:
[ Ссылка ]
In order for the sketch to work you will need to install i2cdevlib library to Arduino library folder:
[ Ссылка ]
The sketch is based on i2cdevlib library example except some additions for controlling the servo.
I created this video with the YouTube Video Editor ([ Ссылка ])
![](https://i.ytimg.com/vi/vSKEH0FwhUE/maxresdefault.jpg)