Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.

L293D Arduino: Dual Motor Driver Shield Guide

Working with motors in embedded systems has always been a balancing act between power requirements and control logic. After years of designing motor control circuits for robotics platforms, I’ve learned that the L293D Arduino motor driver shield remains one of the most practical solutions for multi-motor projects, despite newer alternatives flooding the market.

The L293D shield isn’t just a convenient add-on for your Arduino board. It’s a carefully engineered interface that solves fundamental electrical incompatibilities between microcontrollers and motors. Understanding its architecture, limitations, and proper implementation separates functional prototypes from reliable production systems.

What Makes the L293D Arduino Shield Different

The L293D motor driver shield represents a complete motor control ecosystem on a single PCB. Unlike standalone motor driver ICs that require external components and custom PCB layouts, this shield mounts directly onto Arduino UNO or MEGA boards through the standard header pin configuration.

At its core, the shield integrates two L293D dual H-bridge motor driver chips manufactured by STMicroelectronics. This gives you four independent H-bridge circuits capable of driving four DC motors bidirectionally or two bipolar stepper motors simultaneously. Each H-bridge channel provides up to 600mA continuous current with peak capacity reaching 1.2A for brief periods.

The Role of the 74HC595 Shift Register

Here’s what many tutorials gloss over: the shield uses a 74HC595 serial-to-parallel shift register to expand Arduino’s limited GPIO availability. This 8-bit shift register takes serial data from just four Arduino pins and converts it into eight parallel outputs that control the direction inputs of both L293D chips.

This architecture is brilliant from a design standpoint. Without the shift register, controlling four motors bidirectionally would consume 12 Arduino pins minimum. With it, the shield uses only pins 4, 7, 8, and 12 for direction control through the shift register, plus pins 3, 5, 6, and 11 for PWM speed control. This leaves analog pins A0-A5 and pins 2, 9, 10, and 13 available for sensors, displays, and other peripherals.

L293D Arduino Shield Technical Specifications

Understanding the electrical characteristics prevents the most common failures. Here’s the complete specification breakdown:

ParameterValueNotes
Operating Voltage (Motor)4.5V – 25VOfficial rating from datasheet
Logic Supply Voltage4.5V – 5.5VPowers the L293D logic circuits
Continuous Current per Channel600mAPer H-bridge output
Peak Current per Channel1.2ANon-repetitive, brief duration
Total Shield Current2.4AAll four channels combined
Voltage Drop1.4V – 2.5VDepends on load current
PWM Frequency Range1kHz – 8kHzConfigurable through library
Operating Temperature0°C – 70°CAmbient temperature
Thermal Shutdown150°CJunction temperature protection
Number of Motor Ports4 DC motors or 2 stepper motorsM1, M2, M3, M4 terminals

Pin Utilization and Availability

Arduino PinsShield FunctionUser Accessible
D4, D7, D8, D1274HC595 shift register controlNo (always used)
D3 (PWM)Motor 2 speed controlNo when M2 active
D5 (PWM)Motor 3 speed controlNo when M3 active
D6 (PWM)Motor 4 speed controlNo when M4 active
D11 (PWM)Motor 1 speed controlNo when M1 active
D9 (PWM)Servo 2 controlYes (servo header)
D10 (PWM)Servo 1 controlYes (servo header)
D2, D13AvailableYes
A0 – A5Analog inputsYes
I2C (A4, A5)I2C communicationYes (shared with analog)

Power Supply Architecture and Configuration

The power supply design requires careful attention. The L293D shield supports multiple powering strategies, but choosing the wrong one causes 90% of motor control problems I’ve troubleshooted.

Power Jumper Configuration

The PWR jumper on the shield determines power routing between Arduino and the motor driver:

Jumper Installed: Motor power supply (connected to EXT_PWR or Arduino DC jack) also powers the Arduino through its VIN pin. Use this configuration when:

  • Running the entire system from a single battery pack
  • Supply voltage is between 7V-12V (safe for Arduino’s onboard regulator)
  • Total current draw (Arduino + motors) doesn’t exceed power supply capacity

Jumper Removed: Arduino and motors use separate power supplies. This is the recommended configuration for:

  • Motor voltages above 12V
  • USB-powered Arduino during development
  • Situations where motor noise might reset the Arduino
  • Professional applications requiring isolated power domains

Proper Power Connection Methods

Method 1: Single Power Supply (Jumper Installed)

Power Supply (7-12V, 2A+) → Arduino DC Jack

