Arduino UNO and L298N Motor Driver Controlled Robotic System with Bluetooth Connectivity
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to control motors using an Arduino UNO, an L298N DC motor driver, an Electronic Speed Controller (ESC), and an HC-05 Bluetooth module. The circuit is powered by a battery and includes two MRB Planetary gearbox motors and a BLDC motor. The Arduino UNO is programmed to control the motors based on input received via the Bluetooth module.
Component List
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows control of the speed and direction 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
HC-05 Bluetooth Module
- Description: A Bluetooth module used for wireless communication.
- Pins: EN, VCC, GND, TXD, RXD, STATE
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
BLDC Motor
- Description: A brushless DC motor.
- Pins: Wire A, Wire B, Wire C
Electronic Speed Controller (ESC)
- Description: A device used to control the speed of an electric motor.
- Pins: Battery VCC, Battery GND, Signal, 5v out, GND out, M1, M2, M3
MRB Planetary Gearbox Motor
- Description: A DC motor with a planetary gearbox.
- Pins: +, -
Battery
- Description: A power source for the circuit.
- Pins: -, +
Wiring Details
L298N DC Motor Driver
- OUT1 connected to MRB Planetary Gearbox Motor (+)
- OUT2 connected to MRB Planetary Gearbox Motor (-)
- OUT3 connected to MRB Planetary Gearbox Motor (-)
- OUT4 connected to MRB Planetary Gearbox Motor (+)
- 12V connected to Electronic Speed Controller (ESC) (Battery VCC) and Battery (+)
- GND connected to Electronic Speed Controller (ESC) (GND out), Arduino UNO (GND), Battery (-), and HC-05 (GND)
- ENA connected to Arduino UNO (D9)
- IN1 connected to Arduino UNO (D2)
- IN2 connected to Arduino UNO (D3)
- IN3 connected to Arduino UNO (D4)
- IN4 connected to Arduino UNO (D5)
- ENB connected to Arduino UNO (D10)
HC-05 Bluetooth Module
- VCC connected to Arduino UNO (5V)
- GND connected to Arduino UNO (GND)
- TXD connected to Arduino UNO (D0)
- RXD connected to Arduino UNO (D1)
Arduino UNO
- GND connected to Electronic Speed Controller (ESC) (GND out), L298N DC Motor Driver (GND), Battery (-), and HC-05 (GND)
- 5V connected to HC-05 (VCC)
- Vin connected to Electronic Speed Controller (ESC) (5v out)
- D0 connected to HC-05 (TXD)
- D1 connected to HC-05 (RXD)
- D2 connected to L298N DC Motor Driver (IN1)
- D3 connected to L298N DC Motor Driver (IN2)
- D4 connected to L298N DC Motor Driver (IN3)
- D5 connected to L298N DC Motor Driver (IN4)
- D6 connected to Electronic Speed Controller (ESC) (Signal)
- D9 connected to L298N DC Motor Driver (ENA)
- D10 connected to L298N DC Motor Driver (ENB)
BLDC Motor
- Wire A connected to Electronic Speed Controller (ESC) (M1)
- Wire B connected to Electronic Speed Controller (ESC) (M2)
- Wire C connected to Electronic Speed Controller (ESC) (M3)
Electronic Speed Controller (ESC)
- Battery VCC connected to L298N DC Motor Driver (12V) and Battery (+)
- Battery GND connected to L298N DC Motor Driver (GND), Arduino UNO (GND), Battery (-), and HC-05 (GND)
- Signal connected to Arduino UNO (D6)
- 5v out connected to Arduino UNO (Vin)
- GND out connected to Arduino UNO (GND)
- M1 connected to BLDC Motor (Wire A)
- M2 connected to BLDC Motor (Wire B)
- M3 connected to BLDC Motor (Wire C)
MRB Planetary Gearbox Motor
- Motor 1 (+) connected to L298N DC Motor Driver (OUT1)
- Motor 1 (-) connected to L298N DC Motor Driver (OUT2)
- Motor 2 (+) connected to L298N DC Motor Driver (OUT4)
- Motor 2 (-) connected to L298N DC Motor Driver (OUT3)
Battery
- + connected to L298N DC Motor Driver (12V) and Electronic Speed Controller (ESC) (Battery VCC)
- - connected to L298N DC Motor Driver (GND), Electronic Speed Controller (ESC) (Battery GND), Arduino UNO (GND), and HC-05 (GND)
Documented Code
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is used to initialize any settings, and the loop() function contains the main code that runs repeatedly. Further implementation is required to control the motors based on the input from the HC-05 Bluetooth module.