Arduino UNO-Based Line Following and Obstacle Avoidance Robot with Ultrasonic and IR Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to control a robot using an Arduino UNO microcontroller. The circuit includes various sensors (ultrasonic and infrared), a motor driver, and motors. The robot is designed to navigate based on sensor inputs and control the motors accordingly.
Component List
4 x AAA Battery Mount
- Description: Provides power to the circuit.
- Pins:
-,+
HC-SR04 Ultrasonic Sensor
- Description: Measures distance to objects using ultrasonic waves.
- Pins:
VCC,TRIG,ECHO,GND
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
IR Sensor (Left)
- Description: Detects infrared signals for line following.
- Pins:
out,gnd,vcc
IR Sensor (Right)
- Description: Detects infrared signals for line following.
- Pins:
out,gnd,vcc
L298N DC Motor Driver
- Description: Controls the direction and speed of the 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
Rocker Switch
- Description: Used to turn the circuit on and off.
- Pins:
output,input
Hobby Gearmotor with 48:1 Gearbox (Left)
- Description: Provides mechanical movement for the robot.
- Pins:
pin 1,pin 2
Hobby Gearmotor with 48:1 Gearbox (Right)
- Description: Provides mechanical movement for the robot.
- Pins:
pin 1,pin 2
Wiring Details
4 x AAA Battery Mount
-connected to:GNDof Arduino UNOGNDof HC-SR04 Ultrasonic Sensorgndof IR Sensor (Left)gndof IR Sensor (Right)GNDof L298N DC Motor Driver
+connected to:inputof Rocker Switch
HC-SR04 Ultrasonic Sensor
VCCconnected to:5Vof Arduino UNO5Vof L298N DC Motor Drivervccof IR Sensor (Left)vccof IR Sensor (Right)
TRIGconnected to:D8of Arduino UNO
ECHOconnected to:D9of Arduino UNO
GNDconnected to:GNDof Arduino UNOGNDof L298N DC Motor Drivergndof IR Sensor (Left)gndof IR Sensor (Right)-of 4 x AAA Battery Mount
Arduino UNO
5Vconnected to:VCCof HC-SR04 Ultrasonic Sensor5Vof L298N DC Motor Drivervccof IR Sensor (Left)vccof IR Sensor (Right)
GNDconnected to:GNDof HC-SR04 Ultrasonic SensorGNDof L298N DC Motor Drivergndof IR Sensor (Left)gndof IR Sensor (Right)-of 4 x AAA Battery Mount
D8connected to:TRIGof HC-SR04 Ultrasonic Sensor
D9connected to:ECHOof HC-SR04 Ultrasonic Sensor
D13connected to:IN2of L298N DC Motor Driver
D12connected to:IN1of L298N DC Motor Driver
D11connected to:IN4of L298N DC Motor Driver
D10connected to:IN3of L298N DC Motor Driver
D6connected to:ENBof L298N DC Motor Driver
D5connected to:ENAof L298N DC Motor Driver
D4connected to:outof IR Sensor (Left)
D2connected to:outof IR Sensor (Right)
IR Sensor (Left)
outconnected to:D4of Arduino UNO
gndconnected to:GNDof Arduino UNOGNDof HC-SR04 Ultrasonic SensorGNDof L298N DC Motor Drivergndof IR Sensor (Right)-of 4 x AAA Battery Mount
vccconnected to:5Vof Arduino UNO5Vof L298N DC Motor DriverVCCof HC-SR04 Ultrasonic Sensorvccof IR Sensor (Right)
IR Sensor (Right)
outconnected to:D2of Arduino UNO
gndconnected to:GNDof Arduino UNOGNDof HC-SR04 Ultrasonic SensorGNDof L298N DC Motor Drivergndof IR Sensor (Left)-of 4 x AAA Battery Mount
vccconnected to:5Vof Arduino UNO5Vof L298N DC Motor DriverVCCof HC-SR04 Ultrasonic Sensorvccof IR Sensor (Left)
L298N DC Motor Driver
GNDconnected to:GNDof Arduino UNOGNDof HC-SR04 Ultrasonic Sensorgndof IR Sensor (Left)gndof IR Sensor (Right)-of 4 x AAA Battery Mount
5Vconnected to:5Vof Arduino UNOVCCof HC-SR04 Ultrasonic Sensorvccof IR Sensor (Left)vccof IR Sensor (Right)
IN2connected to:D13of Arduino UNO
IN1connected to:D12of Arduino UNO
IN4connected to:D11of Arduino UNO
IN3connected to:D10of Arduino UNO
ENBconnected to:D6of Arduino UNO
ENAconnected to:D5of Arduino UNO
OUT1connected to:pin 1of Hobby Gearmotor (Right)
OUT2connected to:pin 2of Hobby Gearmotor (Right)
OUT3connected to:pin 2of Hobby Gearmotor (Left)
OUT4connected to:pin 1of Hobby Gearmotor (Left)
12Vconnected to:outputof Rocker Switch
Rocker Switch
inputconnected to:+of 4 x AAA Battery Mount
outputconnected to:12Vof L298N DC Motor Driver
Hobby Gearmotor with 48:1 Gearbox (Left)
pin 1connected to:OUT4of L298N DC Motor Driver
pin 2connected to:OUT3of L298N DC Motor Driver
Hobby Gearmotor with 48:1 Gearbox (Right)
- `pin