PWR Jumper: INSTALLED

Result: Both Arduino and motors powered from same source

Method 2: Dual Power Supply (Jumper Removed – Recommended)

USB Cable or External Supply → Arduino power

Separate Battery/PSU (4.5-25V) → Shield EXT_PWR terminal

PWR Jumper: REMOVED

Result: Isolated power domains, cleaner operation

Method 3: Shield-Only Power

Power Supply (7-12V) → Shield EXT_PWR terminal

PWR Jumper: INSTALLED

Result: Shield powers Arduino through VIN

Warning: Less stable than Method 1

The power LED indicator on the shield illuminates when motor power is correctly supplied, providing instant visual confirmation.

Understanding Current Limitations

The 600mA continuous current rating per channel is not a suggestion—it’s a hard thermal limit. Each L293D chip contains bipolar junction transistors (BJTs) in the H-bridge configuration. Unlike MOSFET-based drivers, BJTs have higher on-resistance and generate significant heat under load.

Real-World Current Considerations

Common hobby motors and their typical current requirements:

Motor TypeVoltageNo-Load CurrentStall CurrentL293D Compatible?
TT Gear Motor3-6V40-70mA250-400mAYes
BO Motor3-12V50-100mA300-600mAYes (borderline at stall)
N20 Micro Motor6V60mA300mAYes
130 Size Motor6V100mA800mANo (exceeds rating)
28BYJ-48 Stepper5V150mA per coil300mA totalYes
NEMA 17 Stepper12V400mA per coil800mA totalNo

If your motor’s stall current exceeds 600mA, you risk thermal shutdown or permanent damage. Motors don’t always run at stall current, but startup transients, mechanical binding, or obstacle contact can trigger these conditions momentarily.

Installing the AFMotor Library

The Adafruit Motor Shield library (version 1) provides the essential functions for L293D shield operation. While you could control the shield by directly manipulating shift register pins, the library handles timing requirements and provides intuitive motor control methods.

Library Installation Steps

Open Arduino IDE and navigate to Sketch → Include Library → Manage Libraries. In the Library Manager search box, type “Adafruit Motor Shield” and install version 1.x (the legacy version specifically for L293D shields, not the V2 library for MOSFET-based shields).

Alternatively, download directly from the GitHub repository:

https://github.com/adafruit/Adafruit-Motor-Shield-library

After installation, include the library in your sketch:

#include <AFMotor.h>

DC Motor Control Implementation

Controlling DC motors requires understanding three fundamental parameters: port selection, speed, and direction. Here’s a complete implementation with practical examples.

Basic DC Motor Control Code

#include <AFMotor.h>

// Create motor object

// Parameters: (motor port number, PWM frequency)

// Port: 1-4 for M1-M4 terminals

// Frequency: MOTOR12_1KHZ, MOTOR12_2KHZ, MOTOR12_8KHZ for M1/M2

//           MOTOR34_1KHZ, MOTOR34_2KHZ, MOTOR34_8KHZ for M3/M4

AF_DCMotor motor1(1, MOTOR12_8KHZ);

void setup() {

  // Set initial motor speed (0-255)

  motor1.setSpeed(200);

  // Stop motor initially

  motor1.run(RELEASE);

}

void loop() {

  // Run motor forward at current speed

  motor1.run(FORWARD);

  delay(2000);

  // Stop motor (coast)

  motor1.run(RELEASE);

  delay(1000);

  // Run motor backward

  motor1.run(BACKWARD);

  delay(2000);

  // Brake (short brake)

  motor1.run(BRAKE);

  delay(500);

}

Dual Motor Robot Car Example

This practical example demonstrates differential drive control for a two-wheel robot:

#include <AFMotor.h>

// Define motors for left and right wheels

AF_DCMotor motorLeft(1, MOTOR12_8KHZ);   // M1 terminal

AF_DCMotor motorRight(2, MOTOR12_8KHZ);  // M2 terminal

void setup() {

  Serial.begin(9600);

  Serial.println(“Robot Car Ready”);

  // Initialize motors

  motorLeft.setSpeed(0);

  motorRight.setSpeed(0);

  motorLeft.run(RELEASE);

  motorRight.run(RELEASE);

}

void loop() {

  moveForward(180, 2000);     // Speed 180, duration 2 seconds

  stopRobot(500);

  turnRight(150, 1000);       // Turn right for 1 second

  stopRobot(500);

  moveBackward(180, 2000);

  stopRobot(500);

  turnLeft(150, 1000);

  stopRobot(500);

}

