WEBVTT

00:00.000 --> 00:05.580
Ever wondered how your phone screen adapts to sunlight by getting brighter and dimmer automatically?

00:05.580 --> 00:10.280
Or how greenhouses are just lighting to help plants grow better throughout the day?

00:10.280 --> 00:14.320
That's all possible thanks to light-seeking technology.

00:14.320 --> 00:15.560
Welcome!

00:15.560 --> 00:19.660
In this video, we'll build an Arduino light-seeking robot.

00:19.660 --> 00:22.000
Let's see how it's built.

00:23.000 --> 00:28.840
Let's start with the first and most important component of our project, the Arduino Uno Board.

00:29.080 --> 00:31.600
It is the brain of our project.

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

00:39.560 --> 00:44.160
Our second component is the L298N motor driver.

00:44.160 --> 00:48.040
This component is used to control motors in our project.

00:48.040 --> 00:52.360
Our third component is two DC geared motors with two wheels.

00:52.360 --> 00:56.440
These motors are responsible for moving our robot.

00:56.600 --> 01:00.360
Our fourth component is the LDR sensor module.

01:00.360 --> 01:04.800
It helps the robot detect and follow the light.

01:04.800 --> 01:16.440
Our fifth component is the robot car chassis, along with other components used to mount parts like motors, the Arduino, battery, and sensors.

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

01:22.560 --> 01:26.240
and jumper wires to connect different parts of the robot.

01:26.240 --> 01:34.080
With all these components, along with some essential, we're going to build a light-seeking robot with Arduino.

01:34.080 --> 01:40.360
Let's understand the principles and real-world applications of light-seeking robot car.

01:40.360 --> 01:46.040
The robot follows light using its LDR sensors mounted at the front.

01:46.040 --> 01:54.120
Once light is detected, it begins to move, guided by the difference in light intensity between the left and right sensors.

01:54.160 --> 01:58.800
If the left sensor detects more light, then robot turns left.

01:58.800 --> 02:02.920
If the right sensor detects more light, then it turns right.

02:02.920 --> 02:09.160
And if both sensors detect equal light, the robot moves straight ahead following the light directly.

02:09.160 --> 02:16.720
This continuous comparison helps the robot chase the brightest light source, like a flashlight or sunlight.

02:16.720 --> 02:23.920
The Arduino processes the sensor data in real time, adjusting motor speeds for smooth, responsive steering,

02:23.920 --> 02:32.400
ensuring the robot continuously follows the light source or path without hesitation, even as conditions change.

02:32.400 --> 02:40.080
Light-seeking technology is used in solar panels that turn to face the sun so they can collect more energy during the day.

02:40.080 --> 02:45.840
It's also used in greenhouse automation systems, where lights or plant trays adjust their position,

02:45.840 --> 02:50.640
to ensure crops get the right amount of sunlight for better growth.

02:50.640 --> 02:57.840
Let's explore the core components of a light-seeking robot and understand the science behind them.

02:57.840 --> 03:00.960
The Arduino Uno is the brain of the robot.

03:00.960 --> 03:05.000
It receives input from sensors and sends output to motors.

03:05.000 --> 03:09.040
We upload code to control how the robot behaves.

03:09.040 --> 03:16.320
Technically, the Arduino Uno is a development board based on the AT-Mega3-2-8P microcontroller.

03:16.320 --> 03:25.680
It includes digital and analog eye-opens, a USB port for programming, a voltage regulator for stable 5 voltage power,

03:25.680 --> 03:30.600
a crystal oscillator for timing, and a reset button.

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

03:37.760 --> 03:42.760
This LDR sensor helps the robot detect light using changes in resistance,

03:42.760 --> 03:48.360
just like how automatic street lights turn on when it gets dark and turn off when it's bright.

03:48.360 --> 03:52.880
The LDR sensor responds to the brightness of surrounding light.

03:52.880 --> 03:58.920
As more light falls on it, the resistance decreases, allowing more current to flow.

03:58.920 --> 04:09.200
When there's less light, the resistance increases, and the current flows more slowly.

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

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

04:20.280 --> 04:25.880
So the motor driver boosts the control signals and sends them to the DC motors.

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

04:35.480 --> 04:39.240
It has terminal blocks for motor and power connections,

04:39.240 --> 04:45.840
input pins for signals from the Arduino, and enable pins for speed control.

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

04:51.920 --> 04:56.080
Let us program and test our light-seeking robot.

04:56.080 --> 05:00.200
Begin by assembling all the required components.

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

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

05:14.480 --> 05:18.480
Assemble the chassis by securely mounting DC motors in place,

05:18.480 --> 05:23.240
ensuring proper alignment for smooth movement of the robot.

05:23.240 --> 05:29.440
Then attach the third wheel to the chassis, using screws and brass spacers.

05:29.480 --> 05:35.640
Next, attach each wheel firmly to the shaft of the DC motors.

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

