Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use L298N Dual H-Bridge Motor Driver: Examples, Pinouts, and Specs

Image of L298N Dual H-Bridge Motor Driver
Cirkit Designer LogoDesign with L298N Dual H-Bridge Motor Driver in Cirkit Designer

Introduction

The L298N is a robust and versatile dual H-bridge motor driver designed to control the direction and speed of two DC motors or a single stepper motor. It is widely used in robotics, automation, and other motor control applications due to its ability to handle high currents (up to 2A per channel) and operate within a broad voltage range of 5V to 35V. The module integrates essential components such as a voltage regulator and heat sink, making it easy to use in various projects.

Explore Projects Built with L298N Dual H-Bridge Motor Driver

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Controlled Dual Stepper Motor Driver System
Image of project carseten: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
This circuit consists of two L298N DC motor drivers controlled by an ESP32 microcontroller to drive two bipolar stepper motors. The ESP32 uses its GPIO pins to send control signals to the motor drivers, which in turn power the stepper motors with a 12V supply from either a battery or a power supply. The circuit is designed for precise control of stepper motors, likely for applications requiring synchronized movements, such as robotics or CNC machines.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Controlled Fire Detection and GSM Notification System
Image of l298n motor driver test: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
This circuit is designed to control multiple DC motors using an L298N motor driver, which is interfaced with an Arduino UNO microcontroller. The Arduino controls the direction and speed of the motors, as well as a servo motor, and can activate a water pump via a relay module. Additionally, the circuit includes flame and smoke sensors for safety monitoring, and a SIM800L module for potential communication capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Dual Motor Driver with Optical Encoder Feedback
Image of Copy of Mobile Robot System with Speed and Position Control Using ESP32: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
This circuit is designed to control two DC motors using an L298N Dual Motor Driver Module, which receives PWM control signals from an ESP32 microcontroller. The motors' rotational movement can be monitored by two Optical Encoder Sensor Modules connected to the ESP32. Power is supplied by a 4 x AAA battery mount, with the battery's positive terminal connected to the motor driver's 12V input and the negative terminal to the common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Line Following Robot with L298N Motor Driver and KY-033 Sensors
Image of obstacle-avoiding robot: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
This circuit is designed to control a two-wheeled robot using an L298N motor driver, powered by two 18650 Li-ion batteries. It includes two KY-033 line tracking sensors for navigation and a 74HC04 inverter to process sensor signals and control the motor driver inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with L298N Dual H-Bridge Motor Driver

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of project carseten: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
ESP32-Controlled Dual Stepper Motor Driver System
This circuit consists of two L298N DC motor drivers controlled by an ESP32 microcontroller to drive two bipolar stepper motors. The ESP32 uses its GPIO pins to send control signals to the motor drivers, which in turn power the stepper motors with a 12V supply from either a battery or a power supply. The circuit is designed for precise control of stepper motors, likely for applications requiring synchronized movements, such as robotics or CNC machines.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of l298n motor driver test: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
Arduino-Controlled Fire Detection and GSM Notification System
This circuit is designed to control multiple DC motors using an L298N motor driver, which is interfaced with an Arduino UNO microcontroller. The Arduino controls the direction and speed of the motors, as well as a servo motor, and can activate a water pump via a relay module. Additionally, the circuit includes flame and smoke sensors for safety monitoring, and a SIM800L module for potential communication capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of Mobile Robot System with Speed and Position Control Using ESP32: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
ESP32-Controlled Dual Motor Driver with Optical Encoder Feedback
This circuit is designed to control two DC motors using an L298N Dual Motor Driver Module, which receives PWM control signals from an ESP32 microcontroller. The motors' rotational movement can be monitored by two Optical Encoder Sensor Modules connected to the ESP32. Power is supplied by a 4 x AAA battery mount, with the battery's positive terminal connected to the motor driver's 12V input and the negative terminal to the common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of obstacle-avoiding robot: A project utilizing L298N Dual H-Bridge Motor Driver in a practical application
Battery-Powered Line Following Robot with L298N Motor Driver and KY-033 Sensors
This circuit is designed to control a two-wheeled robot using an L298N motor driver, powered by two 18650 Li-ion batteries. It includes two KY-033 line tracking sensors for navigation and a 74HC04 inverter to process sensor signals and control the motor driver inputs.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Robotics: Driving wheels or tracks of robots
  • Automation: Controlling conveyor belts or actuators
  • DIY Projects: Building RC cars, robotic arms, or CNC machines
  • Educational Purposes: Learning motor control and H-bridge concepts

Technical Specifications

Key Technical Details

