DC motor controlled by Gyro MPU 6050 using Arduino & L298N Motor driver - Wireless Connection
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4XHpbT70OEguJJKLQkri8QlbXtAp-2gy1q77K8PIq2vSLloqHQQHebeQLMfa_KgFKau0CX2lCHapSruH97HgYCZLgSx6xwFLidnHc7k3-gbst9-7l9WHmsmIWhtcPm7KRyqq5oBoFSXrS/s640/15a.Gyro+DC+L298N+wireless+1_page-0001%25281%2529.jpg)
Circuit Diagram: Required Components: Arduino uno/nano - 1 Nos Battery - 1 Nos DC Motor - 2 Nos L298N Motor Driver - 1 Nos Gyro MPU6050 - 1 Nos Transceiver - 2 Nos Program Code: Transmitter Code: #include <SPI.h> #include "RF24.h" #include "Wire.h" #include "I2Cdev.h" #include "MPU6050.h" MPU6050 mpu; int16_t ax, ay, az; int16_t gx, gy, gz; int data[2]; RF24 radio(9,10); uint64_t pipe = 0xE8E8F0F0E1LL; void setup(){ Serial.begin(9600); Wire.begin(); mpu.initialize(); radio.begin(); radio.openWritingPipe(pipe); } void loop(){ mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz); //With this function, the acceleration and gyro values of the axis are taken. data[0] = map(ax, -17000, 17000, 0, 128); //Send X axis data data[1] = map(ay, -17000, 17000, 129, 255); //Send Y axis data rad