Arduino Mega 2560-Based Bluetooth-Controlled Robotic Car with MPU6050 and L298N Motor Driver
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino Mega 2560 microcontroller, an L298N DC motor driver, two DC motors, an MPU6050 accelerometer and gyroscope, an HC-05 Bluetooth module, and a 3S LIPO battery. The circuit is designed to control the DC motors based on sensor inputs and Bluetooth commands.
Component List
Arduino Mega 2560
- Description: A microcontroller board based on the ATmega2560.
- Pins: IOREF, RESET, 3V3, 5V, GND, VIN, A0-A15, D0-D53, AREF, SDA, SCL
L298N DC Motor Driver
- Description: A dual H-bridge motor driver that allows control of two DC motors.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
DC Motor (2 units)
- Description: Standard DC motors.
- Pins: pin 1, pin 2
MPU6050 Accelerometer + Gyroscope
- Description: A sensor module that combines a 3-axis gyroscope and a 3-axis accelerometer.
- Pins: INT, AD0, XCL, XDA, SDA, SCL, GND, VCC
3S LIPO Battery
- Description: A rechargeable lithium polymer battery.
- Pins: -VE, +VE
HC-05 Bluetooth Module
- Description: A Bluetooth module for wireless communication.
- Pins: Key, VCC, TXD, RXD, State, GND
Wiring Details
Arduino Mega 2560
- 3V3 connected to VCC of MPU6050 Accelerometer + Gyroscope
- 5V connected to VCC of HC-05 Bluetooth Module
- GND connected to GND of MPU6050 Accelerometer + Gyroscope
- GND connected to GND of L298N DC Motor Driver
- GND connected to GND of HC-05 Bluetooth Module
- VIN connected to 5V of L298N DC Motor Driver
- A4 connected to SDA of MPU6050 Accelerometer + Gyroscope
- A5 connected to SCL of MPU6050 Accelerometer + Gyroscope
- D0 RX0 connected to TXD of HC-05 Bluetooth Module
- D1 TX0 connected to RXD of HC-05 Bluetooth Module
- D2 PWM connected to INT of MPU6050 Accelerometer + Gyroscope
- D5 PWM connected to ENA of L298N DC Motor Driver
- D6 PWM connected to IN1 of L298N DC Motor Driver
- D7 PWM connected to IN2 of L298N DC Motor Driver
- D8 PWM connected to IN4 of L298N DC Motor Driver
- D9 PWM connected to IN3 of L298N DC Motor Driver
- D10 PWM connected to ENB of L298N DC Motor Driver
L298N DC Motor Driver
- GND connected to -VE of 3S LIPO Battery
- 5V connected to VIN of Arduino Mega 2560
- OUT1 connected to pin 2 of DC Motor 1
- OUT2 connected to pin 1 of DC Motor 1
- OUT3 connected to pin 2 of DC Motor 2
- OUT4 connected to pin 1 of DC Motor 2
- 12V connected to +VE of 3S LIPO Battery
DC Motor 1
- pin 1 connected to OUT2 of L298N DC Motor Driver
- pin 2 connected to OUT1 of L298N DC Motor Driver
DC Motor 2
- pin 1 connected to OUT4 of L298N DC Motor Driver
- pin 2 connected to OUT3 of L298N DC Motor Driver
MPU6050 Accelerometer + Gyroscope
- VCC connected to 3V3 of Arduino Mega 2560
- GND connected to GND of Arduino Mega 2560
- SDA connected to A4 of Arduino Mega 2560
- SCL connected to A5 of Arduino Mega 2560
- INT connected to D2 PWM of Arduino Mega 2560
3S LIPO Battery
- -VE connected to GND of L298N DC Motor Driver
- +VE connected to 12V of L298N DC Motor Driver
HC-05 Bluetooth Module
- VCC connected to 5V of Arduino Mega 2560
- TXD connected to D0 RX0 of Arduino Mega 2560
- RXD connected to D1 TX0 of Arduino Mega 2560
- GND connected to GND of Arduino Mega 2560
Documented Code
Arduino Mega 2560 Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Additional Documentation (documentation.txt)