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

How to Use L298N: Examples, Pinouts, and Specs

Image of L298N
Cirkit Designer LogoDesign with L298N in Cirkit Designer

Introduction

The L298N is a dual H-bridge motor driver manufactured by Custon (Part ID: L298N). It is designed to control the direction and speed of DC motors and stepper motors. With the ability to drive two motors simultaneously and handle up to 2A per channel, the L298N is a versatile and reliable choice for robotics, automation, and other motor control applications.

Explore Projects Built with L298N

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino UNO Controlled Robot with Bluetooth and Ultrasonic Sensor
Image of vhjv: A project utilizing L298N in a practical application
This is a robotic control circuit featuring an Arduino UNO microcontroller that interfaces with two SG90 servo motors for movement, an HC-SR04 ultrasonic sensor for distance measurement, and an HC-05 Bluetooth module for wireless communication. The L298N motor driver is incorporated for potential motor control, and the system is powered through a standard power jack.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-CAM Controlled Surveillance Robot with Wi-Fi and Servo Pan/Tilt Mechanism
Image of sam: A project utilizing L298N in a practical application
This circuit is designed to control a mobile platform with four DC motors for movement, two servos for directional control, and an ESP32-CAM module for wireless video streaming. The L298N motor driver interfaces with the ESP32-CAM to drive the motors based on commands received over WiFi, allowing for remote directional control. The ESP32-CAM also handles the servo positioning and streams live video, enabling the user to control and monitor the platform remotely through a web interface.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Line Following Robot with ATmega328P and L298N Motor Driver
Image of Arduino-Controlled Line Following Robot with Dual DC Motors and L298N Driver: A project utilizing L298N in a practical application
This circuit is a line-following robot controller. It uses a Nano 3.0 ATmega328P microcontroller to read inputs from a line sensor and control two DC motors via an L298N motor driver. Power is supplied by a 9V battery regulated through an XL4015 DC buck converter.
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 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

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 vhjv: A project utilizing L298N in a practical application
Arduino UNO Controlled Robot with Bluetooth and Ultrasonic Sensor
This is a robotic control circuit featuring an Arduino UNO microcontroller that interfaces with two SG90 servo motors for movement, an HC-SR04 ultrasonic sensor for distance measurement, and an HC-05 Bluetooth module for wireless communication. The L298N motor driver is incorporated for potential motor control, and the system is powered through a standard power jack.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of sam: A project utilizing L298N in a practical application
ESP32-CAM Controlled Surveillance Robot with Wi-Fi and Servo Pan/Tilt Mechanism
This circuit is designed to control a mobile platform with four DC motors for movement, two servos for directional control, and an ESP32-CAM module for wireless video streaming. The L298N motor driver interfaces with the ESP32-CAM to drive the motors based on commands received over WiFi, allowing for remote directional control. The ESP32-CAM also handles the servo positioning and streams live video, enabling the user to control and monitor the platform remotely through a web interface.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Arduino-Controlled Line Following Robot with Dual DC Motors and L298N Driver: A project utilizing L298N in a practical application
Battery-Powered Line Following Robot with ATmega328P and L298N Motor Driver
This circuit is a line-following robot controller. It uses a Nano 3.0 ATmega328P microcontroller to read inputs from a line sensor and control two DC motors via an L298N motor driver. Power is supplied by a 9V battery regulated through an XL4015 DC buck converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of obstacle-avoiding robot: A project utilizing L298N 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 and automation systems
  • Remote-controlled vehicles
  • Conveyor belts and industrial machinery
  • DIY projects involving DC or stepper motors
  • Educational projects for learning motor control

Technical Specifications

Key Technical Details

Parameter Value
Manufacturer Custon
Part ID L298N
Operating Voltage 5V to 46V
Output Current (per channel) Up to 2A
Peak Output Current 3A (short duration)
Logic Voltage 5V
Power Dissipation 25W (with proper heat sink)
Control Logic Levels High: 2.3V to 5V, Low: 0V
Operating Temperature -25°C to +130°C
Motor Types Supported DC motors, stepper motors

Pin Configuration and Descriptions

The L298N module typically includes the following pins for interfacing:

Power and Motor Connections

Pin Name Description
VCC Power supply for motors (5V to 46V).
GND Ground connection.
5V Logic voltage output (used to power external logic circuits if needed).
OUT1 Output 1 for Motor A.
OUT2 Output 2 for Motor A.
OUT3 Output 3 for Motor B.
OUT4 Output 4 for Motor B.

Control Pins

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

Usage Instructions

How to Use the L298N in a Circuit

  1. Power the Module: Connect the VCC pin to the motor power supply (5V to 46V) and the GND pin to the ground of your circuit.
  2. Connect Motors: Attach the motor wires to the output pins (OUT1, OUT2 for Motor A and OUT3, OUT4 for Motor B).
  3. Control Logic: Use the IN1, IN2, IN3, and IN4 pins to control the direction of the motors. Apply a PWM signal to the ENA and ENB pins to control motor speed.
  4. Logic Voltage: If your microcontroller operates at 5V logic, you can use the 5V pin on the module to power it.

Important Considerations

  • Heat Dissipation: The L298N can dissipate up to 25W of power. Use a heat sink or cooling fan to prevent overheating during high-current operation.
  • Current Limitations: Ensure that the motors do not draw more than 2A per channel continuously to avoid damaging the module.
  • Power Supply: Use a power supply that matches the voltage and current requirements of your motors.

Example: Connecting to an Arduino UNO

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

// Define control pins for Motor A
const int ENA = 9;  // PWM pin for speed control
const int IN1 = 8;  // Direction control pin 1
const int IN2 = 7;  // Direction control pin 2

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

void loop() {
  // Rotate motor forward
  digitalWrite(IN1, HIGH);  // Set IN1 high
  digitalWrite(IN2, LOW);   // Set IN2 low
  analogWrite(ENA, 150);    // Set speed (0-255)

  delay(2000);              // Run for 2 seconds

  // Rotate motor backward
  digitalWrite(IN1, LOW);   // Set IN1 low
  digitalWrite(IN2, HIGH);  // Set IN2 high
  analogWrite(ENA, 150);    // Set speed (0-255)

  delay(2000);              // Run for 2 seconds

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

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

Troubleshooting and FAQs

Common Issues

  1. Motors Not Running:

    • Ensure the power supply voltage matches the motor's requirements.
    • Verify that the ENA and ENB pins are receiving a valid PWM signal.
    • Check the wiring of the control and motor output pins.
  2. Overheating:

    • Use a heat sink or cooling fan to dissipate heat.
    • Ensure the motors do not exceed the 2A continuous current limit.
  3. Erratic Motor Behavior:

    • Check for loose connections or faulty wiring.
    • Ensure the control logic signals are stable and within the specified voltage range.

FAQs

Q: Can the L298N drive stepper motors?
A: Yes, the L298N can drive stepper motors by controlling the sequence of the IN1, IN2, IN3, and IN4 pins.

Q: Can I use the L298N with a 3.3V microcontroller?
A: The L298N requires a minimum logic high voltage of 2.3V, so it is compatible with 3.3V microcontrollers. However, ensure proper interfacing to avoid voltage mismatches.

Q: What is the maximum motor voltage supported?
A: The L298N supports motor voltages up to 46V. Ensure your power supply does not exceed this limit.