Arduino UNO Battery-Powered Motor Control System with Potentiometer
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control two DC motors using an Arduino UNO and an L298N DC motor driver. The speed of the motors is controlled via a potentiometer. The circuit is powered by a 2x 18650 battery pack.
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
Motor (x2)
- Description: A DC motor.
- Pins: negative, positive
L298N DC Motor Driver
- Description: A 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
2x 18650 Battery Pack
- Description: A battery pack containing two 18650 batteries.
- Pins: vcc, gnd
Potentiometer
- Description: A variable resistor used to control voltage.
- Pins: GND, Output, VCC
Wiring Details
Arduino UNO
- 5V connected to VCC of the Potentiometer.
- GND connected to GND of the Potentiometer.
- GND connected to GND of the L298N DC Motor Driver.
- Vin connected to vcc of the 2x 18650 Battery Pack.
- A0 connected to Output of the Potentiometer.
- GND connected to gnd of the 2x 18650 Battery Pack.
- D10 connected to ENA of the L298N DC Motor Driver.
- D9 connected to IN2 of the L298N DC Motor Driver.
- D8 connected to IN1 of the L298N DC Motor Driver.
- D6 connected to ENB of the L298N DC Motor Driver.
- D5 connected to IN4 of the L298N DC Motor Driver.
- D4 connected to IN3 of the L298N DC Motor Driver.
Motor 1
- negative connected to OUT2 of the L298N DC Motor Driver.
- positive connected to OUT1 of the L298N DC Motor Driver.
Motor 2
- negative connected to OUT4 of the L298N DC Motor Driver.
- positive connected to OUT3 of the L298N DC Motor Driver.
L298N DC Motor Driver
- GND connected to GND of the Arduino UNO.
- 12V connected to vcc of the 2x 18650 Battery Pack.
- ENA connected to D10 of the Arduino UNO.
- IN2 connected to D9 of the Arduino UNO.
- IN1 connected to D8 of the Arduino UNO.
- ENB connected to D6 of the Arduino UNO.
- IN4 connected to D5 of the Arduino UNO.
- IN3 connected to D4 of the Arduino UNO.
- OUT2 connected to negative of Motor 1.
- OUT1 connected to positive of Motor 1.
- OUT4 connected to negative of Motor 2.
- OUT3 connected to positive of Motor 2.
2x 18650 Battery Pack
- vcc connected to Vin of the Arduino UNO.
- vcc connected to 12V of the L298N DC Motor Driver.
- gnd connected to GND of the Arduino UNO.
Potentiometer
- VCC connected to 5V of the Arduino UNO.
- GND connected to GND of the Arduino UNO.
- Output connected to A0 of the Arduino UNO.
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)