WEBVTT

00:00.000 --> 00:05.000
Ever wondered how robotic lawnmowers stay on track while trimming gardens?

00:05.000 --> 00:10.000
Or how warehouse robots follow lines on the floor to carry packages around automatically?

00:10.000 --> 00:15.000
That's all made possible by Line Following Technology.

00:15.000 --> 00:20.000
Welcome! In this video, we'll build an Arduino Line Following Robot.

00:20.000 --> 00:23.000
Let's see how it's built.

00:23.000 --> 00:27.000
Let's start with the first and most important component of our project,

00:27.000 --> 00:32.000
the Arduino Uno Board. It is the brain of our project.

00:32.000 --> 00:40.000
Arduino is a microcontroller board that allows us to control and connect different electronic components like sensors, motors, etc.

00:40.000 --> 00:44.000
Our second component is the L298N Motor Driver.

00:44.000 --> 00:48.000
This component is used to control motors in our project.

00:48.000 --> 00:53.000
Our third component is four DC geared motors with four wheels.

00:53.000 --> 00:57.000
These motors are responsible for moving our robot.

00:57.000 --> 01:01.000
Our fourth component is the IR sensor module.

01:01.000 --> 01:07.000
It helps the robot detect and follow the black line on the surface.

01:07.000 --> 01:11.000
Our fifth component is the robot car chassis,

01:11.000 --> 01:19.000
along with other components used to mount parts like motors, the Arduino, battery, and sensors.

01:19.000 --> 01:25.000
There are several components used like battery to supply power, a rocker switch for control,

01:25.000 --> 01:29.000
and jumper wires to connect different parts of the robot.

01:29.000 --> 01:32.000
With all these components, along with some essential,

01:32.000 --> 01:36.000
we're going to build a Line Following Robot using Arduino.

01:36.000 --> 01:43.000
Let's understand the principles and real-world applications of Line Following Robot.

01:44.000 --> 01:50.000
The robot begins by moving forward, guided by infrared sensors placed underneath it.

01:50.000 --> 01:54.000
These sensors constantly detect the color of the surface below.

01:54.000 --> 02:00.000
As it moves, the sensors check whether they're over a black line or a white background.

02:00.000 --> 02:04.000
But if the line shifts to the left or right, the robot quickly responds.

02:04.000 --> 02:08.000
If the left sensor picks up the black line, the robot turns left.

02:08.000 --> 02:12.000
If the right sensor detects it, it turns right.

02:12.000 --> 02:18.000
This real-time decision-making helps the robot stay on course, even around curves.

02:18.000 --> 02:27.000
The code uploaded to the Arduino handles this logic continuously, adjusting the motors to stay aligned.

02:27.000 --> 02:34.000
Line Following technology is widely used in industrial robots, helping them navigate factory floors with precision.

02:34.000 --> 02:39.000
They deliver materials, move heavy boxes, follow set paths using sensors,

02:39.000 --> 02:45.000
and even operate automated forklifts for efficient warehouse management.

02:45.000 --> 02:52.000
Let's explore the core components of a Line Following Robot and understand the science behind them.

02:52.000 --> 02:56.000
The Arduino Uno is the brain of the robot.

02:56.000 --> 03:00.000
It receives input from sensors and sends output to motors.

03:00.000 --> 03:04.000
We upload code to control how the robot behaves.

03:04.000 --> 03:11.000
Technically, the Arduino Uno is a development board based on the AT-MEGA-328P microcontroller.

03:11.000 --> 03:17.000
It includes digital and analog eye-opens, a USB port for programming,

03:17.000 --> 03:25.000
a voltage regulator for stable 5 voltage power, a crystal oscillator for timing, and a reset button.

03:26.000 --> 03:32.000
It runs C and C++ code and controls sensors and motors in real-time.

03:32.000 --> 03:41.000
Infrared sensor helps the robot detect surfaces using invisible light, just like how remote controls send signals to your TV.

03:41.000 --> 03:45.000
It emits infrared light and waits to see if that light reflects back.

03:45.000 --> 03:52.000
White or reflective surfaces bounce back more infrared light, making it easy for the sensor to detect them.

03:52.000 --> 03:57.000
Dark or black surfaces absorb most of the light, so very little reflects back.

03:57.000 --> 04:04.000
By measuring how much light returns, the sensor can tell whether it's over a light or dark surface.

04:04.000 --> 04:09.000
The motor driver acts like a power manager between the Arduino and the motors.

04:09.000 --> 04:15.000
The Arduino sends control signals, but those signals aren't strong enough to run motors directly.

04:15.000 --> 04:21.000
So, the motor driver boosts the control signals and sends them to the DC motors.

04:21.000 --> 04:30.000
The L298N motor driver includes the main L298N IC, which controls motor direction and power.

04:30.000 --> 04:41.000
It has terminal blocks for motor and power connections, input pins for signals from the Arduino, and enable pins for speed control.

04:41.000 --> 04:47.000
A built-in heat sink prevents the chip from overheating during operation.

04:47.000 --> 04:51.000
Now, let's build our line following robot car.

04:51.000 --> 04:55.000
Begin by assembling all the required components.

04:55.000 --> 05:02.000
We'll start by soldering wires to each of the motor terminals, one for positive and one for negative.

05:02.000 --> 05:09.000
Make sure the solder joints are strong and clean to avoid any loose connections during operation.

