You are on page 1of 9

How to make a line follower robot using logic

gates
Introduction:
Here we are going to see about logical control robot, which means we have take some
condition that it can satisfies 3 conditions:- In this we are going to take Move Forward,
Backward and Stop. For that we are going to use any 2 logic gates which should
satisfies 3 conditions and Driver IC for Motor.
In this project we can see about the following concepts Power Supply or 9/12v battery
DC Geared Motor or BO-Motor
Basic Motion of Robot
Logic used in the Running the robot
Logic Gates
Driver IC
Mechanical Structure - Visit How to make a Wired Remote Controlled Robot - Part 1The Mechanical Structure

Logic Gate Operation:


LOGIC GATES:In this we are going to use AND Gate and Ex-OR Gate, in which it can satisfies 3
conditions

AND GATE:The AND operation will be signified by AB or A.B. Other Common mathematical
notations for it are A^B and An B, called the intersection of A and B.
One of the easiest multiple-input gates to understand is the AND gate, so-called
because the output of this gate will be "high" (1) if and only if all inputs (first input and
the second input and . . .) are "high" (1). If any input(s) are "low" (0), the output is
guaranteed to be in a "low" state as well.

And Gate IC 7408 pin diagram

PIN DESCRIPTION:Pin Number - Description


1 - A Input Gate 1
2 - B Input Gate 1
3 - Y Output Gate 1
4 - A Input Gate 2
5 - B Input Gate 2
6 - Y Output Gate 2
7 - Ground
8 - Y Output Gate 3
9 - B Input Gate 3
10 - A Input Gate 3
11 - Y Output Gate 4
12 - B Input Gate 4
13 - A Input Gate 4
14 - Positive Supply

LOGIC DIAGRAM:The Logic Diagram of AND Gate is

And Gate Logic Diagram

TRUTH TABLE:A two-input AND gate's truth table looks like this:

Truth Table of And Gate IC 7408

The output is high only when both inputs A and B are high.

EX-OR Gate:Exclusive-OR gates output a "high" (1) logic level if the inputs are at different logic
levels, either 0 and 1 or 1 and 0. Conversely, they output a "low" (0) logic level if the
inputs are at the same logic levels. The Exclusive-OR (sometimes called XOR) gate has
both a symbol and a truth table pattern that is unique.
PIN DIAGRAM:-

X-OR Gate IC 7486 pin diagram

Logic Diagram : -

XOR Gate logic diagram

XOR Gate truth table : -

XOR Gate Truth Table

PIN DESCRIPTION:Pin Number Description


1 A Input Gate 1
2 B Input Gate 1
3 Y Output Gate 1
4 A Input Gate 2
5 B Input Gate 2
6 Y Output Gate 2
7 Ground
8 Y Output Gate 3
9 B Input Gate 3
10 A Input Gate 3
11 Y Output Gate 4
12 B Input Gate 4
13 A Input Gate 4
14 Positive Supply
There are equivalent circuits for an Exclusive-OR gate made up of AND, OR, and NOT
gates, just as there were for NAND, NOR, and the negative-input gates. A rather direct
approach to simulating an Exclusive-OR gate is to start with a regular OR gate, then
add additional gates to inhibit the output from going "high" (1) when both inputs are
"high" (1).

L293D MOTOR DRIVER IC:


L293D is a typical Motor driver or Motor Driver IC which allows DC motor to drive on
either direction. L293D is a 16-pin IC which can control a set of two DC motors

simultaneously in any direction. It means that you can control two DC motor with a
single L293D IC. Dual H-bridgeMotor Driver integrated circuit (IC).
The l293d can drive small and quiet big motors as well, you can find the necessary
pin diagram, working, a circuit diagram, Logic description and Project as you read
through.

CONCEPT:It works on the concept of H-bridge. H-bridge is a circuit which allows the voltage to be
flown in either direction. As you know voltage need to change its direction for being able
to rotate the motor in clockwise or anticlockwise direction, hence H-bridge IC are ideal
for driving a DC motor.
In a single l293d chip there two h-Bridge circuit inside the IC which can rotate two dc
motor independently. Due its size it is very much used in robotic application for
controlling DC motors. Given below is the pin diagram of a L293D motor controller.
There are two Enable pins on l293d. Pin 1 and pin 9, for being able to drive the motor,
the pin 1 and 9 need to be high. For driving the motor with left H-bridge you need to
enable pin 1 to high. And for right H-Bridge you need to make the pin 9 to high. If
anyone of the either pin1 or pin9 goes low then the motor in the corresponding section
will suspend working. Its like a switch. You can simply connect the pin16 VCC (5v) to
pin 1 and pin 9 to make them high.

