Arduino-Controlled BLDC Motor with MPU-6050 Feedback and L298N Driver
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates an Arduino UNO microcontroller with an L298N DC motor driver to control a BLDC Motor. It also includes an MPU-6050 sensor module for motion tracking. The system is powered by a lipo battery rated at 2200mAh and 30C. The Arduino UNO communicates with the MPU-6050 via I2C protocol, using its A4 and A5 pins for SDA and SCL lines, respectively. The L298N motor driver receives control signals from the Arduino to drive the BLDC Motor. The battery provides power to the motor driver, which in turn powers the Arduino and the MPU-6050.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.
L298N DC Motor Driver
- A module that can control up to two DC motors or one stepper motor.
- It has an onboard 5V regulator which can be used to power the connected microcontroller.
MPU-6050
- A motion tracking device that combines a 3-axis gyroscope and a 3-axis accelerometer on the same silicon die.
- It has an I2C bus interface for communication.
BLDC Motor
- A Brushless DC electric motor that is commonly used for high-performance and high-efficiency motor applications.
Lipo Battery 2200mAh 30C
- A rechargeable battery that provides a high discharge rate to power the motor and electronics.
Wiring Details
Arduino UNO
5Vconnected to L298N 5V and MPU-6050 VCC for power.GNDconnected to L298N GND, MPU-6050 GND, and lipo battery GND for common ground.A4 (SDA)connected to MPU-6050 SDA for I2C data line.A5 (SCL)connected to MPU-6050 SCL for I2C clock line.D5connected to L298N ENA for motor speed control.D6connected to L298N ENB for motor speed control.D8connected to L298N IN1 for motor direction control.D9connected to L298N IN2 for motor direction control.D10connected to L298N IN3 for motor direction control.D11connected to L298N IN4 for motor direction control.
L298N DC Motor Driver
5Vconnected to Arduino 5V and MPU-6050 VCC.GNDconnected to lipo battery GND and Arduino GND.12Vconnected to lipo battery VCC for motor power.ENAandENBconnected to Arduino D5 and D6 for motor speed control.IN1,IN2,IN3,IN4connected to Arduino D8, D9, D10, D11 for motor direction control.OUT1,OUT2,OUT3connected to BLDC Motor wires A, B, C for motor connection.
MPU-6050
VCCconnected to Arduino 5V.GNDconnected to Arduino GND.SDAconnected to Arduino A4 for I2C data line.SCLconnected to Arduino A5 for I2C clock line.
BLDC Motor
Wire A,Wire B,Wire Cconnected to L298N OUT1, OUT2, OUT3 for motor connection.
Lipo Battery 2200mAh 30C
VCCconnected to L298N 12V for motor power.GNDconnected to L298N GND and Arduino GND for common ground.
Documented Code
Arduino UNO Code: sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Additional Notes
- The
documentation.txtfile for the Arduino UNO is empty and thus not included in this documentation. - The provided code is a template and does not contain any functional implementation for controlling the motor or reading from the MPU-6050 sensor. Further development is required to achieve the desired functionality.