Arduino UNO Battery-Powered Dual DC Motor Controller with L298N Driver
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, a 18650 Li-Ion battery, an L298N DC motor driver, a rocker switch, two DC motors, and a 18650 lithium-ion charger. The circuit is designed to control the DC motors using the Arduino UNO, powered by the 18650 Li-Ion battery, with the L298N motor driver facilitating the motor control.
Component List
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
18650 Li-Ion
- Description: A rechargeable lithium-ion battery.
- Pins: Positive, Negative
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
Rocker Switch
- Description: A simple on/off switch.
- Pins: 1, 2
DC Motor
- Description: A motor that runs on direct current (DC).
- Pins: pin 1, pin 2
18650 Lithium-Ion Charger
- Description: A charger module for 18650 lithium-ion batteries.
- Pins: V IN, GND, OUT, IN, BAT IN, BAT GND
Wiring Details
Arduino UNO
- 5V connected to 5V of L298N DC motor driver
- GND connected to GND of L298N DC motor driver and GND of 18650 Lithium-Ion Charger
- D9 connected to IN4 of L298N DC motor driver
- D7 connected to ENB of L298N DC motor driver
- D6 connected to IN3 of L298N DC motor driver
- D5 connected to IN2 of L298N DC motor driver
- D4 connected to ENA of L298N DC motor driver
- D3 connected to IN1 of L298N DC motor driver
18650 Li-Ion
- Positive connected to 1 of Rocker Switch
- Negative connected to GND of 18650 Lithium-Ion Charger
L298N DC Motor Driver
- 5V connected to 5V of Arduino UNO
- GND connected to GND of Arduino UNO and GND of 18650 Lithium-Ion Charger
- IN4 connected to D9 of Arduino UNO
- ENB connected to D7 of Arduino UNO
- IN3 connected to D6 of Arduino UNO
- IN2 connected to D5 of Arduino UNO
- ENA connected to D4 of Arduino UNO
- IN1 connected to D3 of Arduino UNO
- OUT1 connected to pin 2 of DC Motor
- OUT2 connected to pin 1 of DC Motor
- 12V connected to 2 of Rocker Switch
- OUT3 connected to pin 2 of DC Motor
- OUT4 connected to pin 1 of DC Motor
- 5V-ENA-JMP-I connected to 5V-ENA-JMP-O of L298N DC motor driver
Rocker Switch
- 1 connected to Positive of 18650 Li-Ion
- 2 connected to 12V of L298N DC motor driver
DC Motor (Instance 1)
- pin 2 connected to OUT1 of L298N DC motor driver
- pin 1 connected to OUT2 of L298N DC motor driver
DC Motor (Instance 2)
- pin 2 connected to OUT3 of L298N DC motor driver
- pin 1 connected to OUT4 of L298N DC motor driver
18650 Lithium-Ion Charger
- OUT connected to GND of L298N DC motor driver and GND of Arduino UNO
- IN connected to 1 of Rocker Switch
- BAT IN connected to Positive of 18650 Li-Ion
- BAT GND connected to Negative of 18650 Li-Ion
Documented Code
Arduino UNO 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)
This document provides a comprehensive overview of the circuit, including the components used, their wiring details, and the code for the Arduino UNO microcontroller.