Complete L298N Motor Driver Wiring Schematic Explained Step-by-Step

l298n motor driver circuit diagram

Connect the power supply directly to the board’s input terminals, ensuring the voltage matches the module’s rated limit–typically 7–35V for optimal performance. Use thick-gauge wires (18 AWG or lower) to prevent voltage drops under load, especially if driving high-current actuators. Bypass capacitors (0.1µF ceramic) soldered across the motor terminals will suppress noise and extend component lifespan.

Route control signals from a microcontroller to the logic inputs (IN1–IN4). Maintain signal integrity by keeping traces short or using twisted pairs for connections over 10cm. For high-speed switching, pull-down resistors (10kΩ) on unused inputs prevent erratic behavior. PWM frequencies above 1kHz require clean square waves; noisy signals degrade torque consistency.

Ground the module’s thermal pad to a shared chassis ground with heavy-gauge wire. Isolated grounds between logic and power sections reduce interference but separate them carefully–mixing can cause latch-up in digital circuits. Test current draw at stall conditions; if exceeding 2A per channel, add a heatsink or forced-air cooling.

Verify the schematic’s flyback diodes are present and rated for peak reverse voltage. Missing or undersized diodes lead to destructive voltage spikes. For bidirectional control, wire the enable pins (ENA/ENB) to a dedicated PWM source; tying them high simplifies setup but loses speed regulation.

Building a Robust H-Bridge Controller: Step-by-Step Wiring

Connect the power input pins (VSS and GND) directly to a 7–12 V DC supply, ensuring the voltage regulator jumper remains intact if logic power is drawn from the same source. Omit the jumper only if a separate 5 V line feeds the IC’s control circuitry–failure to do so risks overheating or erratic behavior. Route the output pins (OUT1–OUT4) to the actuator terminals without intermediary components unless current exceeds 2 A; in that case, solder low-ESR capacitors (0.1 µF ceramic) between each output and ground to suppress voltage spikes.

Pin Assignment and Signal Control

Module Terminal Microcontroller Pin Recommended Logic Typical Current (A)
ENA PWM-capable GPIO 8-bit (0–255) 0.3–1.8
IN1 Digital GPIO HIGH/LOW N/A
IN2 Digital GPIO HIGH/LOW N/A
SENSE A Analog input 0–3.3 V Scaled to current

Apply pull-down resistors (10 kΩ) to IN1/IN2 if the microcontroller lacks internal pull-downs–floating inputs cause unpredictable rotation. For bidirectional control, toggle IN1/IN2 while modulating ENA via PWM; 980 Hz yields smoother operation than lower frequencies, minimizing coil whine. Monitor SENSE pins with a differential amplifier if precise torque control is needed–raw values range 0–3.3 V, linearly mapping to 0–2 A.

Ground heatsinks by soldering a 16 AWG wire between the module’s exposed pad and the main GND plane, reducing thermal resistance by ~30%. Never exceed 36 V input–internal diodes clamp transients but degrade rapidly under sustained overvoltage. For dual-actuator setups, stagger signal timings (minimum 20 µs delay) when switching directions to prevent bus contention. Test each channel independently before integration; a stalled actuator should draw

Key Wiring Procedures for Dual H-Bridge Modules

Connect the power supply’s positive terminal directly to the module’s +12V input, ensuring voltage matches the device’s rated range (5–35V). Ground the negative terminal to the module’s common reference point. Avoid exceeding the module’s 2A continuous current limit per channel.

Identify the logic voltage selector near the power inputs. For 5V control signals, bridge the jumper. Remove it if using 3.3V logic to prevent signal damage. Verify voltage compatibility with your microcontroller before proceeding.

Attach control pins to microcontroller outputs using stranded 22–24 AWG wire. Pin 1 (IN1) and Pin 2 (IN2) govern one channel; Pin 3 (IN3) and Pin 4 (IN4) manage the second. Confirm correct pin mapping in your schematic–miswiring reverses rotation unpredictably.