05:10.000 --> 05:19.000
Assemble the chassis by securely mounting all four DC motors in place, ensuring proper alignment for smooth movement of the robot.

05:19.000 --> 05:24.000
Attach each wheel firmly to the shaft of the four DC motors.

05:24.000 --> 05:28.000
Use screws or double-sided tape to securely attach the motor driver.

05:28.000 --> 05:34.000
Next, carefully mount the L298N motor driver onto the chassis.

05:34.000 --> 05:40.000
Choose a flat and central spot on the chassis to keep the wiring neat and balanced.

05:40.000 --> 05:45.000
Since we're using four motors, we'll connect two motors to each motor channel on the driver.

05:45.000 --> 05:49.000
Refer the circuit diagram and chart for connections.

05:49.000 --> 05:53.000
Now it's time to mount the Arduino board onto the chassis.

05:53.000 --> 05:59.000
Choose a central or rear area of the chassis where the board is safe and accessible for wiring.

06:00.000 --> 06:06.000
Now, connect the Arduino to the L298N motor driver by wiring the control pins.

06:06.000 --> 06:13.000
Connect IN1 and IN2 to Arduino pins D4 and D5 for the left motors.

06:13.000 --> 06:20.000
Then, connect IN3 and IN4 to D6 and D7 for the right motors.

06:20.000 --> 06:26.000
Next, connect ENA to D9 and ENB to D10 to enable speed control.

06:26.000 --> 06:36.000
This setup let the Arduino control both the direction and speed of the motors using digital and PWM signals.

06:36.000 --> 06:47.000
Now, make the connections using jumper wires as shown in the circuit diagram, ensuring proper links between the infrared sensor, the servo motor and the Arduino board.

06:47.000 --> 06:52.000
Now, connect both IR sensors using jumper wire connections.

06:52.000 --> 07:01.000
Use a single red wire to supply VCC to both sensors and a single black wire to connect the GND of both sensors.

07:01.000 --> 07:10.000
Take the red VCC wire from the infrared sensors and connect it to the Plus 5V output on the L298N motor driver.

07:10.000 --> 07:17.000
Then, connect the black GND wire from the infrared sensors to one of the GND pins on the Arduino.

07:17.000 --> 07:24.000
Now, attach the infrared sensors to the chassis as shown using double-sided tape to keep them secure.

07:24.000 --> 07:37.000
Use a yellow wire to connect the outpin of the left sensor to pin 2 on the Arduino and use a violet wire to connect the outpin of the right sensor to pin 3 on the Arduino.

07:37.000 --> 07:43.000
These wires send signals to the Arduino for line detection and movement.

07:43.000 --> 07:51.000
Now, connect the 5V pin of the Arduino to the 5V input on the L298N module.

07:51.000 --> 07:58.000
Then, connect the GND pin of the Arduino to the GND terminal on the L298N module.

07:58.000 --> 08:03.000
Mount the battery on the robot chassis to power the robot.

08:03.000 --> 08:09.000
We'll connect the battery using a switch button to the L298N motor driver.

08:09.000 --> 08:18.000
Connect the positive terminal of the battery to the VCC pin on the motor driver and the negative terminal to the GND pin.

08:18.000 --> 08:24.000
This will supply power to both the motors and the Arduino.

08:24.000 --> 08:32.000
All the components are connected. Our line following robot is ready for programming and testing.

08:32.000 --> 08:37.000
Let us program and test our line following robot.

08:37.000 --> 08:44.000
Connect the robots Arduino to the laptop using the Arduino USB cable.

08:44.000 --> 08:52.000
Open the Arduino IDE, then go to File, open and select your line following robot code.

08:52.000 --> 08:56.000
In the Tools menu, select Board and then Arduino Uno.

08:56.000 --> 09:01.000
Then, go to Port and select the correct COM port.

09:01.000 --> 09:05.000
Next, click the Verify button to check for any errors in the code.

09:05.000 --> 09:10.000
Once it's verified, click the Upload button to send the code to the Arduino.

09:10.000 --> 09:16.000
Finally, wait for the done uploading message to confirm the processes complete.

09:16.000 --> 09:21.000
Now, you can safely disconnect your laptop from the Arduino.

09:21.000 --> 09:26.000
Now, let's adjust the infrared sensors for accurate line detection.

09:26.000 --> 09:33.000
Using a small screwdriver, gently turn the potentiometer on each infrared sensor to calibrate it.

09:33.000 --> 09:36.000
Place the sensor directly over the black line.

09:36.000 --> 09:40.000
The sensor's LED should turn off when properly adjusted.

09:40.000 --> 09:47.000
Now, move the sensor over the white surface. Both LEDs should turn on.

09:47.000 --> 09:53.000
Repeat this process for both infrared sensors to ensure they respond accurately to black and white surfaces.

09:53.000 --> 10:00.000
Proper calibration is essential, for smooth and precise line following.

10:01.000 --> 10:04.000
Now, let's see the robot in action.

10:04.000 --> 10:07.000
Place it on a flat surface and turn on the switch.

10:07.000 --> 10:10.000
The robot begins to move forward.

10:10.000 --> 10:15.000
Its infrared sensors continuously scan the ground to detect the black line.

10:15.000 --> 10:22.000
As it moves, the robot makes small adjustments to its wheels, ensuring it stays accurately on the path.

10:22.000 --> 10:27.000
All guided by simple sensors and smart logic.

