WEBVTT

00:00.000 --> 00:07.100
Ever wondered how elevators stop when something blocks the door or how automatic doors open as you walk toward them?

00:07.200 --> 00:09.900
That's all thanks to obstacle detection technology.

00:10.700 --> 00:11.700
Welcome.

00:11.700 --> 00:19.200
In this video, we'll explore how the obstacle detection system using Arduino works and take a closer look at how it's built.

00:20.500 --> 00:25.800
Let's start with the first and most important component of our project, the Arduino Uno board.

00:26.500 --> 00:28.500
It is the brain of our project.

00:30.000 --> 00:35.300
Our second component is the ultrasonic sensor, HC-SR-04.

00:36.100 --> 00:38.700
It detects obstacles using ultrasonic waves.

00:40.100 --> 00:43.700
Our next component is the Servo Motor SG90.

00:44.400 --> 00:48.800
It is used to rotate the ultrasonic sensor, allowing it to scan the surroundings.

00:50.000 --> 00:52.200
Our fifth component is the red LED.

00:52.800 --> 00:56.100
It provides a visual alert when an obstacle is detected nearby.

00:57.100 --> 00:59.600
Our next component is the buzzer.

01:00.100 --> 01:04.100
It gives an audible alert when an obstacle is detected.

01:05.600 --> 01:09.600
Our next component is the 220-ohm resistor.

01:10.100 --> 01:14.100
It's used with the LED to limit current and prevent damage.

01:16.100 --> 01:18.100
Our next component is the breadboard.

01:18.600 --> 01:23.100
It's used to mount and connect all the components without soldering.

01:24.100 --> 01:27.100
And at last, we have the jumper wires.

01:27.600 --> 01:32.100
They're used to make quick non-permanent connections between components.

01:33.100 --> 01:39.100
With all these components, along with some essential, we're going to build an obstacle detection system.

01:41.100 --> 01:47.100
Let's understand the principles and real-world applications of obstacle detection system.

01:48.100 --> 01:54.100
This system uses an ultrasonic sensor mounted on a servo motor to scan the surroundings.

01:55.100 --> 01:58.100
The sensor sends out ultrasonic pulses.

01:59.100 --> 02:02.100
If there's an obstacle, the sound bounces back to the sensor.

02:03.100 --> 02:10.100
By calculating the time it takes for the sound wave to return, the system figures out how far the obstacle is.

02:11.100 --> 02:12.100
It uses a simple formula.

02:12.100 --> 02:17.100
Distance equals the speed of sound multiplied by time divided by two.

02:18.100 --> 02:22.100
The servo rotates the sensor to check multiple directions.

02:23.100 --> 02:29.100
If an obstacle is detected within 15 centimeters, a red LED turns on and the buzzer alerts you.

02:33.100 --> 02:37.100
Obstacle detection technology, like this, is widely used in drones.

02:38.100 --> 02:43.100
It helps them fly safely by avoiding trees, buildings, and power lines during flight.

02:44.100 --> 02:51.100
It's also used in industrial robots, allowing them to navigate around machines, workers, and materials without collisions.

02:54.100 --> 02:59.100
Let's explore the core components of an obstacle avoiding robot and understand the science behind them.

03:00.100 --> 03:04.100
The Arduino Uno is the brain of the obstacle detection system.

03:04.100 --> 03:09.100
It receives input from sensors and sends output to the buzzer and LED.

03:10.100 --> 03:13.100
We upload code to control how the system behaves.

03:15.100 --> 03:21.100
This ultrasonic sensor helps the robot detect obstacles, just like how bats use sound to sense their surroundings.

03:22.100 --> 03:33.100
The servo motor is a special type of motor that can rotate to a specific angle, like zero degrees, 90 degrees, or 180 degrees, and hold that position.

03:34.100 --> 03:38.100
We use the servo to rotate the ultrasonic sensor side to side.

03:39.100 --> 03:43.100
The red LED lights up when an obstacle is detected.

03:44.100 --> 03:47.100
It gives a quick visual warning that something is nearby.

03:48.100 --> 03:52.100
Similarly, the buzzer makes a sound when an obstacle is near.

03:53.100 --> 03:56.100
It gives an audible alert to warn you.

03:57.100 --> 04:02.100
The 220-ohm resistor limits the current flowing to the LED.

04:02.100 --> 04:05.100
It protects the LED from burning out.

04:07.100 --> 04:14.100
Now, let's build our obstacle detection system, begin by assembling all the required components.

04:16.100 --> 04:20.100
First, assemble the Arduino and servo motor on the breadboard.

04:21.100 --> 04:25.100
Place the Arduino near the breadboard with the USB port accessible.

04:26.100 --> 04:30.100
Then, position the servo motor close to it for easy wiring.

04:31.100 --> 04:35.100
Now, let's assemble the ultrasonic sensor on the breadboard.

04:36.100 --> 04:43.100
Start by identifying its four pins, from left to right, VCC, Trig, Echo, and GND.