Link each channel’s output terminals to the actuator–red to positive, black to negative. For bidirectional control, leave no floating connections. Test rotation direction before securing wires; twisting polarities during operation risks permanent damage.

Add flyback diodes (1N4007) across each actuator terminal if absent. Modules lack internal protection against inductive spikes, reducing reliability over time. Solder diodes with cathodes connected to the positive side.

Insert a 220μF electrolytic capacitor between power and ground inputs. Low-ESR tantalum capacitors improve stability during sudden load changes. Position capacitance as close to the module’s power pins as possible.

Finalize testing with a multimeter–measure output voltage under load. Expect ±0.5V of supply voltage when enabled. Monitor temperature during sustained operation; any rise above 60°C indicates insufficient cooling, requiring heatsink attachment.

How to Interface a Dual H-Bridge Module with Arduino for Actuator Management

Begin by identifying the power requirements of your actuator–measure its operating voltage and current draw. The module supports a voltage range of 5V to 35V, but ensure your supply matches the actuator’s specifications to avoid overheating or underperformance. Connect the positive terminal of your power source to the module’s +12V input and the negative terminal to GND.

Use the following pinout for Arduino connections:

  • IN1 → Digital pin 5 (direction control for channel A)
  • IN2 → Digital pin 6 (direction control for channel A)
  • IN3 → Digital pin 9 (direction control for channel B)
  • IN4 → Digital pin 10 (direction control for channel B)
  • ENA → PWM pin 3 (speed control for channel A)
  • ENB → PWM pin 11 (speed control for channel B)

Avoid using non-PWM pins for speed modulation, as this will prevent variable control.

Power Supply Considerations

If your actuator operates below 12V, remove the onboard 5V regulator jumper (labeled “5V EN”) to prevent damage. When powering the Arduino from the same source, connect the 5V output of the module to the Arduino’s 5V pin–but only if the supply voltage is stable. For voltages exceeding 12V, use an external 5V regulator to power the Arduino separately.

Test the connections with a multimeter before applying power. Verify that:

  1. No shorts exist between GND and power inputs.
  2. Voltage levels at the module’s output terminals match the expected values.
  3. Arduino pins register logical HIGH/LOW states correctly when toggled.

Failure to check these may result in irreversible damage to the board or microcontroller.

Implementing Direction and Speed Control

Use the following logic for direction control:

  • Forward: Set IN1 HIGH, IN2 LOW
  • Reverse: Set IN1 LOW, IN2 HIGH
  • Brake: Set IN1 and IN2 HIGH (shorts actuator terminals)
  • Coast: Set IN1 and IN2 LOW (actuator moves freely)

Speed is adjusted via PWM signals on ENA/ENB pins. Values range from 0 (off) to 255 (full speed). Example code snippet:

analogWrite(3, 180);  // ~70% speed for channel A
digitalWrite(5, HIGH);
digitalWrite(6, LOW);

For bidirectional control, wrap the logic in a function:

void setActuator(int channel, bool direction, int speed) {
int in1 = (channel == 0) ? 5 : 9;
int in2 = (channel == 0) ? 6 : 10;
int enable = (channel == 0) ? 3 : 11;
digitalWrite(in1, direction);
digitalWrite(in2, !direction);
analogWrite(enable, speed);
}

Monitor current draw if running multiple actuators simultaneously. The module’s thermal protection triggers at ~2A per channel. For higher loads, add heatsinks or use parallel channels with separate power sources. Never exceed the module’s 25W total power limit (e.g., 2A at 12V).

Understanding Voltage and Current Needs for Dual-Bridge Controllers

