Arduino UNO and L298N Motor Driver-Based Battery-Powered Line Following Robot
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes a 9V battery, an Arduino UNO, an L298N DC motor driver, two DC motors, and two TCRT 5000 IR sensors. The circuit is designed to control the DC motors using the Arduino UNO and the motor driver, with inputs from the IR sensors.
Component List
9V Battery
- Description: Provides power to the circuit.
- Pins: -, +
Arduino UNO
- Description: Microcontroller used to control the circuit.
- 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
L298N DC Motor Driver
- Description: Motor driver used to control the 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 (Motor 1)
- Description: DC motor controlled by the motor driver.
- Pins: pin 1, pin 2
DC Motor (Motor 2)
- Description: DC motor controlled by the motor driver.
- Pins: pin 1, pin 2
TCRT 5000 IR Sensor (Sensor 1)
- Description: IR sensor used for detecting objects.
- Pins: VCC, GND, DO, AO
TCRT 5000 IR Sensor (Sensor 2)
- Description: IR sensor used for detecting objects.
- Pins: VCC, GND, DO, AO
Wiring Details
9V Battery
- connected to:
- Arduino UNO: GND
- L298N DC Motor Driver: GND
+ connected to:
- L298N DC Motor Driver: 12V
Arduino UNO
5V connected to:
- TCRT 5000 IR Sensor (Sensor 1): VCC
- TCRT 5000 IR Sensor (Sensor 2): VCC
GND connected to:
- TCRT 5000 IR Sensor (Sensor 1): GND
- TCRT 5000 IR Sensor (Sensor 2): GND
- L298N DC Motor Driver: GND
Vin connected to:
- L298N DC Motor Driver: 5V
D13 connected to:
- L298N DC Motor Driver: IN2
D12 connected to:
- L298N DC Motor Driver: IN1
D11 connected to:
- L298N DC Motor Driver: IN4
D10 connected to:
- L298N DC Motor Driver: IN3
D6 connected to:
- L298N DC Motor Driver: ENA
D5 connected to:
- L298N DC Motor Driver: ENB
D4 connected to:
- TCRT 5000 IR Sensor (Sensor 1): DO
D3 connected to:
- TCRT 5000 IR Sensor (Sensor 1): AO
D2 connected to:
- TCRT 5000 IR Sensor (Sensor 2): DO
- TCRT 5000 IR Sensor (Sensor 2): AO
L298N DC Motor Driver
OUT1 connected to:
- DC Motor (Motor 2): pin 2
OUT2 connected to:
- DC Motor (Motor 2): pin 1
OUT3 connected to:
- DC Motor (Motor 1): pin 2
OUT4 connected to:
- DC Motor (Motor 1): pin 1
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 the main code runs repeatedly. You can add your motor control and sensor reading logic in these functions.