How to Build an L298N DC Motor Driver Schematic Step-by-Step Guide

Select the SN754410NE or TB6612FNG for compact, high-current applications under 1A. Both outperform traditional bipolar solutions in heat dissipation and efficiency, but require logic-level input signals (3.3V–5V). Ensure your microcontroller’s GPIO can source at least 2mA per channel to avoid signal degradation.
Power supply decoupling is non-negotiable. Place 100nF ceramic capacitors as close as possible to each IC’s VCC and GND pins to suppress voltage spikes that exceed the absolute maximum ratings (SN754410NE: 36V, TB6612FNG: 15V). Add a 22µF electrolytic capacitor across the main power input if using a switching regulator–switching noise above 50kHz can induce erratic behaviour.
The PWM frequency should stay between 5kHz and 20kHz. Frequencies below this range produce audible whine; above it, switching losses climb sharply, reducing torque by up to 15 %. Most modern MCUs (STM32, Atmel AVR, ESP32) can generate 8-bit PWM at the required frequency without hardware acceleration. Keep dead-time between complementary signals at 1–2 µs to prevent shoot-through current.
Thermal management dictates long-term reliability. Mount the IC on a PCB with 2 oz copper pours extending at least 5 mm beyond the footprint. Apply 0.5 °C/W thermal vias under the pad if operating above 50 % duty cycle for more than 30 seconds. Dual-layer boards with bottom-side heatsink pads lower junction temperature by 12–18 % compared to single-layer designs.
For bidirectional control, wire the enable pin high and use two GPIO pins per actuator. Set the direction pin after disabling PWM, never while current flows. This avoids back-EMF transients that can exceed the IC’s breakdown voltage. If regenerative braking is needed, insert a flyback diode and Zener (1N5822 + 30V P6KE) across each output; standard 1N4001 diodes react too slowly and risk avalanche breakdown.
Test each channel with a dummy load (10 W wirewound resistor) before connecting actuators. Monitor current draw with a 0.01 Ω shunt resistor and differential amplifier; a sudden rise above the rated stall current (e.g., 2.2 A for most hobby DC actuators) indicates mechanical binding or incorrect gear meshing. Use the IC’s enable pin for emergency brake–pull it low within 10 ms of detecting overcurrent to prevent thermal shutdown.
Building a Reliable Dual-Channel Control Interface: A Hands-On Walkthrough

Connect the power stage to a 6-35V supply using a 100µF capacitor between VS and GND to suppress transients. Bridge the enable pins (IN1/IN2 for channel one, IN3/IN4 for channel two) to 5V logic via 10 kΩ pull-ups if microcontroller pins are left floating. For PWM control, wire the enable inputs to a 20-25 kHz PWM source–frequencies below 5 kHz cause audible whine, while above 30 kHz reduces efficiency due to switching losses. Current sense resistors (0.1 Ω, 1 W) between SENSE pins and ground track load currents; full-scale sensing occurs at 2 V (20 A max per channel).
Pin Mapping & Essential Components
| Reference Designator | Component Value | Purpose |
|---|---|---|
| Cin | 100 µF, 50 V | Input smoothing |
| Clogic | 10 µF, 16 V | Regulator stability |
| D1-4 | 1N5822 | Freewheeling |
| Rsense | 0.1 Ω, 1 W | Current feedback |
| PWM source | 20-25 kHz, 8-bit | Speed regulation |
Heat dissipation demands a heatsink with ≤1.5 °C/W thermal resistance for loads exceeding 1 A continuous. Thermal shutdown triggers at 150 °C, resuming at 130 °C–add a 5 °C hysteresis via firmware to prevent rapid cycling. Logic supply (VSS ≥ 4.5 V) requires decoupling with a 0.1 µF ceramic cap at the chip; omitting this invites erratic enable behavior. For inductive loads, ensure freewheeling diodes are rated for 1.5× the supply voltage to survive back-EMF spikes.
Connecting the L298N Controller to Brushed Actuators

