Arduino UNO and L298N Motor Driver-Based Line Following Robot with IR Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to control multiple DC motors using an L298N motor driver and an Arduino UNO. The circuit also includes several TCRT-5000 IR sensors for obstacle detection and a rocker switch for power control. The Arduino UNO is programmed to manage the motor driver and read sensor inputs.
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
Motor amarillo motorreductor hobby
- Description: A small DC motor with a gearbox, commonly used in hobby projects.
- Pins: vcc, GND
Battery 12V
- Description: A 12V battery used to power the motor driver and motors.
- Pins: +, -
TCRT-5000 IR Sensor
- Description: An infrared sensor used for obstacle detection.
- Pins: 5V, GND, D0, A0
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, used to control the motor driver and read sensor inputs.
- 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
Rocker Switch
- Description: A switch used to control the power supply to the circuit.
- Pins: output, input
Wiring Details
L298N DC Motor Driver
- 5V: Connected to 5V pins of all TCRT-5000 IR sensors and Arduino UNO.
- GND: Connected to the input pin of the rocker switch and GND pin of Arduino UNO.
- ENA: Connected to D6 pin of Arduino UNO.
- IN1: Connected to D7 pin of Arduino UNO.
- IN2: Connected to D8 pin of Arduino UNO.
- IN3: Connected to D9 pin of Arduino UNO.
- IN4: Connected to D10 pin of Arduino UNO.
- ENB: Connected to D11 pin of Arduino UNO.
- OUT1: Connected to vcc pins of two Motor amarillo motorreductor hobby.
- OUT2: Connected to GND pins of two Motor amarillo motorreductor hobby.
- OUT3: Connected to GND pins of two Motor amarillo motorreductor hobby.
- OUT4: Connected to vcc pins of two Motor amarillo motorreductor hobby.
- 12V: Connected to the + pin of the 12V battery.
Motor amarillo motorreductor hobby
- vcc: Connected to OUT1 and OUT4 pins of L298N DC motor driver.
- GND: Connected to OUT2 and OUT3 pins of L298N DC motor driver.
Battery 12V
- +: Connected to 12V pin of L298N DC motor driver.
- -: Connected to the output pin of the rocker switch.
TCRT-5000 IR Sensor
- 5V: Connected to 5V pin of L298N DC motor driver and Arduino UNO.
- GND: Connected to GND pin of Arduino UNO.
- D0: Connected to A0, A1, A2, A3, and A4 pins of Arduino UNO.
Arduino UNO
- 5V: Connected to 5V pin of L298N DC motor driver and all TCRT-5000 IR sensors.
- GND: Connected to GND pin of L298N DC motor driver and all TCRT-5000 IR sensors.
- A0: Connected to D0 pin of one TCRT-5000 IR sensor.
- A1: Connected to D0 pin of one TCRT-5000 IR sensor.
- A2: Connected to D0 pin of one TCRT-5000 IR sensor.
- A3: Connected to D0 pin of one TCRT-5000 IR sensor.
- A4: Connected to D0 pin of one TCRT-5000 IR sensor.
- D6: Connected to ENA pin of L298N DC motor driver.
- D7: Connected to IN1 pin of L298N DC motor driver.
- D8: Connected to IN2 pin of L298N DC motor driver.
- D9: Connected to IN3 pin of L298N DC motor driver.
- D10: Connected to IN4 pin of L298N DC motor driver.
- D11: Connected to ENB pin of L298N DC motor driver.
Rocker Switch
- input: Connected to GND pin of L298N DC motor driver and Arduino UNO.
- output: Connected to - pin of the 12V battery.
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)