L293D PIN DIAGRAM:-

L293D Pin Diagram

WORKING OF L293D:-

The there 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as
shown on the pin diagram. Left input pins will regulate the rotation of motor connected
across left side and right input for motor on the right hand side. The motors are rotated
on the basis of the inputs provided across the input pins as LOGIC 0 or LOGIC 1.
In simple you need to provide Logic 0 or 1 across the input pins for rotating the motor.

L293D LOGIC TABLE:Lets consider a Motor connected on left side output pins (pin 3,6). For rotating the motor
in clockwise direction the input pins has to be provided with Logic 1 and Logic 0.
1.
Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance
state]
2.

Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction

3.

Pin 2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction

4.

Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation]

In a very similar way the motor can also operated across input pin 15, 10 for motor on
the right hand side.

VOLTAGE REGULATOR LM7805:-

LM7805

A LM7805 Voltage Regulator used to get output of +5 volts.


An easy way to remember the voltage output by a LM78XX series of voltage regulators
is the last two digits of the number. A LM7805 ends with "05"; thus, it outputs 5 volts.
The "78" part is just the convention that the chip makers use to denote the series of
regulators that output positive voltage. The other series of regulators, the LM79XX, is
the series that outputs negative voltage. So:

LM78XX: Voltage regulators that output positive voltage, "XX"=voltage output.


LM79XX: Voltage regulators that output negative voltage, "XX"=voltage output
The LM7805, like most other regulators, is a three-pin IC.
Pin 1 (Input Pin): The Input pin is the pin that accepts the incoming DC voltage, which
the voltage regulator will eventually regulate down to 5 volts.
Pin 2 (Ground): Ground pin establishes the ground for the regulator.
Pin 3 (Output Pin): The Output pin is the regulated 5 volts DC.

LM7805 VOLTAGE REGULATOR DIAGRAM:-

Be advised, though, that though this voltage regulator can accept an input voltage of 36
volts, it is recommended to limit the voltage to 2-3 volts higher than the output regulated
voltage. For a 5-volt regulator, no more than 8 volts should be applied as the input
voltage. The difference between the input and output voltage appears as heat. The
greater the difference between the input and output voltage, the more heat is generated.
If too much heat is generated, through highinput voltage, the regulator can overheat. If
the regulator does not have a heat sink to dissipate this heat, it can be destroyed and
malfunction. So the two options are, design your circuit so that the input voltage going
into the regulator is limited to 2-3 volts above the output regulated voltage or place a
heat sink in your circuit to dissipate the created heat.
How to give connections to Logic gate ICs:
Take both the logic gate ICs and place it in Bread Board or in PCB Board
First interconnect the first pin of AND gate and EX-OR gate (i.e. 1st pin of IC 7408
and 1st pin of IC 7486)
Then interconnect second pin of AND gate and EX-OR gate(i.e. 2nd pin of IC 7408
and 2nd pin of IC 7486)
Then give one wire in 1st pin of any IC(AND or EX-OR) and in 2nd pin of any IC
(AND or EX-OR)
Then give VCC to 14 pin of both the ICs (i.e. +5V)
Then give Ground Connection to 7 pin of each ICs (i.e. 0V)

LOGIC GATE CIRCUIT DIAGRAM:-

Truth Table for final logic circuit : -

CIRCUIT DIAGRAM FOR L293D MOTOR DRIVER IC CONTROLLER:-

In this 2 and 7 pin are the input pins of IC L293D, so we have give output of the AND
gate and EX-OR is give as the input of Driver IC L293D. In the output pins 3 and 6
connect the motor one end to 3rd pin and other end to 6th pin.
So according to the Truth table when input is Zero-Zero in the logic gate the output will
be also Zero-Zero, so the motor will be in stop condition
When the input is Zero-One in the logic gate the output will be Zero-One, so the Motor

will move in forward direction.


When the input is one-Zero in the logic gate the output will be Zero-One, so the Motor
will move in forward direction.
When the input is One-One in the logic gate the output will be one-Zero, so the Motor
will move in backward direction.

VOLTAGE SPECIFICATION:VCC is the voltage that it needs for its own internal operation 5v; l293D will not use this
voltage for driving the motor. For driving the motor it has a separate provision to provide
motor supply VSS (V supply). L293d will use this to drive the motor. It means if you
want to operate a motor at 9V then you need to provide a Supply of 9V across VSS
Motor supply.
The maximum voltage for VSS motor supply is 36V. It can supply a max current of
600mA per channel. Since it can drive motors Up to 36v hence you can drive pretty big
motors with this l293d.
VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges
from 5v and up to 36v.
Dont Exceed the Vmax Voltage of 36v or it will cause damage.

You might also like