Line Following Obstacle Avoiding Maze solving Robot part 2
Continue from Part 2
L293D
DC Motor Driver & Pin Configuration
“The L293D is a monolithic integrated,
high voltage, high current, 4-channel driver.” Basically this means
using this chip you can use DC motors and power supplies of up to 36
Volts, thats some pretty big motors and the chip can supply a maximum
current of 600mA per channel, the L293D chip is also what’s known
as a type of H-Bridge. The H-Bridge is typically an electrical
circuit that enables a voltage to be applied across a load in either
direction to an output, e.g. motor.
This
means you can essentially reverse the direction of current and thus
reverse the direction of the motor. It works by having 4 elements in
the circuit commonly known as corners: high side left, high side
right, low side right, and low side left. By using combinations of
these you are able to start, stop and reverse the current. You could
make this circuit out of relays but its easier to use an IC – The
L293D chip is pretty much 2 H-Bridge circuits, 1 per side of the
chip or 1 per motor.
The
bit we really care about in all of this is the 2 input pins per motor
that do this logic and these, more importantly for our needs, can be
controlled from the Arduino board.
You
also don’t have to worry about voltage regulation so much because
it allows for 2 power sources – 1 direct source, upto 36V for the
motors and the other, 5V, to control the IC which can be supplied
from the Arduino power supply or since my motor power supply is only
6V I’m going to use this (if the motor supply was higher I would
consider using a transistor or voltage regulator). The only thing to
remember is that the grounding connection must be shared/ common for
both supplies. Below you can see the pin layout for the chip and the
truth table showing the output logic.
Motor
driver pins:
RIGHT MOTOR | LEFT MOTOR |
Black
B1=13pin
Brown
B2=12pin
|
Blue
A1=11pin Green A2=10pi
|
Arduino
L293D Circuit Components
-
10 K Ohm resistors (Brown, Black, Orange, Gold)
-
50V 10uF Capacitor
-
6V DC motor
-
L293D motor controller/ driver chip (IC)
-
A switch (push, toggle etc..)
-
Arduino Deumilanove w/ ATMEGA328
-
Breadboard / Prototyping board
-
Jumper/ Connector wires
-
4x AA battery holder
-
4x AA batteries
-
Optional 220nF multilayer ceramic capacitor (Y5V)
-
Optional 9V DC power supply or use the USB power for the Arduino
Building
the L293D motor driver circuit
First
let’s start with the 16 pins on the L293D chip and what we need to
wire these to. You’ll see that it’s basically got 2 sides, 1 for
each motor.
-
1- Enables and disables the motor whether it is on or off (high or low) comes from the Arduino digital PWM pin 9
-
2- Logic pin for the motor (input is either high or low) goes to Arduino digital pin 4
-
3- Is for one of the motor terminals can be either +/-
-
4- Ground
-
5- Ground
-
6- Is for the other motor terminal
-
7- Logic pin for our motor (input is either high or low) goes to Arduino digital PWM pin 3
-
8- Power supply for the motor, this should be given the rated voltage of your motor, so mine is from a 6V supply
-
9- Enables and disables the 2nd motor on or off (high or low)
-
10- Logic pin for the 2nd motor (input is either high or low)
-
11- Is for one of the 2nd motor terminals can be either +/-
-
12- Ground
-
13- Ground
Datasheet
of Sensors and characteristics of sensors:
-
ENCODERS: QRB 1134 Sensor
Orange:
Power supply
White
: Signal pin
Blue,green:
Ground
DESCRIPTION
The
QRB1133/1134 consists of an infrared emitting diode and an NPN
silicon phototransistor mounted side by side on a converging
optical
axis in a black plastic housing. The phototransistor responds to
radiation from the emitting diode only when a reflective
object
passes within its field of view. The area of the optimum response
approximates a circle .200” in diameter.
Interfacing
QRB
1134 Sensor To Arduino :
Pin:
-
Sensor analog pin A1and A5
Code
wheel:
Encoder generated from Code
wheel generator software. This gives the exact number of tracks of
black and white stripes.
QRB
Sensors reading:
White | Black | |
Right wheel | 800 | 220 |
Left wheel | 800 | 220 |
-
Analog values of QRB
Line Following Obstacle Avoiding Maze solving Robot part 2
Continue from Part 2
L293D
DC Motor Driver & Pin Configuration
“The L293D is a monolithic integrated,
high voltage, high current, 4-channel driver.” Basically this means
using this chip you can use DC motors and power supplies of up to 36
Volts, thats some pretty big motors and the chip can supply a maximum
current of 600mA per channel, the L293D chip is also what’s known
as a type of H-Bridge. The H-Bridge is typically an electrical
circuit that enables a voltage to be applied across a load in either
direction to an output, e.g. motor.
This
means you can essentially reverse the direction of current and thus
reverse the direction of the motor. It works by having 4 elements in
the circuit commonly known as corners: high side left, high side
right, low side right, and low side left. By using combinations of
these you are able to start, stop and reverse the current. You could
make this circuit out of relays but its easier to use an IC – The
L293D chip is pretty much 2 H-Bridge circuits, 1 per side of the
chip or 1 per motor.
The
bit we really care about in all of this is the 2 input pins per motor
that do this logic and these, more importantly for our needs, can be
controlled from the Arduino board.
You
also don’t have to worry about voltage regulation so much because
it allows for 2 power sources – 1 direct source, upto 36V for the
motors and the other, 5V, to control the IC which can be supplied
from the Arduino power supply or since my motor power supply is only
6V I’m going to use this (if the motor supply was higher I would
consider using a transistor or voltage regulator). The only thing to
remember is that the grounding connection must be shared/ common for
both supplies. Below you can see the pin layout for the chip and the
truth table showing the output logic.
Motor
driver pins:
RIGHT MOTOR | LEFT MOTOR |
Black
B1=13pin
Brown
B2=12pin
|
Blue
A1=11pin Green A2=10pi
|
Arduino
L293D Circuit Components
-
10 K Ohm resistors (Brown, Black, Orange, Gold)
-
50V 10uF Capacitor
-
6V DC motor
-
L293D motor controller/ driver chip (IC)
-
A switch (push, toggle etc..)
-
Arduino Deumilanove w/ ATMEGA328
-
Breadboard / Prototyping board
-
Jumper/ Connector wires
-
4x AA battery holder
-
4x AA batteries
-
Optional 220nF multilayer ceramic capacitor (Y5V)
-
Optional 9V DC power supply or use the USB power for the Arduino
Building
the L293D motor driver circuit
First
let’s start with the 16 pins on the L293D chip and what we need to
wire these to. You’ll see that it’s basically got 2 sides, 1 for
each motor.
-
1- Enables and disables the motor whether it is on or off (high or low) comes from the Arduino digital PWM pin 9
-
2- Logic pin for the motor (input is either high or low) goes to Arduino digital pin 4
-
3- Is for one of the motor terminals can be either +/-
-
4- Ground
-
5- Ground
-
6- Is for the other motor terminal
-
7- Logic pin for our motor (input is either high or low) goes to Arduino digital PWM pin 3
-
8- Power supply for the motor, this should be given the rated voltage of your motor, so mine is from a 6V supply
-
9- Enables and disables the 2nd motor on or off (high or low)
-
10- Logic pin for the 2nd motor (input is either high or low)
-
11- Is for one of the 2nd motor terminals can be either +/-
-
12- Ground
-
13- Ground
Datasheet
of Sensors and characteristics of sensors:
-
ENCODERS: QRB 1134 Sensor
Orange:
Power supply
White
: Signal pin
Blue,green:
Ground
DESCRIPTION
The
QRB1133/1134 consists of an infrared emitting diode and an NPN
silicon phototransistor mounted side by side on a converging
optical
axis in a black plastic housing. The phototransistor responds to
radiation from the emitting diode only when a reflective
object
passes within its field of view. The area of the optimum response
approximates a circle .200” in diameter.
Interfacing
QRB
1134 Sensor To Arduino :
Pin:
-
Sensor analog pin A1and A5
Code
wheel:
Encoder generated from Code
wheel generator software. This gives the exact number of tracks of
black and white stripes.
Comments