Arduino UNO Wi-Fi Controlled DC Motor Driver with Battery Management System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to control two DC Mini Metal Gear Motors using an Arduino UNO R4 WiFi and an L298N DC motor driver. The circuit is powered by a 3s 20A BMS connected to three 18650 Li-ion batteries, with a buck converter providing regulated power to a type C port.
Component List
L298N DC Motor Driver
- Description: Motor driver module used to control the speed and direction of 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
Arduino UNO R4 WiFi
- Description: Microcontroller board based on the ATmega328P, with built-in WiFi capabilities.
- Pins: OFF, GND, VRTC, IIC0_SCL, IIC0_SDA, 3V3, GPIO 41, GPIO 0, GPIO 42, GPIO 43, GPIO 44, BOOT, IOREF, RESET, 5V, VIN, A0, A1, A2, A3, A4, A5, RSPCKA, CIPO, COPI, D0/RX, D1/TX, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, AREF, SDA, SCL
Buck Converter
- Description: DC-DC converter used to step down voltage.
- Pins: IN+, IN-, OUT+, OUT-
3s 20A BMS
- Description: Battery management system for 3-series Li-ion batteries.
- Pins: DV/GND, 4.2V, 8.4V, 12.6V, +, -
18650 Li-ion Battery
- Description: Rechargeable lithium-ion battery.
- Pins: -, +
DC Mini Metal Gear Motor
- Description: Small DC motor with metal gears for increased torque.
- Pins: IN1, IN2
Type C Port
- Description: USB Type-C port for power delivery.
- Pins: Negative, Positive
Wiring Details
L298N DC Motor Driver
- OUT1 connected to IN2 of DC Mini Metal Gear Motor
- OUT2 connected to IN1 of DC Mini Metal Gear Motor
- 12V connected to + of 3s 20A BMS and IN+ of Buck Converter
- GND connected to - of 3s 20A BMS and IN- of Buck Converter
- OUT3 connected to IN2 of DC Mini Metal Gear Motor
- OUT4 connected to IN1 of DC Mini Metal Gear Motor
- ENA connected to D6 of Arduino UNO R4 WiFi
- IN1 connected to D4 of Arduino UNO R4 WiFi
- IN2 connected to D7 of Arduino UNO R4 WiFi
- IN3 connected to D8 of Arduino UNO R4 WiFi
- IN4 connected to D9 of Arduino UNO R4 WiFi
- ENB connected to D5 of Arduino UNO R4 WiFi
Arduino UNO R4 WiFi
- D4 connected to IN1 of L298N DC Motor Driver
- D5 connected to ENB of L298N DC Motor Driver
- D6 connected to ENA of L298N DC Motor Driver
- D7 connected to IN2 of L298N DC Motor Driver
- D8 connected to IN3 of L298N DC Motor Driver
- D9 connected to IN4 of L298N DC Motor Driver
Buck Converter
- IN+ connected to + of 3s 20A BMS and 12V of L298N DC Motor Driver
- IN- connected to - of 3s 20A BMS and GND of L298N DC Motor Driver
- OUT+ connected to Positive of Type C Port
- OUT- connected to Negative of Type C Port
3s 20A BMS
- DV/GND connected to + of 18650 Li-ion Battery
- 4.2V connected to + of 18650 Li-ion Battery
- 8.4V connected to + of 18650 Li-ion Battery
- 12.6V connected to - of 18650 Li-ion Battery
- + connected to 12V of L298N DC Motor Driver and IN+ of Buck Converter
- - connected to GND of L298N DC Motor Driver and IN- of Buck Converter
18650 Li-ion Battery
- + connected to DV/GND of 3s 20A BMS
- + connected to 4.2V of 3s 20A BMS
- + connected to 8.4V of 3s 20A BMS
- - connected to 12.6V of 3s 20A BMS
DC Mini Metal Gear Motor
- IN1 connected to OUT2 of L298N DC Motor Driver
- IN2 connected to OUT1 of L298N DC Motor Driver
- IN1 connected to OUT4 of L298N DC Motor Driver
- IN2 connected to OUT3 of L298N DC Motor Driver
Type C Port
- Positive connected to OUT+ of Buck Converter
- Negative connected to OUT- of Buck Converter
Documented Code
Arduino UNO R4 WiFi 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 R4 WiFi. The setup function is used to initialize any settings or configurations, and the loop function contains the main code that runs repeatedly.