Parameter Specification
Operating Voltage 5V to 35V
Output Current (per channel) Up to 2A
Peak Current (per channel) 3A (short duration)
Logic Voltage 5V
Control Logic Levels High: 5V, Low: 0V
Number of Channels 2 (dual H-bridge)
Supported Motors 2 DC motors or 1 stepper motor
Power Dissipation Integrated heat sink for cooling
Dimensions Approx. 43mm x 43mm x 27mm

Pin Configuration and Descriptions

The L298N module has multiple pins and terminals for motor control and power input. Below is a detailed description:

Power and Motor Terminals

Pin/Terminal Description
VCC Power supply for motors (5V to 35V).
GND Ground connection.
5V Regulated 5V output (used if the onboard regulator is active).
OUT1 Output for Motor 1 terminal 1.
OUT2 Output for Motor 1 terminal 2.
OUT3 Output for Motor 2 terminal 1.
OUT4 Output for Motor 2 terminal 2.

Control Pins

Pin Description
ENA Enable pin for Motor 1 (PWM input for speed control).
IN1 Control input 1 for Motor 1 (direction control).
IN2 Control input 2 for Motor 1 (direction control).
ENB Enable pin for Motor 2 (PWM input for speed control).
IN3 Control input 1 for Motor 2 (direction control).
IN4 Control input 2 for Motor 2 (direction control).

Usage Instructions

How to Use the L298N in a Circuit

  1. Power the Module: Connect the motor power supply to the VCC terminal and ground to the GND terminal. If the motor voltage exceeds 12V, ensure the onboard jumper for the 5V regulator is removed.
  2. Connect Motors: Attach the terminals of the DC motors to OUT1/OUT2 (Motor 1) and OUT3/OUT4 (Motor 2).
  3. Control Pins: Connect the control pins (IN1, IN2, IN3, IN4) to a microcontroller or other control circuit. Use ENA and ENB for speed control via PWM signals.
  4. Logic Power: If the onboard 5V regulator is used, the module can provide 5V to the control circuit via the 5V pin. Otherwise, supply 5V logic power externally.

Important Considerations

  • Heat Dissipation: The module includes a heat sink, but prolonged high-current operation may require additional cooling.
  • Voltage Compatibility: Ensure the motor voltage matches the specifications of the motors being used.
  • Current Limits: Do not exceed the 2A continuous current rating per channel to avoid damage.
  • Jumper Settings: The onboard jumper enables the 5V regulator. Remove it if using an external 5V logic supply.

Example: Controlling a DC Motor with Arduino UNO

Below is an example of how to control a single DC motor using the L298N and an Arduino UNO:

// Define control pins for Motor 1
const int IN1 = 9;  // Direction control pin 1
const int IN2 = 8;  // Direction control pin 2
const int ENA = 10; // Speed control (PWM) pin

void setup() {
  // Set motor control pins as outputs
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(ENA, OUTPUT);
}

void loop() {
  // Rotate motor forward at 50% speed
  digitalWrite(IN1, HIGH);  // Set direction
  digitalWrite(IN2, LOW);
  analogWrite(ENA, 128);    // Set speed (0-255)

  delay(2000); // Run for 2 seconds

  // Rotate motor backward at 75% speed
  digitalWrite(IN1, LOW);   // Reverse direction
  digitalWrite(IN2, HIGH);
  analogWrite(ENA, 192);    // Set speed (0-255)

  delay(2000); // Run for 2 seconds

  // Stop the motor
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, LOW);
  analogWrite(ENA, 0);      // Set speed to 0

  delay(2000); // Wait for 2 seconds before repeating
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Motors Not Running:

    • Verify power connections to VCC and GND.
    • Check if the ENA or ENB pins are enabled (HIGH or receiving a PWM signal).
    • Ensure the control pins (IN1, IN2, etc.) are correctly configured.
  2. Overheating:

    • Ensure the current drawn by the motors does not exceed 2A per channel.
    • Add external cooling if necessary for prolonged high-current operation.
  3. No 5V Output:

    • Check if the onboard jumper for the 5V regulator is in place.
    • If using an external 5V logic supply, ensure the jumper is removed.
  4. Erratic Motor Behavior:

    • Verify the PWM signals are within the correct range (0-255 for Arduino).
    • Check for loose or faulty connections.

FAQs

Q: Can I control stepper motors with the L298N?
A: Yes, the L298N can control a single stepper motor by using both H-bridge channels. You will need to configure the control pins appropriately for stepper motor operation.

Q: What happens if I exceed the current rating?
A: Exceeding the 2A continuous current rating may cause the module to overheat or fail. Use motors within the specified current limits.

Q: Can I use the L298N with a 3.3V microcontroller?
A: The L298N is designed for 5V logic levels. You may need level shifters to interface with a 3.3V microcontroller.

This concludes the documentation for the L298N Dual H-Bridge Motor Driver.