How to Build and Understand the L293D Motor Driver Circuit Diagram

l293d circuit diagram

Start with an 8-pin dual-inline package rated for 600mA per channel. Connect pin 1 (Enable A) to a 5V logic signal to activate the first output pair (pins 3 and 6). Route the motor leads directly to these outputs–polarity defines rotation direction. Add flyback diodes (1N4007) in reverse across each motor terminal to suppress voltage spikes at power-off.

Power the chip via pin 8 (VCC2), supplying 4.5–36V to drive the load. Keep logic voltage (VCC1, pin 16) independent–use 5V for microcontroller compatibility. A 0.1µF decoupling capacitor between VCC2 and ground stabilizes noisy supplies, critical for 12V DC motors.

For current limiting, insert 1Ω resistors in series with each output. Measure voltage across them to monitor load–1A equates to 1V. Skip this if stall currents stay below 500mA. PWM signals on Enable pins control speed: 1kHz–10kHz balances torque and audible noise.

Thermal management requires a grounded copper pad under the IC. Calculate dissipation: Pd = (Vs – Vce(sat)) × Iload. At 1A and 12V, Pd ≈ 2W–attach a heatsink if ambient exceeds 50°C. Avoid exceeding 2A per channel; parallel ICs split higher loads.

Building a Motor Driver Setup: Step-by-Step Practical Approach

Connect the H-bridge IC’s enable pins (1 and 9) directly to a 5V logic supply, not the motor voltage rail. Bypass capacitors (0.1µF ceramic) must be soldered within 2mm of each power pin–pins 8 and 16 for high-current input, pins 4, 5, 12, and 13 for ground–to suppress transient spikes exceeding ±2A. Use twisted-pair wiring for motor leads, keeping them under 30cm; longer runs require shielded cables terminated at both ends with 100Ω resistors.

Pin Configuration and Common Pitfalls

Pin Function Critical Notes
2, 7 Logic inputs A TTL-compatible; tie unused inputs to GND with 1kΩ pull-down
3, 6 Output A Clamp inductive flyback with 1N4007 diodes reverse-biased to Vs
8 Vs (motor voltage) Range: 4.5–36V; decouple with 220µF electrolytic + 0.1µF ceramic
10, 15 Logic inputs B Float at start-up; initialize via 10µs LOW pulse to avoid glitches
11, 14 Output B Thermal shutdown at 150°C; heatsink if >1.2A continuous

Ensure the ground polygon under the driver spans at least 20mm² on a 2oz copper PCB; thermal vias arrayed at 1.2mm pitch improve heat dissipation by 35%. For bidirectional control, invert both logic inputs simultaneously–phase offset risks shoot-through, drawing 6A in 1µs.

Key Pinout Configuration for Dual H-Bridge Motor Driver Control

l293d circuit diagram

First, connect Enable pins (1 and 9) to a PWM-capable output. These regulate motor speed by adjusting the duty cycle–higher values yield faster rotation. For basic operation, tie them high (5V) if speed control isn’t required, but avoid floating inputs to prevent unpredictable behavior. Use a dedicated PWM source (e.g., Arduino pins 3, 5, 6, 9, or 10 on ATmega328P) for precise control. Never exceed the driver’s 500mA continuous current limit per channel by pairing Enable pins with current-sensing resistors if pushing the boundaries.

Route Input pins (2, 7, 10, 15) directly to logic outputs from your microcontroller. The pairing is strict: Inputs 2 and 7 control Channel 1, while 10 and 15 govern Channel 2. Opposite logic levels on a channel’s pair determine direction–HIGH/LOW for clockwise, LOW/HIGH for counterclockwise. Never leave these pins unconnected or in undefined states; use pull-down resistors (10kΩ) if the microcontroller’s startup delay risks transient back-EMF damage. For shared power rails, add decoupling capacitors (0.1µF ceramic) near each Input pin to suppress noise.

Ground GND pins (4, 5, 12, 13) to a common star point. Avoid daisy-chaining grounds to prevent ground loops. The thermal pad (if present on some packages) should also tie to this star ground–omitting this creates overheating risks under sustained loads. For high-current applications (>300mA), use a heatsink on the package’s tab or switch to a driver with lower RDS(on), like the DRV8871. Separate motor and logic grounds with a ferrite bead if EMI-sensitive sensors operate nearby.

  • VCC1 (16): Power this pin with 4.5–7V for logic (e.g., Arduino’s 5V). Bypass with a 10µF electrolytic + 0.1µF ceramic capacitor to stabilize internal circuitry.
  • VCC2 (8): Supply motor voltage (4.5–36V) here. Match this to your motor’s rated voltage–overvoltage >36V destroys the IC. Add a 220µF bulk capacitor and a flyback diode (1N5822) in parallel with VCC2 if driving inductive loads.
  • Output pins (3, 6, 11, 14): Connect directly to motor terminals. For bidirectional control, ensure outputs never short–even briefly–by adding dead-time delays in firmware. Use 1N5819 Schottky diodes across motor terminals if regenerative braking is intentional.

For sensorless speed feedback, monitor back-EMF via ADC on the Enable pin. Sample when the opposing Input pin is LOW (motor freewheeling). Calibrate thresholds by measuring stall voltage–typically 10% of VCC2 under no load. For encoder integration, reserve two MCU interrupts (e.g., ATmega328P INT0/INT1) for quadrature signals, ensuring pull-up resistors (4.7kΩ) if encoders lack totem poles. Avoid sharing these interrupt lines with SPI/I2C buses to prevent jitter.

