Arduino UNO and L298N Motor Driver Controlled DC Motor with Potentiometer Speed Adjustment
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control a DC motor using an Arduino UNO, an L298N motor driver, a potentiometer, and a 9V battery. The potentiometer is used to provide an analog input to the Arduino, which then controls the motor driver to regulate the speed and direction of the motor.
Component List
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
Potentiometer
- Description: A variable resistor used to provide an adjustable voltage output.
- Pins: GND, Output, VCC
Motor amarillo motorreductor hobby
- Description: A small DC motor with a gearbox for hobby projects.
- Pins: vcc, GND
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, used for prototyping and development.
- 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: A standard 9V battery used to power the circuit.
- Pins: +, -
Wiring Details
L298N DC Motor Driver
- OUT1 connected to GND of Motor amarillo motorreductor hobby
- OUT2 connected to vcc of Motor amarillo motorreductor hobby
- 12V connected to + of 9V battery
- GND connected to GND of Arduino UNO and - of 9V battery
- 5V connected to Vin of Arduino UNO
- ENA connected to D10 of Arduino UNO
- IN1 connected to D9 of Arduino UNO
- IN2 connected to D8 of Arduino UNO
Potentiometer
- VCC connected to 5V of Arduino UNO
- GND connected to GND of Arduino UNO
- Output connected to A0 of Arduino UNO
Motor amarillo motorreductor hobby
- GND connected to OUT1 of L298N DC motor driver
- vcc connected to OUT2 of L298N DC motor driver
Arduino UNO
- GND connected to GND of L298N DC motor driver and GND of Potentiometer
- Vin connected to 5V of L298N DC motor driver
- 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
- 5V connected to VCC of Potentiometer
- A0 connected to Output of Potentiometer
9V Battery
- + connected to 12V of L298N DC motor driver
- - connected to GND of L298N DC motor driver and GND of 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)
This documentation provides a comprehensive overview of the circuit, including a summary, detailed component list, wiring details, and the code used in the Arduino UNO.