Stufin
Home Quick Cart Profile

L293D Motor Driver IC (2 Pcs)

Buy Now

Pin Configuration

  • L293D Motor Driver IC Pinout and Connection Guide
  • The L293D is a popular dual H-bridge motor driver IC used to control the speed and direction of DC motors in various applications, including robotics, automotive, and industrial automation. This documentation provides a detailed explanation of each pin on the L293D IC and a step-by-step guide on how to connect them.
  • Pinout:
  • Package: DIP-16 ( Dual In-Line Package with 16 pins)
  • Pin Description:
  • 1. Enable 1, 2 (Enable1, Enable2) - Pins 1 and 9
  • These pins are used to enable or disable the motor driver outputs.
  • When Enable1/Enable2 is high (logic level 1), the corresponding motor driver output is enabled.
  • When Enable1/Enable2 is low (logic level 0), the corresponding motor driver output is disabled.
  • 2. Input 1 (Input1) - Pin 2
  • This pin is the input signal for motor A.
  • Connect to the microcontroller or logic circuit output that controls the motor A direction.
  • 3. Input 2 (Input2) - Pin 7
  • This pin is the input signal for motor B.
  • Connect to the microcontroller or logic circuit output that controls the motor B direction.
  • 4. Vcc (Power Supply) - Pin 16
  • This pin is the power supply input for the L293D IC.
  • Connect to a regulated power supply (typically 5V or 12V) that meets the IC's operating voltage requirements.
  • 5. GND (Ground) - Pin 4, 5, 12, and 13
  • These pins are connected to the ground or negative terminal of the power supply.
  • They provide a return path for the motor currents and help to reduce noise and oscillations.
  • 6. Output 1 (Output1) - Pins 3 and 6
  • These pins are the output terminals for motor A.
  • Connect to the motor A windings.
  • 7. Output 2 (Output2) - Pins 11 and 14
  • These pins are the output terminals for motor B.
  • Connect to the motor B windings.
  • 8. Sense A (SenseA) - Pin 15
  • This pin is used to sense the current through motor A.
  • Connect to a current sensing resistor or a protection circuit (optional).
  • 9. Sense B (SenseB) - Pin 10
  • This pin is used to sense the current through motor B.
  • Connect to a current sensing resistor or a protection circuit (optional).
  • Connection Guide:
  • Step 1: Power Supply Connection
  • Connect the Vcc pin (16) to a regulated power supply (5V or 12V) through a decoupling capacitor (0.1uF or 10uF).
  • Connect the GND pins (4, 5, 12, and 13) to the negative terminal of the power supply or a common ground point.
  • Step 2: Microcontroller or Logic Circuit Connection
  • Connect the Input1 pin (2) to the microcontroller or logic circuit output that controls the motor A direction.
  • Connect the Input2 pin (7) to the microcontroller or logic circuit output that controls the motor B direction.
  • Connect the Enable1 pin (1) and Enable2 pin (9) to the microcontroller or logic circuit outputs that enable or disable the motor drivers.
  • Step 3: Motor Connection
  • Connect the Output1 pins (3 and 6) to the motor A windings.
  • Connect the Output2 pins (11 and 14) to the motor B windings.
  • Step 4: Current Sensing (Optional)
  • Connect the SenseA pin (15) to a current sensing resistor or a protection circuit (optional).
  • Connect the SenseB pin (10) to a current sensing resistor or a protection circuit (optional).
  • Note:
  • When using the L293D motor driver IC, ensure that the voltage supply is within the recommended operating range (typically 4.5V to 36V).
  • Use suitable decoupling capacitors and protection circuits to prevent noise, oscillations, and over-voltage conditions.
  • Refer to the L293D datasheet and application notes for more detailed information on usage guidelines, thermal considerations, and protection features.

Code Examples

L293D Motor Driver IC Documentation
Overview
The L293D is a dual H-bridge motor driver IC that enables the control of two DC motors simultaneously. It is a popular choice for robotic and IoT projects that require motor control. This documentation provides an overview of the L293D motor driver IC, its pinout, and code examples to demonstrate its usage in various contexts.
Pinout
The L293D motor driver IC has 16 pins, which are divided into four sections:
Input Pins (1-4, 13-16): These pins are used to control the motor driver IC. Pins 1-4 are used to control Motor A, while pins 13-16 are used to control Motor B.
 Enable Pins (1, 9): These pins are used to enable or disable the motor driver IC. A high signal on these pins enables the motor driver, while a low signal disables it.
 Output Pins (5-8, 10-12): These pins are connected to the motor coils. Pins 5-8 are used for Motor A, while pins 10-12 are used for Motor B.
 VCC and GND Pins (17, 16): These pins are used to power the motor driver IC. VCC is connected to a positive voltage source, while GND is connected to a negative voltage source.