Step-by-Step Wiring Guide for Controlling Two DC Motors

l293d circuit diagram

Begin by connecting the motor driver’s power pins to a 5V supply for logic and a separate 6V–12V source for the motors. Avoid shared power rails to prevent voltage drops and erratic motor behavior. Use a potentiometer or voltage regulator if the power source is unstable.

Attach the first motor to the driver’s output terminals marked for Motor A: connect one wire to OUT1 and the second to OUT2. Repeat for Motor B using OUT3 and OUT4. Verify polarity–reversing the connections will invert rotation direction.

Wire the Arduino or microcontroller’s PWM-capable pins to the driver’s enable pins: EN1 for Motor A and EN2 for Motor B. These control speed via pulse-width modulation. Use pins like 5, 6, 9, or 10 on an Arduino Uno for compatibility with default libraries.

Connect the microcontroller’s digital output pins to the input control pins: IN1 and IN2 for Motor A, IN3 and IN4 for Motor B. These dictate direction. For example, setting IN1 HIGH and IN2 LOW spins Motor A clockwise; reverse the states to change direction.

Add capacitors (0.1μF ceramic) across each motor’s terminals to suppress electrical noise. Place them as close to the motor as possible. For longer wires, consider a 10μF electrolytic capacitor near the driver’s power input to stabilize voltage during startup.

Test each motor individually before combining controls. Write a simple script to cycle through forward, reverse, and stop states. Observe current draw–if motor stalls or draws excessive current (above 1A per motor for standard 6V motors), reduce speed or check for mechanical obstructions.

For bidirectional control with speed adjustment, use the following pin assignments (example for Arduino): EN1/EN2 to PWM pins (e.g., 9/10), IN1/IN2 and IN3/IN4 to digital pins (e.g., 7/8 and 5/6). Sample code snippet for smooth acceleration: analogWrite(EN1, speed); digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);

Document wire colors and pin assignments in a schematic sketch. Label motor terminals to simplify troubleshooting. If powering from a battery, ensure the voltage matches the motor’s rating–overvoltage risks burnout; undervoltage causes weak torque.

Common Mistakes When Connecting the Motor Driver Module

Reversing the supply polarity permanently damages the chip. The VS (motor voltage) and VSS (logic voltage) pins are often mistakenly swapped, especially when using separate power sources. Always verify the input voltage ranges: logic requires 4.5–7 V, while motor power typically needs 4.5–36 V. Connecting 12 V directly to the logic pins will fry the internal transistors instantly. Label power rails on your breadboard to prevent accidental cross-connections.

Omitting flyback diodes exposes the IC to inductive voltage spikes, which exceed the absolute maximum ratings. Even brief transients degrade performance over time, causing erratic motor behavior or silent failures. Use Schottky diodes (1N5817) across each motor coil, orienting the cathode toward the positive terminal. For stepper motors, add capacitors (0.1 µF) between coil terminals and ground to suppress high-frequency noise from brush commutation.

Incorrect enable pin handling leads to unpredictable operation. Leaving EN1 or EN2 floating disables motor control entirely–they must be tied high (logic 1) to activate the outputs. PWM signals applied here determine speed, but a common error is driving them with 5 V square waves when the motor supply exceeds 12 V, causing voltage mismatch. Ensure PWM frequency stays below 1 kHz for reliable torque response.

Overlooking thermal management risks thermal shutdown. The SOIC-16 package dissipates 1 W maximum at 25°C, dropping linearly with temperature. Mounting the IC without a heatsink for currents above 600 mA shortens lifespan. Calculate power dissipation using P = I² × R (where R ≈ 1.2 Ω per channel) and add a copper pad or small heatsink if exceeding 0.5 W. Ambient temperatures above 50°C demand derating–reduce current or improve airflow accordingly.

Power Supply Specifications for Stable Driver Module Performance

Select a power source with a voltage range of 4.5V to 36V for motor loads, ensuring it aligns with actuator specifications. For logic inputs (enable pins, signal lines), maintain strict 5V TTL levels–deviations exceeding ±0.3V cause erratic switching, thermal stress, or permanent damage. Use separate rails for motor and logic supplies when handling currents above 600mA; inductance from switching motors can inject noise into sensitive digital circuits, corrupting PWM signals or microcontroller operations.

  • For 12V motors at 1A stall current: provision 1.5A–2A continuous capacity, accounting for inrush peaks during startup (typically 3–5× nominal current for 10–50ms).
  • Regulator dropout: maintain ≥2V headroom for linear regulators (e.g., 7805 for logic) to prevent thermal shutdown under sustained loads.
  • Capacitance: install 100µF electrolytic and 0.1µF ceramic capacitors on both motor and logic rails within 10mm of the driver pins. Omit these and voltage sags during direction changes can trigger false reset states or erratic movement.
  • ESR limitations: ceramic capacitors below 10µF must have ESR pp spikes (>1V) at switching edges, degrading efficiency and lifespan.

Grounding demands star topology: route motor return paths directly to a central ground point, isolating them from signal grounds. Mixing motor and signal currents through shared traces creates ground loops, introducing offset voltages that misbias comparators or corrupt analog readings. Thickness: allocate 2oz copper for motor traces; 1oz suffices for logic paths. For pulse loads exceeding 2A, add a TVS diode (unidirectional, Vbr = 1.1× Vsupply) across motor terminals to clamp inductive kickback–polarity reversal during regenerative braking without protection destroys driver outputs in