0:02
hey guys welcome back to Hash include
0:04
Electronics in this video we are going
0:06
to make simple line follow Robo using
0:08
arduno the idea behind this Robo is to
0:10
detect black line using two IR sensors
0:13
and move Robo accordingly using l298 and
0:15
motor driver module I will explain how
0:17
we solved one of the major issue with
0:19
such robot so let's get started and
0:21
build this robot if you haven't
0:22
subscribed yet please hit subscribe
0:24
button below and press Bell icon to get
0:32
for making line follow Robo we will need
0:34
two WD car kit which comes with car
0:49
switch we will also need arduno Uno two
0:54
modules l29 motor driver
0:57
module double-sided tape
1:00
black electrical tape for making the
1:02
line 7 to 12v DC battery in our case
1:06
lipo 2s battery and few jumper wires
1:09
let's assemble the car now first let's
1:14
Motors Mount two Motors on car chases
1:28
screws attach front wheel
1:37
now attach l298 motor driver module on
1:43
chasis place Ado Uno on car chases using
1:52
tip attach Wheels to Caro
2:02
fix two IR sensors on front of car using
2:15
gun solder battery connector wires to
2:17
switch and fix it on the car
2:28
chasis now let's make a connection as
2:31
per circuit diagram connect left and
2:33
right Motors to motor driver
2:45
module connect l298 motor driver module
2:48
to arduno Uno pins as per
2:53
table attach wires to plus 5 volt and
2:56
ground pinof motor driver module
3:01
we will take plus 5 volt and ground from
3:02
l298 motor driver module and provide two
3:05
IR sensors also provide plus 5 volt and
3:10
Uno now connect right and left IR
3:12
sensors out pins to d11 and D12 of
3:20
respectively connect wires from switch
3:23
to plus 12 volt and ground pin of motor
3:26
module now Place battery on car chases
3:36
let's take a quick look at code first we
3:38
need to Define right and left IR sensor
3:40
pins as d11 and D12 we will use motor
3:43
speed as 180 then declare right and left
3:46
motor pins for l298 motor driver module
3:48
inside setup function we need to set the
3:50
pwm frequency as higher this is very
3:53
important step the problem with TT gear
3:55
Motors is that at very low pwm value it
3:57
does not even rotate if you increase the
3:59
pwm value then it rotates faster and our
4:02
Robo is not controlled in that speed and
4:04
it goes out of line for that we need to
4:06
increase the frequency of analog right
4:08
function this changes the frequency of
4:10
pwm signal on pin D5 and D6 as 781 2.5
4:14
HZ because of it motor runs in
4:16
controlled manner at low speed with high
4:18
pwm value Now set up motor pins as
4:20
output then set up IR sensor pins as
4:22
input initially stop both the motors
4:24
using rotate motor function which takes
4:26
right and left motor speed as argument
4:28
inside loop function read the right and
4:30
left IR sensor values using digital read
4:32
function if both values are low that
4:34
means sensor did not detect the black
4:36
line so rotate both Motors forward if
4:38
right sensor detects black line then
4:40
turn right by rotating right motor in
4:42
Reverse Direction and left motor in
4:44
forward direction if left sensor detects
4:46
black line then turn left by rotating
4:48
left motor in Reverse Direction and
4:49
right motor in forward direction if both
4:51
sensor detects black line then stop both
4:53
the motors we have written rotate motor
4:55
function which takes right and left
4:57
motor speed as argument if motor speed
4:59
is negative then it rotates motor in
5:01
Reverse direction if motor speed is
5:03
positive then it rotates motor in
5:05
forward Direction else it stops the
5:07
motors you can adjust the speed of
5:09
Motors if your Robo needs speed
5:11
adjustment the code and diagram link is
5:13
given in the description below now let's
5:15
upload the code let's make a path using
5:17
black electrical insulation tape you can
5:19
keep the thickness around 4 cm now we
5:22
need to adjust the sensitivity of ir
5:24
sensors place right IR sensor on black
5:26
line and adjust the potential meter so
5:28
that led does not glow same for left
5:38
sensor make sure that both Wheels rotate
5:41
in forward direction if we keep Robo on
5:43
White surface if not then reverse the
5:45
motor wires connected to l29 driver to
5:47
change the rotation that's it let's see
6:34
line follower Robo working depends upon
6:36
many factors like battery used width of
6:39
the black line distance between sensor
6:41
and Robo design you need to adjust these
6:43
parameters according to the robo hope
6:45
you enjoyed the video and thanks for
6:46
watching stay safe and please like share
6:49
comment and don't forget to subscribe to