void moveForward(int speed, int duration) {

  Serial.println(“Moving forward”);

  motorLeft.setSpeed(speed);

  motorRight.setSpeed(speed);

  motorLeft.run(FORWARD);

  motorRight.run(FORWARD);

  delay(duration);

}

void moveBackward(int speed, int duration) {

  Serial.println(“Moving backward”);

  motorLeft.setSpeed(speed);

  motorRight.setSpeed(speed);

  motorLeft.run(BACKWARD);

  motorRight.run(BACKWARD);

  delay(duration);

}

void turnRight(int speed, int duration) {

  Serial.println(“Turning right”);

  motorLeft.setSpeed(speed);

  motorRight.setSpeed(speed);

  motorLeft.run(FORWARD);

  motorRight.run(BACKWARD);

  delay(duration);

}

void turnLeft(int speed, int duration) {

  Serial.println(“Turning left”);

  motorLeft.setSpeed(speed);

  motorRight.setSpeed(speed);

  motorLeft.run(BACKWARD);

  motorRight.run(FORWARD);

  delay(duration);

}

void stopRobot(int duration) {

  Serial.println(“Stopping”);

  motorLeft.run(RELEASE);

  motorRight.run(RELEASE);

  delay(duration);

}

Stepper Motor Control

The L293D Arduino shield excels at driving small bipolar stepper motors. Each stepper requires two motor ports (one port per coil), so you can control up to two steppers simultaneously.

Stepper Motor Connection

Connect your stepper motor using either M1-M2 (port 1) or M3-M4 (port 2) terminals:

  • Coil A: Connect to M1 (or M3)
  • Coil B: Connect to M2 (or M4)

For unipolar steppers with center tap wires, leave the center taps unconnected or tie them to the motor supply positive.

Stepper Motor Code Example

#include <AFMotor.h>

// Create stepper motor object

// Parameters: (steps per revolution, port number)

// Common values: 200 steps (1.8° per step), 48 steps (7.5° per step)

AF_Stepper stepper(200, 1);  // 200 steps/rev on port 1 (M1-M2)

void setup() {

  Serial.begin(9600);

  Serial.println(“Stepper Motor Control”);

  // Set speed in RPM

  stepper.setSpeed(60);  // 60 RPM

}

void loop() {

  Serial.println(“Forward 200 steps”);

  stepper.step(200, FORWARD, DOUBLE);  // Steps, direction, style

  delay(1000);

  Serial.println(“Backward 200 steps”);

  stepper.step(200, BACKWARD, DOUBLE);

  delay(1000);

  // Different stepping modes

  stepper.step(100, FORWARD, SINGLE);     // Lower torque, less power

  delay(500);

  stepper.step(100, FORWARD, INTERLEAVE); // Half-step, smoother

  delay(500);

  stepper.step(100, FORWARD, MICROSTEP);  // Smoothest, slowest

  delay(500);

}

Stepper Stepping Modes

ModeDescriptionSteps per RevolutionPower ConsumptionSmoothness
SINGLEOne coil energizedNative (e.g., 200)LowStandard
DOUBLETwo coils energizedNative (e.g., 200)HighStandard
INTERLEAVEAlternates single/double2x native (e.g., 400)MediumImproved
MICROSTEPSoftware interpolation8x native (e.g., 1600)VariableSmoothest

Servo Motor Integration

The L293D shield breaks out Arduino pins D9 and D10 to dedicated 3-pin servo headers, making servo integration straightforward. Unlike DC motors, servos draw power from Arduino’s onboard 5V regulator, not the external motor supply.

Servo Control Example

#include <Servo.h>

Servo servo1;  // Servo connected to D10 header

Servo servo2;  // Servo connected to D9 header

void setup() {

  servo1.attach(10);  // Attach to pin 10

  servo2.attach(9);   // Attach to pin 9

  // Center both servos

  servo1.write(90);

  servo2.write(90);

}

void loop() {

  // Sweep servo 1 from 0 to 180 degrees

  for(int angle = 0; angle <= 180; angle += 5) {

    servo1.write(angle);

    delay(15);

  }

  // Sweep servo 2 in opposite direction

  for(int angle = 180; angle >= 0; angle -= 5) {

    servo2.write(angle);

    delay(15);

  }

}