04:44.100 --> 04:49.100
Place the sensor above the servo motor using a stand for support.

04:50.100 --> 04:55.100
Now, let's connect the power lines from the Arduino to the breadboard.

04:55.100 --> 05:02.100
Take a male to male jumper wire and connect the five volt pin on the Arduino to the red power rail on the breadboard.

05:03.100 --> 05:08.100
This red rail will serve as the positive voltage line for all components.

05:09.100 --> 05:13.100
Next, connect the GND pin on the Arduino to the blue ground rail.

05:14.100 --> 05:18.100
This rail acts as the common ground for the entire circuit.

05:19.100 --> 05:24.100
These two connections ensure that all components on the breadboard receive a consistent five volt supply.

05:25.100 --> 05:30.100
Now, let's connect the servo motor to the breadboard and Arduino.

05:31.100 --> 05:43.100
Take the SG90 servo and identify its three wires, ground for ground, red for VCC and yellow for signal.

05:44.100 --> 05:48.100
Now, insert the servo wires into the breadboard.

05:48.100 --> 05:53.100
Connect the red VCC wire to the red power rail on the breadboard.

05:54.100 --> 05:59.100
Similarly, connect the brown GND wire to the GND rail on the breadboard.

06:00.100 --> 06:05.100
Then, connect the yellow signal wire to digital pin D3 on the Arduino.

06:07.100 --> 06:12.100
Now, use jumper wires to connect the power pins of the ultrasonic sensor.

06:12.100 --> 06:17.100
Connect the VCC pin to the red power rail on the breadboard.

06:18.100 --> 06:23.100
Similarly, connect the GND pin to the ground rail on the breadboard.

06:24.100 --> 06:28.100
Next, connect the signal pins to the Arduino.

06:29.100 --> 06:34.100
Connect the blue trig pin to digital pin D9 on the Arduino.

06:34.100 --> 06:39.100
And connect the purple echo pin to digital pin D10 on the Arduino.

06:41.100 --> 06:46.100
Place the buzzer onto the breadboard with its two pins in separate rows.

06:47.100 --> 06:53.100
Identify the two pins. The positive pin usually marked with a plus sign or a longer leg.

06:54.100 --> 06:58.100
The negative pin is the shorter leg or marked with a minus sign.

06:58.100 --> 07:05.100
Now, use a jumper wire to connect the negative pin to the GND rail on the breadboard.

07:06.100 --> 07:14.100
Now, connect digital pin D6 on the Arduino to the positive pin of the buzzer using a jumper wire.

07:15.100 --> 07:20.100
This allows the Arduino to send signals they control when the buzzer sounds.

07:20.100 --> 07:25.100
Next, start by identifying the two legs of the LED.

07:26.100 --> 07:31.100
The longer leg is the positive leg called the anode.

07:32.100 --> 07:36.100
The shorter leg is the negative leg called the cathode.

07:37.100 --> 07:43.100
Now, insert the LED into the breadboard placing each leg in a separate row.

07:43.100 --> 07:55.100
First, connect digital pin D7 on the Arduino to the positive leg of the LED using a jumper wire.

07:56.100 --> 08:01.100
Place the 220-ohm resistor in series with the positive leg of the LED.

08:02.100 --> 08:06.100
This resistor protects the LED from burning out.

08:06.100 --> 08:13.100
Then, connect the negative leg directly to the GND rail on the breadboard.

08:15.100 --> 08:21.100
We've successfully completed all connections for our system. Now, it's ready for detection.

08:22.100 --> 08:27.100
Let's move on to programming and testing of our obstacle detection system.

08:28.100 --> 08:33.100
To begin programming, connect your Arduino Uno to the computer using a USB cable.

08:33.100 --> 08:39.100
Next, launch the Arduino IDE on your computer.

08:40.100 --> 08:45.100
Go to the Tools menu, select Board and choose Arduino Uno.

08:46.100 --> 08:50.100
Then, choose the correct port that matches your connected device.

08:51.100 --> 08:54.100
Now, open your project code in the Editor.

08:55.100 --> 08:58.100
Click the Verify button to check for any errors in the code.

08:58.100 --> 09:03.100
Once it's verified, click Upload to send the code to the Arduino.

09:04.100 --> 09:10.100
After a few seconds, you'll see Done Uploading at the bottom of the screen confirming a successful upload.

09:11.100 --> 09:16.100
You can keep the USB cable connected if you're not powering the project externally.

09:17.100 --> 09:20.100
Now, let's see our project in action.

09:21.100 --> 09:26.100
Place it on a flat surface, connect it to your computer, as we're using it as the power source.

09:27.100 --> 09:33.100
As soon as it detects an obstacle, the LED glows and the buzzer starts beeping.

09:34.100 --> 09:37.100
When the object moves closer, the beeping speeds up.

09:38.100 --> 09:43.100
Based on sensor readings, it decides when to beep and when to glow the LED.

09:44.100 --> 09:49.100
All of this happens smoothly, showing how logic and sensors work together in real time.

