blog

How to Use the L293D Motor Driver Module

L293D Motor Driver Module for arduino

What is the L293D Motor Driver Module?

The L293D is a quad half-H driver primarily used for driving DC motors and stepper motors. It can drive two DC motors and features internal ESD protection, high-noise-immunity inputs, and a wide supply voltage range of 4.5V to 36V. The L293D motor driver IC is renowned for its simple circuit design, requiring only four external diodes to achieve precise control of two independent motors. Its efficient design makes it an ideal choice for numerous DC motor control applications. It also includes an overheat protection feature to effectively prevent damage to the device from excessive heat.

As a classic motor driver board, the L293D module is characterized by its abundant online learning resources, simple programming, and good stability. It is widely used by electronics enthusiasts for DIY projects such as smart cars and robots.

L293D Quad Half-H Driver Specifications

Parameter Specification
Output Current Capability per Driver 600 mA
Pulsed Output Current 1.2 A per driver
Output Clamp Diodes For inductive transient suppression
Supply Voltage Range 9 V to 24 V
Input Logic Supply Separate input-logic supply
Protection Feature Thermal shutdown
ESD Protection Internal ESD protection
Input Characteristics High-noise-immunity inputs
Compatibility Functional replacement for SGS L293D

L293D Quad Half-H Driver: Input and Output Schematics

L293D Quad Half H Driver Input and Output Schematics

L293D IC Pinout

L293D IC PINOUT

Power Pins

Pin Name Description
Pin 16 Vcc1 Logic supply voltage (typically 5V) for internal logic
Pin 8 Vcc2 Motor supply voltage (4.5V – 36V)
Pin 4, 5, 12, 13 GND Ground pins (must be connected to system ground)

All grounds must be common with the microcontroller ground.

Enable Pins (Speed Control)

Pin Name Description
Pin 1 Enable 1,2 Enables Motor A (Output 1 & 2). HIGH = enabled
Pin 9 Enable 3,4 Enables Motor B (Output 3 & 4). HIGH = enabled
  • These pins can be connected to PWM signals for speed control.
  • If LOW, the corresponding motor is disabled.

Input Pins (Direction Control)

Pin Name Description
Pin 2 Input 1 Control input for Motor A
Pin 7 Input 2 Control input for Motor A
Pin 10 Input 3 Control input for Motor B
Pin 15 Input 4 Control input for Motor B

These pins are connected to microcontroller GPIOs and define the motor direction.

Output Pins (Motor Connections)

Pin Name Description
Pin 3 Output 1 Motor A terminal
Pin 6 Output 2 Motor A terminal
Pin 11 Output 3 Motor B terminal
Pin 14 Output 4 Motor B terminal

Connect each motor directly across its corresponding output pins.

Motor Direction Logic (Example: Motor A)

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.

Add Your Heading Text Here

Enable Input 1 Input 2 Motor State
HIGH HIGH LOW Rotate forward
HIGH LOW HIGH Rotate reverse
HIGH LOW LOW Brake / stop
HIGH HIGH HIGH Brake
LOW X X Motor OFF

L293D Mini Motor Driver Module: Working Principle

L293D Mini Motor Driver Module Working Principle

The L293D mini motor driver module is based on the L293D dual H-bridge IC, which amplifies low-current control signals from a microcontroller to drive DC or stepper motors. By controlling the IN pins, the module changes the polarity of the voltage across the motor to achieve forward rotation, reverse rotation, braking, or stop, while motor speed is typically controlled by applying a PWM signal to the EN pins. It uses separate supplies for logic and motor power and includes built-in flyback diodes to protect the circuit from back EMF, making it suitable for low-power motor control applications.

L293D Mini Motor Driver Module: Hardware Introduction

DK L293D Mini Motor Driver Module 02
L293D Pin Description
ENA Motor A enable (PWM speed control)
IN1 Motor A control pin 1
IN2 Motor A control pin 2
IN3 Motor B control pin 1
IN4 Motor B control pin 2
ENB Motor B enable (PWM speed control)
OUT1 / OUT2 Motor A output
OUT3 / OUT4 Motor B output
VCC Motor power supply
GND Ground
5V Logic power (from Arduino if supported)

Controlling the L293D Mini Motor Driver Module with Arduino

Project Introduction

This project uses an Arduino Uno as the main microcontroller (MCU). By interfacing with the L293D motor driver module via its digital output pins, it achieves precise directional control of two independent DC motors. This allows each motor to rotate forward or backward, either individually or simultaneously.

Arduino Uno to L293D Wiring Table (Control Pins)