Important Servo Limitation: Standard hobby servos draw 100-500mA under load. Arduino’s 5V regulator can typically supply 500mA maximum. Driving two servos simultaneously under load may exceed this capacity, causing brown-out resets. For multiple servos or high-torque servos, use an external 5V power supply.

Common Problems and Engineering Solutions

After debugging hundreds of L293D shield projects, these issues appear repeatedly. Here’s how to diagnose and fix them systematically.

Motors Don’t Run at All

Symptom: Motors connected, code uploaded, but no movement.

Diagnostic Steps:

  1. Check power LED on shield—if off, no motor power supplied
  2. Verify PWR jumper configuration matches your power setup
  3. Measure voltage at EXT_PWR terminals with multimeter
  4. Confirm motor connections at screw terminals are tight
  5. Test motor by connecting directly to power supply

Common Causes:

  • Removed PWR jumper but forgot to supply external motor power
  • Insufficient power supply current capacity (needs 2A minimum)
  • Incorrect library installation or version mismatch
  • Motor voltage below 4.5V threshold

Motors Run Weakly or Erratically

Symptom: Motors spin but with insufficient torque or intermittent operation.

Root Causes:

Inadequate power supply: 9V batteries provide poor current capacity (200mA typical). Switch to lithium-ion packs, NiMH cells, or bench supplies rated 2A+.

Voltage drop: The L293D loses 1.4-2.5V internally. A 6V motor needs 7.5-8.5V supply for full performance.

Shared power supply noise: Motor switching generates electrical noise that resets Arduino. Solution: Use separate supplies or add 1000μF electrolytic capacitor across motor power terminals.

Motor current exceeds rating: If motors draw >600mA, they’ll trigger thermal protection. Verify motor current with ammeter under load.

Shield Overheating

Symptom: L293D chips become hot to touch, possibly triggering thermal shutdown.

Engineering Solutions:

  • Add adhesive heatsinks to both L293D chips
  • Reduce motor speed to decrease average current
  • Implement PWM frequency optimization (higher frequency = more switching losses)
  • Verify motor current doesn’t exceed 600mA continuous
  • Ensure adequate PCB ventilation in enclosure

Thermal Calculation: At 600mA per channel with 2V drop, each channel dissipates 1.2W. With four channels active, that’s 4.8W total—enough to raise junction temperature significantly without heatsinking.

Arduino Random Resets

Symptom: Arduino resets unpredictably during motor operation.

Typical Causes:

  1. Shared power supply brownouts: Motor starting current causes voltage sag that resets Arduino
  2. Ground loops: Poor ground connections create reference voltage differences
  3. Insufficient decoupling: EMI couples into Arduino power rails

Fixes:

  • Use separate, isolated power supplies for Arduino and motors
  • Add 100μF capacitor between Arduino VIN and GND
  • Add 0.1μF ceramic capacitor between motor terminals
  • Ensure star-grounded configuration (all grounds meet at single point)
  • Twist motor wires to reduce EMI radiation

L293D vs L298N Comparison

Understanding when to use L293D versus L298N prevents costly redesigns mid-project.

FeatureL293D ShieldL298N Module
Motor Channels4 DC or 2 stepper2 DC or 1 stepper
Continuous Current600mA per channel2A per channel
Peak Current1.2A3A
Voltage Drop1.4-2.5V2-4V
Operating Voltage4.5-25V5-46V
Form FactorArduino shieldStandalone module
Protection DiodesInternalExternal required
Typical ApplicationsSmall robots, educationalHigh-power robots, industrial
Breadboard CompatibleYes (DIP package)No (requires module)
Thermal ManagementPassive (add heatsink)Active (includes heatsink)
Arduino IntegrationDirect mount shieldRequires jumper wires

When to Choose L293D:

  • Multi-motor projects (need 3-4 motors)
  • Small motors (BO motors, TT gear motors, micro steppers)
  • Battery-powered portable robots
  • Educational projects and prototyping
  • Budget-constrained applications

When to Choose L298N:

  • High-current motors (>600mA)
  • Higher voltage motors (>12V)
  • Heavy-load applications requiring maximum torque
  • Only need 1-2 motors
  • Industrial or production environments

Practical Applications and Project Ideas

Four-Wheel Drive Robot Platform

The L293D shield’s four-channel capability makes it ideal for 4WD robots:

AF_DCMotor motorFL(1);  // Front Left

AF_DCMotor motorFR(2);  // Front Right

AF_DCMotor motorRL(3);  // Rear Left

AF_DCMotor motorRR(4);  // Rear Right