First, confirm the voltage rating of your brushed actuators matches the controller’s supply range. The board supports inputs between 5 V and 35 V–directly connect a compatible battery or power adapter to the +12 V and GND terminals, ensuring polarity aligns correctly to prevent damage.
Attach the actuator leads to the OUTPUT terminals labeled A and B. For dual-shaft setups, pair the second shaft with OUTPUT C and D. Verify cable conductivity; stranded copper wire of 22–18 AWG gauge resists voltage drops under load. Secure connections with screw terminals tightened to 0.5 Nm torque to prevent loosening during operation.
Link the IN1–IN4 logic pins to a microcontroller’s GPIOs using 30 cm or shorter jumper wires to minimize signal interference. Configure logic outputs as follows: IN1 + IN2 drive the first shaft, IN3 + IN4 control the second. Use pull-down resistors (10 kΩ) on unused inputs to avoid erratic behavior.
Add a 1000 μF electrolytic capacitor across the supply terminals to smooth voltage spikes. For actuators drawing over 1 A continuosly, mount the controller on a heatsink or aluminum plate; thermal paste improves heat transfer. Ambient temperatures exceeding 60 °C degrade performance.
Test rotation direction before final assembly. Apply 5 V logic pulses: HIGH on IN1 + LOW on IN2 spins clockwise; reverse pulses for counter-clockwise. Repeat for the second shaft with IN3/IN4 signals. Calibrate pulse width modulation (PWM) at 20 kHz frequency for smooth speed control.
Route cables away from high-current paths to avoid inductive coupling. Use twisted pairs for logic signals and separate ground returns for power and control sections. Shield actuator cables with braided ground sleeves if electromagnetic interference disrupts operation.
Monitor current draw with a multimeter in series. Peak currents exceeding 2 A per channel require bypassing the onboard 5 V regulator with an external buck converter. Store the setup in a moisture-free environment; condensation corrodes contacts within hours.
Key Power Supply Connections for the H-Bridge IC

Connect the primary voltage source directly to the VS and GND pins, ensuring the input matches the module’s ratings–typically 5V to 35V, but verify the datasheet for exact limits. A bulk capacitor (100µF to 470µF) across these terminals minimizes voltage spikes during switching transitions, preventing erratic behavior or component stress. For high-current applications, place the capacitor within 2cm of the terminals to reduce inductance.
Isolate logic power from the load supply by feeding the VSS pin with a stable 5V reference. This avoids ground loops and interference between control signals and actuator currents. Use a dedicated linear regulator or a separate rail from a microcontroller board if shared grounds introduce noise. Avoid connecting VSS to VS directly–this bypasses built-in protection and risks damaging low-voltage circuitry.
- For bipolar stepper applications, split the load voltage equally between coils to prevent unbalanced currents, which degrade torque consistency.
- When using PWM control, ensure the supply frequency does not exceed 40kHz to prevent switching losses from overheating the internal transistors.
- For inductive loads, flyback diodes must be rated at least 1.5× the peak load voltage and include a 1N5822 or equivalent for rapid recovery.
Grounding Strategies
Star-ground the device’s GND pin near the power source, avoiding daisy-chaining grounds with other hardware. This topology prevents transient currents from creating voltage drops across control signals. If the system includes analog sensors or encoders, route their grounds separately to the star point–never share traces or wires with the H-bridge’s load return path.
In systems with multiple bridges or high-power channels, split the ground plane into regions for digital, analog, and load currents. Use wide traces (minimum 2.5mm/A) for return paths to handle peak currents without resistive losses. Thermally couple the bridge’s substrate to a heatsink if dissipation exceeds 1W/cm²; failure to do so will trigger thermal shutdown or irreversible junction damage.
Test the setup with a current-limited power supply before applying full load. Monitor VS ripple on an oscilloscope–ideally below 100mVpp at maximum current. If ripple exceeds this threshold, increase bulk capacitance or add a small-series inductor (10µH to 100µH) upstream. Always confirm polarity on the load terminals before energizing–reverse voltage destroys the IC within microseconds.
Enabling Actuator Regulation via PWM Signals on H-Bridge Modules
Apply a 1–10 kHz square wave to the enable pins for precise speed modulation–lower frequencies risk audible noise, while values above 10 kHz reduce switching losses but demand faster MOSFETs than the integrated Darlington pairs can handle. Keep the duty cycle between 10% and 90% to prevent lock-up or insufficient torque; below 10% the actuator may stall, above 90% thermal protection triggers prematurely.
Calibration Steps for Optimal Response

Measure input voltage at the enable gate with an oscilloscope: expect 0–5 V TTL levels if the logic supply matches the MCU output. For 3.3 V MCUs, insert a level shifter–skipping this step risks undervoltage and erratic behavior. Verify that the PWM rise/fall times remain under 1 µs to avoid shoot-through; slower edges cause cross-conduction and thermal runway.
Tie unused enable inputs to Vcc through a 10 kΩ resistor to prevent floating nodes that randomly engage the half-bridge. During testing, monitor heatsink temperature: a 5 °C/W sink at 50% duty and 1 A load should not exceed 60 °C. If readings climb higher, reduce switching frequency or add active cooling–thermal derating starts at 70 °C ambient.
Route PWM traces away from analog feedback lines; capacitance between traces induces jitter visible as ±5% speed variation. Use a ground plane under the traces to minimize crosstalk, and keep traces shorter than 5 cm for frequencies above 5 kHz. For bidirectional control, synchronize the enable pulse with the direction latch pulse; a 5 µs delay prevents glitches that momentarily reverse polarity.