Arduino Nano Controlled Bluetooth Robot with Dual L298N Motor Drivers
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control four DC motors using two L298N DC motor drivers, which are interfaced with an Arduino Nano microcontroller. The Arduino Nano also communicates with an HC-05 Bluetooth module for wireless control capabilities. Power regulation is managed by a 7805 voltage regulator, ensuring the Bluetooth module receives a stable 5V supply. A rocker switch is used to control the power flow from a 18650 Li-Ion battery to the circuit. The motors are connected to the motor drivers, which receive control signals from the Arduino Nano to manage the direction and speed of the motors.
Component List
Microcontroller
- Arduino Nano: A compact microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
Motor Drivers
- L298N DC Motor Driver: A dual H-bridge motor driver capable of driving two DC motors or one stepper motor.
Motors
- DC Motor: A standard DC motor used for driving mechanical loads.
Power Supply
- 7805 Voltage Regulator: A voltage regulator that outputs a stable 5V from a higher voltage input.
- 18650 Li-Ion Battery: A rechargeable battery providing the power source for the circuit.
Communication Module
- HC-05 Bluetooth Module: A Bluetooth module for wireless communication with the Arduino Nano.
Switch
- Rocker Switch: A simple on/off switch to control the power supply to the circuit.
Wiring Details
Arduino Nano
- D1/TX connected to HC-05 Bluetooth Module RXD
- D0/RX connected to HC-05 Bluetooth Module TXD
- GND connected to HC-05 Bluetooth Module GND and common ground with other components
- D2 - D5 connected to the first L298N DC motor driver IN1 - IN4 respectively
- D6, D9 - D10, A0 connected to the second L298N DC motor driver IN1 - IN4 respectively
L298N DC Motor Driver (x2)
- 12V connected to the positive side of the rocker switch
- GND connected to the common ground
- OUT1 - OUT4 connected to the respective pins of DC Motors
- IN1 - IN4 connected to the respective pins of Arduino Nano for control signals
DC Motor (x4)
- pin 1 and pin 2 connected to the respective OUT pins of L298N DC motor drivers
HC-05 Bluetooth Module
- VCC connected to 7805 Voltage Regulator Vout
- GND connected to common ground
- TXD connected to Arduino Nano D0/RX
- RXD connected to Arduino Nano D1/TX
Rocker Switch
- Pin 1 connected to 18650 Li-Ion Battery Positive
- Pin 2 connected to the 12V input of both L298N DC motor drivers and 7805 Voltage Regulator Vin
18650 Li-Ion Battery
- Positive connected to rocker switch Pin 1
- Negative connected to common ground
7805 Voltage Regulator
- Vin connected to the positive side of the rocker switch
- Gnd connected to common ground
- Vout connected to HC-05 Bluetooth Module VCC
Documented Code
Arduino Nano Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Note: The provided code for the Arduino Nano is a template with empty setup and loop functions. The actual control logic for the motors and communication with the HC-05 Bluetooth module needs to be implemented within these functions.