void moveForward() {

  motorFL.run(FORWARD);

  motorFR.run(FORWARD);

  motorRL.run(FORWARD);

  motorRR.run(FORWARD);

}

Dual Stepper CNC Plotter

Control two stepper motors for X and Y axis movement:

AF_Stepper stepperX(200, 1);  // X-axis on M1-M2

AF_Stepper stepperY(200, 2);  // Y-axis on M3-M4

Line Following Robot with Speed Control

Combine motor control with sensor feedback:

int leftSensor = analogRead(A0);

int rightSensor = analogRead(A1);

if(leftSensor < threshold) {

  motorLeft.setSpeed(150);

  motorRight.setSpeed(200);

} else if(rightSensor < threshold) {

  motorLeft.setSpeed(200);

  motorRight.setSpeed(150);

}

Useful Resources and Downloads

Official Documentation

Libraries and Software

Design Tools and Schematics

Learning Resources

Component Sources

Frequently Asked Questions

Q: Can I use the L293D Arduino shield with motors that draw more than 600mA?

No, exceeding the 600mA continuous rating will trigger thermal shutdown protection or cause permanent damage to the L293D chips. The 1.2A peak rating applies only to very brief transients (milliseconds), not sustained operation. If your motors require more current, upgrade to an L298N-based driver with 2A continuous rating or consider MOSFET-based drivers like the TB6612FNG.

Q: Why do my motors run at different speeds even with identical code and PWM values?

This occurs due to manufacturing variations in motor construction, including differences in winding resistance, bearing friction, magnetic field strength, and rotor mass. Even motors from the same production batch exhibit 5-15% speed variation at identical voltages. For applications requiring precise speed matching (like differential drive robots), implement closed-loop control with encoders, or manually calibrate PWM values for each motor through testing.

Q: Can I control both DC motors and stepper motors simultaneously on the same shield?

Yes, but with constraints. The shield has four motor ports total. You could run two DC motors on M1 and M2, plus one stepper motor using M3-M4. However, you cannot run three DC motors and one stepper, as each stepper requires two full motor ports. The total current across all active motors must not exceed 2.4A (600mA × 4 channels).

Q: What’s the difference between motor.run(RELEASE) and motor.run(BRAKE)?

RELEASE opens all H-bridge transistors, allowing the motor to coast to a stop gradually due to mechanical friction. This mode draws no current and generates no heat. BRAKE shorts the motor terminals together through the H-bridge, creating dynamic braking that stops the motor quickly through electromagnetic resistance. BRAKE mode consumes current proportional to motor speed and generates heat in both the motor and driver. Use RELEASE for normal stops and BRAKE when rapid deceleration is required.

Q: My Arduino resets randomly when motors start or reverse direction. How do I fix this?

This indicates power supply problems. Motor starting current creates voltage dips on shared power rails that trigger Arduino’s brown-out reset. Solutions in order of effectiveness: (1) Use completely separate power supplies for Arduino and motors with PWR jumper removed, (2) Add 1000μF electrolytic capacitor between motor supply positive and ground near the shield, (3) Use higher-capacity power supply (3A minimum), (4) Add 100μF capacitor between Arduino VIN and GND, (5) Ensure proper star-grounding with all ground points meeting at one location. The combination of separate supplies plus bulk capacitance eliminates 95% of reset issues.

Conclusion

The L293D Arduino motor driver shield remains a practical choice for multi-motor robotics projects requiring moderate current capacity. Its direct Arduino integration, four-channel capability, and mature software ecosystem make prototyping straightforward without complex wiring or breadboard circuits.

From a PCB design perspective, the shield demonstrates solid engineering: the shift register maximizes GPIO availability, internal protection diodes simplify the BOM, and the modular screw terminal approach accommodates various motor types. However, the BJT-based H-bridges inherently generate more heat and waste more power than modern MOSFET alternatives.

Understanding the 600mA per channel limit is critical. This isn’t a soft guideline—it’s a thermal constraint based on the IC’s ability to dissipate heat. Exceeding it doesn’t just risk component failure; it creates intermittent faults that are difficult to diagnose. Always verify your motors’ current requirements under load before committing to the L293D platform.

For educational projects, small robots, and applications where you need to control multiple motors simultaneously from a single shield, the L293D Arduino solution delivers excellent value. Just respect its current limits, implement proper power supply design, and add heatsinking when running near maximum ratings. These practices separate hobby projects that work occasionally from engineered systems that perform reliably.

Leave a Reply

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

Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.

  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.