05:40.120 --> 05:45.400
Carefully mount the L298N motor driver onto the chassis.

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

05:52.120 --> 05:57.080
Since we're using two motors, we'll connect one motor to each motor channel on the driver.

05:57.120 --> 06:01.360
Refer the circuit diagram and chart for connections.

06:01.360 --> 06:05.040
Now it's time to mount the Arduino board onto the chassis.

06:05.040 --> 06:11.760
Choose a central or rear area of the chassis where the board is safe and accessible for wiring.

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

06:18.760 --> 06:24.560
Connect ENA to digital pin 5 on the Arduino to enable speed control for the left motor.

06:24.560 --> 06:32.240
Then, connect IN1 and IN2 to pins D6 and D7 to control the direction of the left motor.

06:32.240 --> 06:39.680
Next, connect IN3 and IN4 to pins D8 and D9 for the right motor's direction.

06:39.680 --> 06:44.680
Finally, connect ENB to pin D10 to control the speed of the right motor.

06:44.680 --> 06:50.200
This setup, let the Arduino control both the direction and speed of the motors,

06:50.200 --> 06:54.400
using digital and PWM signals.

06:54.400 --> 06:59.360
Now, make the connections using jumper wires as shown in the circuit diagram,

06:59.360 --> 07:06.800
ensuring proper links between the LDR sensor, the servo motor and the Arduino board.

07:06.800 --> 07:12.600
Use a single red wire to supply VCC to both sensors, sharing the same power line.

07:12.600 --> 07:17.000
Then, connect a single black wire from the GND pins of both sensors.

07:17.000 --> 07:22.320
Next, connect a purple wire to the A-open of the right LDR sensor

07:22.320 --> 07:27.000
and a green wire to the A-open of the left LDR sensor.

07:27.000 --> 07:33.880
Now, attach the LDR sensors to the chassis, using double-sided tape to keep them secure.

07:33.880 --> 07:39.280
Next, attach the red VCC wire to the 5V pin on the Arduino

07:39.280 --> 07:43.600
and the black GND wire to one of the GND pins.

07:43.600 --> 07:49.120
Then, connect the green wire from the left LDR sensor to Arduino pin A1.

07:49.120 --> 07:54.280
Connect the purple wire from the right LDR sensor to Arduino pin A0.

07:54.280 --> 07:59.840
These connections allow the Arduino to read light levels from both sensors.

07:59.840 --> 08:05.120
Now, power the Arduino using the L298N motor driver.

08:05.120 --> 08:10.160
Connect the VIN pin of the Arduino to the 5V pin on the motor driver.

08:10.160 --> 08:17.080
Then, connect the GND pin of the Arduino to the GND pin on the motor driver.

08:17.120 --> 08:21.600
Mount the battery on the robot chassis to power the robot.

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

08:27.720 --> 08:33.200
Connect the positive terminal of the battery to the VCC pin on the motor driver

08:33.200 --> 08:37.120
and the negative terminal to the GND pin.

08:37.120 --> 08:42.480
This will supply power to both the motors and the Arduino.

08:42.480 --> 08:45.000
Now that all the components are connected,

08:45.000 --> 08:51.800
our light-seeking robot is ready for programming and testing.

08:51.800 --> 08:56.680
Let us program and test our light-seeking robot.

08:56.680 --> 09:03.240
Connect the robots Arduino to the laptop using the Arduino USB cable.

09:03.240 --> 09:10.800
Open the Arduino IDE, then go to File, open and select your line following robot code.

09:10.800 --> 09:15.120
In the Tools menu, select Board and then Arduino Uno.

09:15.120 --> 09:20.080
Then, go to Port and select the correct COM port.

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

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

09:29.720 --> 09:35.200
Finally, wait for the done uploading message to confirm the process is complete.

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

09:41.240 --> 09:45.840
Now, let's adjust the LDR sensors for accurate light detection,

09:45.840 --> 09:48.840
place the robot in a dark area,

09:48.840 --> 09:51.120
and use a torch to test the sensors,

09:51.120 --> 09:55.280
shine the torch on the right sensor, then the left.

09:55.280 --> 09:59.120
When light hits the sensor, both LEDs should turn on.

09:59.120 --> 10:01.160
Showing that light is detected,

10:01.160 --> 10:04.480
repeat to make sure both sensors respond properly.

10:04.480 --> 10:09.880
This helps the robot follow the brightest light accurately.

10:09.880 --> 10:13.000
Now, let's see the robot in action.

10:13.000 --> 10:16.560
Place it on a flat surface and turn on the switch.

10:16.560 --> 10:21.280
The robot stays still until light falls on its LDR sensors.

10:21.280 --> 10:25.120
As soon as it detects light, it begins to move toward the source.

10:25.120 --> 10:28.280
The sensors constantly compare light levels,

10:28.280 --> 10:31.920
and the robot adjusts its direction to follow the brightest path,

10:31.920 --> 10:35.280
all guided by simple sensors and smart logic.