L293D Motor Driver Module for arduino 1
Arduino Uno Pin L293D Pin Description
D5 (PWM) ENA Motor A speed control
D8 IN1 Motor A direction control
D9 IN2 Motor A direction control
D10 IN3 Motor B direction control
D11 IN4 Motor B direction control
D6 (PWM) ENB Motor B speed control

Motor Connection Table

Motor L293D Output Pins
Motor A OUT1, OUT2
Motor B OUT3, OUT4

Power Connection Table (Important)

Power Source Connection
Arduino GND L293D GND
Motor Power + L293D VCC
Arduino 5V L293D 5V (if module supports onboard logic power)

Important Notes:

  • Arduino GND and motor power GND must be connected together.
  • Do NOT power motors directly from Arduino 5V.
  • Use an external power supply suitable for your motors.

Arduino code

				
					// L293D Dual DC Motor Control Example
// Board: Arduino Uno

// Motor A pins
const int ENA = 5;   // PWM pin for Motor A speed
const int IN1 = 8;
const int IN2 = 9;

// Motor B pins
const int ENB = 6;   // PWM pin for Motor B speed
const int IN3 = 10;
const int IN4 = 11;

void setup() {
  // Set all control pins as output
  pinMode(ENA, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);

  pinMode(ENB, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);

  // Set initial motor speed (0–255)
  analogWrite(ENA, 200);
  analogWrite(ENB, 200);
}

void loop() {

  // Motor A forward, Motor B forward
  motorA_forward();
  motorB_forward();
  delay(2000);

  // Stop both motors
  motor_stop();
  delay(1000);

  // Motor A backward, Motor B backward
  motorA_backward();
  motorB_backward();
  delay(2000);

  // Stop again
  motor_stop();
  delay(2000);
}

// ---------- Motor control functions ----------

void motorA_forward() {
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
}

void motorA_backward() {
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);
}

void motorB_forward() {
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
}

void motorB_backward() {
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, HIGH);
}

void motor_stop() {
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, LOW);
}


				
			

Motor Direction Logic Table

IN1 IN2 State
HIGH LOW Forward
LOW HIGH Backward
LOW LOW Stop
IN3 IN4 State
HIGH LOW Forward
LOW HIGH Backward
LOW LOW Stop

Related Materials

FAQ

L293D vs L298N: An In-Depth Comparison

Feature L293D L298N
Manufacturer STMicroelectronics / TI STMicroelectronics
Driver type Dual H-Bridge Dual H-Bridge
Supported motors 2 DC motors / 1 stepper 2 DC motors / 1 stepper
Maximum motor voltage (Vcc2) 36 V 46 V
Logic voltage (Vcc1) 5 V 5 V
Max current per channel 600 mA (1.2 A peak) 2 A (3 A peak)
Output device type Bipolar transistors Bipolar transistors
Voltage drop ~1.8–2.5 V ~2–4 V
Internal flyback diodes Yes No (external required)
PWM speed control Yes (via Enable pin) Yes (via Enable pin)
Enable pins Enable 1,2 & Enable 3,4 ENA & ENB
Number of control pins 6 6
Thermal protection No Yes
Current sensing No Yes (Sense A, Sense B)
Package 16-pin DIP IC Multiwatt-15 (large)
Typical form factor Bare IC Module with heatsink
Heatsink required No Yes
Efficiency Low Very low
Power dissipation Low–medium High
Board size Very small Large
Cost Low Medium
Ease of use Beginner friendly Moderate
Typical applications Small robots, toys, education Robot cars, CNC, higher-power motors

What is the L293D component?

The L293D is a 16 pin IC, with eight pins, on each side, dedicated to the controlling of a motor. There are 2 INPUT pins, 2 OUTPUT pins and 1 ENABLE pin for each motor. L293D consist of two H-bridge. H-bridge is the simplest circuit for controlling a low current rated motor.

What is L293D used for?

The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, DC and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications.

How many motors can the L293D drive?

The l293d can control up to 4 DC motors, but it can’t power them. So what you want to do is give it a separate power source for the motors, fed directly into the motor shield rather than to the Arduino.

What is L293D motor shield?

The L293D Motor Driver/Servo Shield for Arduino is probably one of the most versatile on the market and features 2 servo and 4 motor connectors for DC or stepper motors. That makes it a great shield for any robotic project.

Can L293D drive a stepper motor?

The L293D is a dual H-bridge driver IC, capable of driving two DC motors or one bipolar stepper motor.

What's better than L298N?

The TB6612FNG is smaller than the L298N, and doesn’t require a heat sink. It also features a much higher efficiency at over 90% versus 40-70% for the L298N, and a low-current standby mode that the L’ lacks.

Leave a Reply

Your email address will not be published. Required fields are marked *