Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino-Controlled Line Following Robot with Dual DC Motors and L298N Driver

Image of Arduino-Controlled Line Following Robot with Dual DC Motors and L298N Driver

Circuit Documentation

Summary

This circuit integrates an Arduino UNO microcontroller with a line sensor and two DC motors through an L298N DC motor driver. The system is powered by an 18650 Li-Ion battery. The Arduino UNO is responsible for processing the signals from the line sensor and controlling the DC motors via the motor driver based on the sensor inputs.

Component List

Arduino UNO

  • Microcontroller board based on the ATmega328P
  • It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.

Line Sensor

  • A sensor module with multiple IR sensors, typically used for line following robots.
  • It has 8 sensor outputs that provide digital signals indicating the presence of a line.

L298N DC Motor Driver

  • A dual H-bridge motor driver that can drive two DC motors or one stepper motor.
  • It has pins for motor outputs, motor voltage input, ground, and control inputs for enabling and setting the direction of the motors.

DC Motor (x2)

  • Standard DC motors for driving the wheels of a robot or any mechanical system.
  • Each motor has two pins for connecting to the motor driver output.

18650 Li-Ion Battery

  • A rechargeable battery providing the power source for the circuit.
  • It has a positive and a negative terminal for power supply connections.

Wiring Details

Arduino UNO

  • 5V connected to Line Sensor +5v
  • GND connected to Line Sensor GND, L298N Motor Driver GND, and 18650 Li-Ion Battery Negative
  • Vin connected to L298N Motor Driver 12V and 18650 Li-Ion Battery Positive
  • A0 - A5 connected to Line Sensor pins 2 - 7 respectively
  • D11 connected to L298N Motor Driver IN1
  • D10 connected to L298N Motor Driver IN2
  • D9 connected to L298N Motor Driver IN3
  • D8 connected to L298N Motor Driver IN4
  • D6 connected to L298N Motor Driver ENA
  • D5 connected to L298N Motor Driver ENB

Line Sensor

  • +5v connected to Arduino UNO 5V
  • GND connected to Arduino UNO GND
  • Pins 2 - 7 connected to Arduino UNO A0 - A5 respectively

L298N DC Motor Driver

  • GND connected to Arduino UNO GND and 18650 Li-Ion Battery Negative
  • 12V connected to Arduino UNO Vin and 18650 Li-Ion Battery Positive
  • IN1 - IN4 connected to Arduino UNO D11 - D8 respectively
  • ENA connected to Arduino UNO D6
  • ENB connected to Arduino UNO D5
  • OUT1 connected to DC Motor (Instance 1) pin 2
  • OUT2 connected to DC Motor (Instance 1) pin 1
  • OUT3 connected to DC Motor (Instance 2) pin 2
  • OUT4 connected to DC Motor (Instance 2) pin 1

DC Motor (Instance 1)

  • pin 1 connected to L298N Motor Driver OUT2
  • pin 2 connected to L298N Motor Driver OUT1

DC Motor (Instance 2)

  • pin 1 connected to L298N Motor Driver OUT4
  • pin 2 connected to L298N Motor Driver OUT3

18650 Li-Ion Battery

  • Positive connected to Arduino UNO Vin and L298N Motor Driver 12V
  • Negative connected to Arduino UNO GND and L298N Motor Driver GND

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 Notes (documentation.txt)

No additional code documentation was provided.