Arduino UNO Bluetooth-Controlled DC Motor System with Battery Power
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller, a 9V battery, an HC-05 Bluetooth module, a rocker switch, multiple DC motors, an L298N DC motor driver, a 2.1mm barrel jack with a terminal block, and a 3.7V LiPo battery. The Arduino UNO controls the motor driver and communicates with the Bluetooth module. The motor driver powers and controls the DC motors, while the power supply is managed by the batteries and the rocker switch.
Component List
Arduino UNO
- Description: 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
9V Battery
- Description: Standard 9V battery.
- Pins: -, +
HC-05 Bluetooth Module
- Description: Bluetooth module for wireless communication.
- Pins: Key, VCC, TXD, RXD, State, GND
Rocker Switch
- Description: On/Off switch.
- Pins: output, input
DC Motor
- Description: Standard DC motor.
- Pins: pin 1, pin 2
L298N DC Motor Driver
- Description: Dual H-Bridge motor driver.
- 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
2.1mm Barrel Jack with Terminal Block
- Description: Power connector.
- Pins: POS, NEG
3.7V LiPo Battery
- Description: Lithium polymer battery.
- Pins: +Ve, GND
Wiring Details
Arduino UNO
- 5V connected to VCC of HC-05 Bluetooth Module
- GND connected to GND of HC-05 Bluetooth Module
- D10 connected to ENA of L298N DC Motor Driver
- D9 connected to IN1 of L298N DC Motor Driver
- D8 connected to IN2 of L298N DC Motor Driver
- D7 connected to IN3 of L298N DC Motor Driver
- D6 connected to IN4 of L298N DC Motor Driver
- D5 connected to ENB of L298N DC Motor Driver
- D4 connected to RXD of HC-05 Bluetooth Module
- D3 connected to TXD of HC-05 Bluetooth Module
9V Battery
- - connected to NEG of 2.1mm Barrel Jack with Terminal Block
- + connected to POS of 2.1mm Barrel Jack with Terminal Block
HC-05 Bluetooth Module
- VCC connected to 5V of Arduino UNO
- GND connected to GND of Arduino UNO
- RXD connected to D4 of Arduino UNO
- TXD connected to D3 of Arduino UNO
Rocker Switch
- output connected to GND of 3.7V LiPo Battery and 12V of L298N DC Motor Driver
- input connected to +Ve of 3.7V LiPo Battery and GND of L298N DC Motor Driver
DC Motors
- pin 1 of DC Motor 1 connected to OUT2 of L298N DC Motor Driver
- pin 2 of DC Motor 1 connected to OUT1 of L298N DC Motor Driver
- pin 1 of DC Motor 2 connected to OUT2 of L298N DC Motor Driver
- pin 2 of DC Motor 2 connected to OUT1 of L298N DC Motor Driver
- pin 1 of DC Motor 3 connected to OUT4 of L298N DC Motor Driver
- pin 2 of DC Motor 3 connected to OUT3 of L298N DC Motor Driver
- pin 1 of DC Motor 4 connected to OUT4 of L298N DC Motor Driver
- pin 2 of DC Motor 4 connected to OUT3 of L298N DC Motor Driver
L298N DC Motor Driver
- ENA connected to D10 of Arduino UNO
- IN1 connected to D9 of Arduino UNO
- IN2 connected to D8 of Arduino UNO
- IN3 connected to D7 of Arduino UNO
- IN4 connected to D6 of Arduino UNO
- ENB connected to D5 of Arduino UNO
- 12V connected to output of Rocker Switch
- GND connected to input of Rocker Switch
- OUT1 connected to pin 2 of DC Motor 1 and DC Motor 2
- OUT2 connected to pin 1 of DC Motor 1 and DC Motor 2
- OUT3 connected to pin 2 of DC Motor 3 and DC Motor 4
- OUT4 connected to pin 1 of DC Motor 3 and DC Motor 4
2.1mm Barrel Jack with Terminal Block
- NEG connected to - of 9V Battery
- POS connected to + of 9V Battery
3.7V LiPo Battery
- GND connected to output of Rocker Switch
- +Ve connected to input of Rocker Switch
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:
}
DC Motor Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}