Code Examples
### Example 1: Controlling a Single DC Motor using Arduino
In this example, we will demonstrate how to control a single DC motor using the L293D motor driver IC and an Arduino board.
Hardware Requirements
Arduino Board (e.g., Arduino Uno)
 L293D Motor Driver IC
 DC Motor
 Breadboard and Jumper Wires
Code
```c
const int motorPin1 = 2;  // Pin 2 of Arduino connected to Pin 2 of L293D
const int motorPin2 = 3;  // Pin 3 of Arduino connected to Pin 7 of L293D
const int enablePin = 4;  // Pin 4 of Arduino connected to Pin 1 of L293D
void setup() {
  pinMode(motorPin1, OUTPUT);
  pinMode(motorPin2, OUTPUT);
  pinMode(enablePin, OUTPUT);
}
void loop() {
  // Set motor direction to clockwise
  digitalWrite(motorPin1, HIGH);
  digitalWrite(motorPin2, LOW);
  
  // Enable the motor
  digitalWrite(enablePin, HIGH);
  
  // Delay for 2 seconds
  delay(2000);
  
  // Set motor direction to counterclockwise
  digitalWrite(motorPin1, LOW);
  digitalWrite(motorPin2, HIGH);
  
  // Enable the motor
  digitalWrite(enablePin, HIGH);
  
  // Delay for 2 seconds
  delay(2000);
}
```
### Example 2: Controlling Two DC Motors using Raspberry Pi
In this example, we will demonstrate how to control two DC motors using the L293D motor driver IC and a Raspberry Pi.
Hardware Requirements
Raspberry Pi (e.g., Raspberry Pi 3B+)
 L293D Motor Driver IC
 Two DC Motors
 Breadboard and Jumper Wires
Code
```python
import RPi.GPIO as GPIO
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Set up motor pins
motor1_pin1 = 17
motor1_pin2 = 23
motor1_enable = 24
motor2_pin1 = 12
motor2_pin2 = 16
motor2_enable = 20
# Set up GPIO pins as outputs
GPIO.setup(motor1_pin1, GPIO.OUT)
GPIO.setup(motor1_pin2, GPIO.OUT)
GPIO.setup(motor1_enable, GPIO.OUT)
GPIO.setup(motor2_pin1, GPIO.OUT)
GPIO.setup(motor2_pin2, GPIO.OUT)
GPIO.setup(motor2_enable, GPIO.OUT)
try:
    while True:
        # Set motor 1 direction to clockwise
        GPIO.output(motor1_pin1, GPIO.HIGH)
        GPIO.output(motor1_pin2, GPIO.LOW)
        
        # Enable motor 1
        GPIO.output(motor1_enable, GPIO.HIGH)
        
        # Set motor 2 direction to counterclockwise
        GPIO.output(motor2_pin1, GPIO.LOW)
        GPIO.output(motor2_pin2, GPIO.HIGH)
        
        # Enable motor 2
        GPIO.output(motor2_enable, GPIO.HIGH)
        
        # Delay for 2 seconds
        time.sleep(2)
        
        # Set motor 1 direction to counterclockwise
        GPIO.output(motor1_pin1, GPIO.LOW)
        GPIO.output(motor1_pin2, GPIO.HIGH)
        
        # Enable motor 1
        GPIO.output(motor1_enable, GPIO.HIGH)
        
        # Set motor 2 direction to clockwise
        GPIO.output(motor2_pin1, GPIO.HIGH)
        GPIO.output(motor2_pin2, GPIO.LOW)
        
        # Enable motor 2
        GPIO.output(motor2_enable, GPIO.HIGH)
        
        # Delay for 2 seconds
        time.sleep(2)
except KeyboardInterrupt:
    # Clean up GPIO pins
    GPIO.cleanup()
```
Note: In both examples, the motor driver IC is powered from a separate power source (e.g., a battery or a wall adapter). The VCC pin of the L293D motor driver IC should be connected to the positive terminal of the power source, and the GND pin should be connected to the negative terminal. Additionally, the motor coils should be connected to the output pins of the motor driver IC.