Arduino UNO-Based Battery-Powered Line Following Robot with Dual DC Motors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, an L298N DC motor driver, a battery case, two hobby motors, a rocker switch, and two TCRT-5000 IR sensors. The circuit is designed to control the motors based on input from the IR sensors, with power supplied by the battery case and controlled via the rocker switch.
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
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver module.
- 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
Battery Case
- Description: A battery holder for powering the circuit.
- Pins: +, -
Motor (Hobby)
- Description: A small DC motor with a gearbox.
- Pins: vcc, GND
Rocker Switch (SPST)
- Description: A single-pole single-throw switch.
- Pins: 1, 2
TCRT-5000 IR Sensor
- Description: An infrared sensor for detecting objects.
- Pins: 5V, GND, D0, A0
Wiring Details
Arduino UNO
5V connected to:
- TCRT-5000 IR sensor (5V)
- TCRT-5000 IR sensor (5V)
GND connected to:
- TCRT-5000 IR sensor (GND)
- TCRT-5000 IR sensor (GND)
- L298N DC motor driver (GND)
- Rocker Switch (2)
Vin connected to:
- L298N DC motor driver (5V)
D13 connected to:
- L298N DC motor driver (IN4)
D12 connected to:
- L298N DC motor driver (IN3)
D9 connected to:
- TCRT-5000 IR sensor (D0)
D8 connected to:
- TCRT-5000 IR sensor (D0)
D6 connected to:
- L298N DC motor driver (ENB)
D5 connected to:
- L298N DC motor driver (ENA)
D4 connected to:
- L298N DC motor driver (IN2)
D3 connected to:
- L298N DC motor driver (IN1)
L298N DC Motor Driver
GND connected to:
- Arduino UNO (GND)
- Rocker Switch (2)
5V connected to:
- Arduino UNO (Vin)
IN4 connected to:
- Arduino UNO (D13)
IN3 connected to:
- Arduino UNO (D12)
ENB connected to:
- Arduino UNO (D6)
ENA connected to:
- Arduino UNO (D5)
IN2 connected to:
- Arduino UNO (D4)
IN1 connected to:
- Arduino UNO (D3)
OUT1 connected to:
- Motor (GND)
OUT2 connected to:
- Motor (vcc)
12V connected to:
- Battery Case (+)
OUT3 connected to:
- Motor (GND)
OUT4 connected to:
- Motor (vcc)
Battery Case
+ connected to:
- L298N DC motor driver (12V)
- connected to:
- Rocker Switch (1)
Motor (Hobby)
GND connected to:
- L298N DC motor driver (OUT1)
- L298N DC motor driver (OUT3)
vcc connected to:
- L298N DC motor driver (OUT2)
- L298N DC motor driver (OUT4)
Rocker Switch (SPST)
1 connected to:
- Battery Case (-)
2 connected to:
- Arduino UNO (GND)
- L298N DC motor driver (GND)
TCRT-5000 IR Sensor
5V connected to:
- Arduino UNO (5V)
GND connected to:
- Arduino UNO (GND)
D0 connected to:
- Arduino UNO (D9)
- Arduino UNO (D8)
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, with setup and loop functions ready for further development.