Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, a 9V battery, an L298N DC motor driver, and a DC motor. The circuit is designed to control the DC motor using the Arduino UNO and the L298N motor driver, powered by a 9V battery.
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
9V Battery
- Description: A standard 9V battery used to power the circuit.
- Pins: -, +
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows control 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
DC Motor
- Description: A standard DC motor.
- Pins: pin 1, pin 2
Wiring Details
Arduino UNO
- GND: Connected to the GND pin of the 9V Battery and the GND pin of the L298N DC motor driver.
- D8: Connected to the IN2 pin of the L298N DC motor driver.
- D7: Connected to the IN1 pin of the L298N DC motor driver.
- D3: Connected to the ENA pin of the L298N DC motor driver.
9V Battery
- -: Connected to the GND pin of the Arduino UNO and the GND pin of the L298N DC motor driver.
- +: Connected to the 12V pin of the L298N DC motor driver.
L298N DC Motor Driver
- GND: Connected to the GND pin of the Arduino UNO and the GND pin of the 9V Battery.
- IN2: Connected to the D8 pin of the Arduino UNO.
- IN1: Connected to the D7 pin of the Arduino UNO.
- ENA: Connected to the D3 pin of the Arduino UNO.
- 12V: Connected to the + pin of the 9V Battery.
- OUT3: Connected to pin 2 of the DC Motor.
- OUT4: Connected to pin 1 of the DC Motor.
DC Motor
- pin 1: Connected to the OUT4 pin of the L298N DC motor driver.
- pin 2: Connected to the OUT3 pin of the L298N DC motor driver.
Documented Code
Arduino UNO 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. The setup() function is where you initialize your settings, and the loop() function is where you place the code that you want to run repeatedly. You can add motor control logic in these functions to control the DC motor via the L298N motor driver.
