Circuit Documentation
Summary of the Circuit
This circuit is designed to control two DC motors using an Arduino UNO microcontroller and an L298N DC motor driver. The Arduino UNO is responsible for generating control signals that are sent to the L298N driver, which in turn drives the motors. The motors are powered by a 12V battery, which also supplies power to the L298N driver. The Arduino is interfaced with the driver through several digital I/O pins to control the direction and speed of the motors.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.
L298N DC Motor Driver
- A dual H-bridge motor driver capable of driving a pair of DC motors or a stepper motor.
- It can handle a current of up to 2A per channel.
Battery 12V
- A 12V power source used to power the DC motors and the motor driver.
DC Motor (2x)
- A standard DC motor that converts electrical energy into mechanical energy.
Wiring Details
Arduino UNO
- GND connected to the GND of the L298N motor driver and the negative terminal of the 12V battery.
- Vin connected to the 5V input of the L298N motor driver.
- D11 connected to the ENB pin of the L298N motor driver.
- D10 connected to the ENA pin of the L298N motor driver.
- D9 connected to the IN1 pin of the L298N motor driver.
- D8 connected to the IN2 pin of the L298N motor driver.
- D7 connected to the IN3 pin of the L298N motor driver.
- D6 connected to the IN4 pin of the L298N motor driver.
L298N DC Motor Driver
- GND connected to the GND of the Arduino UNO and the negative terminal of the 12V battery.
- 5V connected to the Vin of the Arduino UNO.
- 12V connected to the positive terminal of the 12V battery.
- OUT1 connected to pin 2 of the first DC Motor.
- OUT2 connected to pin 1 of the first DC Motor.
- OUT3 connected to pin 2 of the second DC Motor.
- OUT4 connected to pin 1 of the second DC Motor.
Battery 12V
- + connected to the 12V input of the L298N motor driver.
- - connected to the GND of the L298N motor driver and the GND of the Arduino UNO.
DC Motor
- pin 1 of the first motor connected to OUT2 of the L298N motor driver.
- pin 2 of the first motor connected to OUT1 of the L298N motor driver.
- pin 1 of the second motor connected to OUT4 of the L298N motor driver.
- pin 2 of the second motor connected to OUT3 of the L298N motor driver.
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 Notes (documentation.txt)
No additional code documentation provided.
