L293D

L293D is an integrated circuit chip most commonly used to drive the DC motor/stepper motor/gear motor. This IC consists of two H-bridges that can drive two DC motors simultaneously and in both clockwise and anticlockwise direction. It acts as an interface between the Raspberry Pi (or any other microprocessor) and the motor.

The DC motor needs a significant amount of current to start, which the Raspberry Pi is unable to provide as an output through GPIO. For example, a 5V DC motor needs around 300 to 400 mA current, which is way beyond what is available in the Raspberry Pi's GPIO, and if we directly connect the motor to the GPIO, it can damage the Pi. So, it is recommended you avoid directly connecting of the motor to Pi.

Let's look at the pin diagram for IC L293D to get an understanding of its operation:

L293D has a 16-pin configuration. There are two Enable pins on the chip, pin 1 and pin 9; this Enable pin is used to drive the motor. If Enable is high, then the motor will run and if it is low, the motor will stop. Pins 4, 5, 12, and 13 are ground (GND).

There are four pins as Input, which decides the direction of the rotation of the motor; pins 2, 7, 10, and 14 are marked as input. These four input pins are used to drive two motors in a particular direction—two pins for each motor.

If Input 1 (pin 2) is high and Input 2 (pin 7) is low, the motor will rotate in a clockwise direction; if Input 1 (pin 2) is low and Input 2 (pin 7) is high, then the motor will rotate in an anti-clockwise direction. Similarly, for the other set of two pins, if Input 3 (pin 10) is high and Input 4 (pin 15) is low, the motor will rotate in a clockwise direction; if Input 3 (pin 10) is low and Input 4 (pin 15) is high, the motor will rotate in an anti-clockwise direction. The direction of rotation of motor also depends upon connection between motor terminal and output pins of L293D.

Four output pins are there to provide output to two motors. Pins 3 and 6 are connected to the two terminals of one motor, and pins 11 and 14 are connected to the terminals of other motor. Note that direction of motor rotation also depends upon connection between output pins and terminals of motor.

There are two Vcc pins—one is pin 8 (Vcc2), which is connected to a 9V/5V (voltage of battery depends upon the voltage rating of motor used) DC battery positive terminal. This Vcc2 is used for powering up the motor. The other one is pin 16 (Vcc1), used to power up L293D IC.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.129.247.196