Ensure your power stage operates within 7–46 V for the primary supply; exceeding this range risks permanent damage to the silicon bridge. For logic inputs (enable and control pins), maintain 4.5–5.5 V–any deviation below this threshold causes erratic switching, while voltages above 7 V trigger ESD protection shutdowns. Current draw scales directly with load torque: stall currents reach 2 A per channel, so fuse protection with a 2.5 A slow-blow or a 3 A polyfuse is mandatory to prevent trace vaporization on standard 1 oz copper PCBs. Use 100 µF electrolytic capacitors per supply rail to suppress transients–ceramic alternatives lack sufficient energy storage for inductive kickback absorption.

Thermal Considerations

l298n motor driver circuit diagram

Dissipation peaks at 20 W when both channels conduct simultaneously at full load. Mount the module on a minimum 50 cm² heatsink with thermal adhesive; passive cooling suffices only for intermittent duty cycles under 50%. For continuous operation above 1.5 A per channel, active cooling with a 6 CFM fan or 8 mm copper pipe heat spreader reduces junction temperatures to below 125°C, preventing thermal throttling. Calculate trace widths using a 35 µm/°C empirical multiplier: 1.5 mm width supports 1 A on 1 oz copper, while 2.5 mm handles 2 A. Bypass logic supply pins with 0.1 µF ceramics to eliminate ground bounce during high-side switching.

Step-by-Step Guide for Dual Channel Actuator Regulation Using H-Bridge Module

Begin by verifying the module’s input voltage range matches your power source. Most variants support 5–46V DC, but exceeding this risks overheating or permanent damage. Connect the supply directly to the board’s positive and ground terminals–avoid intermediate components that could introduce voltage drops.

Identify the control pins for each channel: IN1/IN2 for the first actuator and IN3/IN4 for the second. Apply logic-level signals (3.3V or 5V) to these inputs to dictate movement–HIGH/LOW sequences correspond to forward, reverse, or brake modes. Below is the truth table for clear configuration:

  • Forward: IN1 = HIGH, IN2 = LOW (Channel 1) | IN3 = HIGH, IN4 = LOW (Channel 2)
  • Reverse: IN1 = LOW, IN2 = HIGH | IN3 = LOW, IN4 = HIGH
  • Brake: IN1 = HIGH, IN2 = HIGH | IN3 = HIGH, IN4 = HIGH
  • Stop: IN1 = LOW, IN2 = LOW | IN3 = LOW, IN4 = LOW

Add flyback diodes externally if the module lacks built-in protection. Position 1N4007 diodes across actuator terminals, cathode toward the positive supply. This prevents transient voltage spikes from damaging the board when actuators decelerate or change direction.

Wiring Precautions

l298n motor driver circuit diagram

Use 18–22 AWG wires for power connections and 24–28 AWG for control signals to balance current capacity and flexibility. Secure all connections with solder or screw terminals–loose wires cause erratic behavior. Isolate high-voltage lines from logic circuits with at least 10mm spacing or a physical barrier to prevent interference.

Test actuation with a multimeter before full integration. Measure voltage across actuator terminals during each control sequence. Unexpected readings indicate wiring errors or damaged connections. For dynamic loads, monitor current draw–if it exceeds the module’s 2A continuous rating, implement active cooling or reduce load impedance.

Optimizing Performance

Enable the onboard 5V regulator only if your logic supply exceeds 6V. Below this threshold, bypass the regulator by bridging the jumper and providing external logic power to avoid sag. For precise speed control, replace fixed logic signals with PWM (20kHz–100kHz) on EN pins–keep duty cycles below 90% to prevent thermal overload. Log empirical data in a table:

  1. Duty Cycle: 25% | Current Draw: 0.8A | RPM: 1200
  2. Duty Cycle: 50% | Current Draw: 1.2A | RPM: 2400
  3. Duty Cycle: 75% | Current Draw: 1.6A | RPM: 3500

Adjust actuator timing by staggering PWM phases between channels–this reduces supply noise and smooths mechanical transitions. Store completed setups in a grounded enclosure to shield from electromagnetic interference.