Using the L239D motor driver IC


From microcontroller we can not connect a motor directly because microcontroller can not give sufficient current to drive the DC motors. Motor driver is a current enhancing device, it can also be act as Switching Device. Thus we insert motor driver in between motor and microcontroller. Motor driver take the input signals from microcontroller and generate corresponding output for motor.



Motor Driver IC L293D
This is a motor driver IC that can drive two motor simultaneously. L293D IC is a dual H-bridge motor driver IC. One H-bridge is capable to drive a dc motor in bidirectional. L293D IC is a current enhancing IC as the output from the sensor is not able to drive motors itself so L293D is used for this purpose. L293D is a 16 pin IC having two enables pins which should always be remain high to enable both the H-bridges. L293B is another IC of L293 series having




1. L293D can run a motor up to 600 mA whereas L293B can run up to 1 A.


2. L293D has protection diode whereas L293B doesn’t have any such protection diode. Need to
add the protection diode manually.








  Connecting L239D to motors

 

Diagram 2




 Points regarding L293D


Supply voltage (Vss) is the Voltage at which we wish to drive the motor.
Generally we prefer 6V for dc motor and 6 to 12V for gear motor, depending upon the rating of the motor.
Logical Supply Voltage will decide what value of input voltage should be
considered as high or low .So if we set Logical Supply Voltage equals to +5V, then -0.3V to 1.5V will be considered as Input Low Voltage and 2.3 V to 5V will be considered as Input High Voltage.
L293D has 2 Channels .One channel is used for one motor.
 Channel 1  -  Pin 1to 8
 Channel 2  -  Pin 9 to 16
Enable Pin is use to enable or to make a channel active .Enable pin is also called as Chip Inhibit Pin.
All  Input  (Pin  No.  2,  7,10and  15)  of  L293D  IC  is  the  output  from microcontroller (ATmega8).
E.g.-We connected (Pin No. 2, 7, 10 and 15) of L293D IC to (Pin No. 14,
15,16and 17) of ATmega8 respectively in our robots, because on pin 15 and 16 of ATmega8 we can generate PWM.
All Output (Pin No. 3, 6,11and 14) of L293D IC goes to the input of Right and
Leftmotor.


if Enable pin low, the output will be at 0 always. If its high output depend on input 

Output Connections

 OUTPUT 1  (Pin No  3)  ---   Negative Terminal of Right Motor
 OUTPUT 2 (Pin No   6)  ---  Positive Terminal of Right Motor
 OUTPUT 3 (Pin No 10)   --- Positive Terminal of Left Motor
 OUTPUT 4 (Pin No 14)   --- Negative Terminal of Left Motor



Input
1
Input
2
Input
3
Input
4
Output
1
Output
2
Output
3
Output
4
Motors Output
Movement
Right
Left
Low
High
High
Low
0
Vss
Vss
0
Straight
Straight
Straight
Low
High
Low
Low
0
Vss
0
0
Straight
No move
Left Turn
Low
Low
High
Low
0
0
Vss
0
No move
Straight
Right Turn
Low
High
Low
High
0
Vss
0
Vss
Straight
Reverse
Sharp Left
High
Low
High
Low
Vss
0
Vss
0
Reverse
Straight
Sharp Right
High
Low
Low
High
Vss
0
0
Vss
Reverse
Reverse
Backward