...

  • An Arduino pin can deliver only ~40mA current.
  • DC motors like the one we use draw several 100s of mA when loaded.
  • We need a switch/ current amplifier to drive the motor based on the signals from the Arduino.
    • Arduino -> Driver -> Motor.
  • A motor driver allowing bidirectional drive is called an H-bridge
  • L293D is a popular motor driver.
    • L293D has 4 switches. This can be used to drive 4 motors unidirectionally or 2 motors bidirectionally
    • Note that the enables for inputs 1 & 2 are combined (you probably won’t need it, but enable should be high for the PWM signal from Arduino to have any effect). Ditto for enables of inputs 3 & 4
    • L293D has diodes are already connected inside the chip and need not be connected externally

Image courtesy : https://www.ti.com/lit/ds/symlink/l293.pdf

Pin Number

Pin Function

Description

1

Enable 1,2

This pin enables the input pin Input 1(2) and Input 2(7). Usually connected to 5V of Arduino; can also be controlled from your program by connecting it to an Arduino digital output pin.

2

Input 1

PWM control for Output 1 pin. From an Arduino pin supporting analogWrite()

3

Output 1

Connected to one end of  Motor 1

4

Ground

Ground pins are connected to ground of circuit (0V)

8

Vcc2 (Vs)

Connected to the power source for running motors (4.5V to 36V)

16

Vcc1 (Vss)

Connected to +5V of Arduino to enable IC function

...