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

How to Use L298: Examples, Pinouts, and Specs

Image of L298
Cirkit Designer LogoDesign with L298 in Cirkit Designer

Introduction

The L298 is a dual H-bridge motor driver IC designed to control the direction and speed of DC motors and stepper motors. It is capable of driving two motors simultaneously, making it a versatile choice for robotics, automation, and other motor control applications. With its ability to handle high current loads, the L298 is widely used in projects requiring precise motor control, such as robotic arms, conveyor belts, and automated vehicles.

Explore Projects Built with L298

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-Based Line Following Robot with L298N Motor Driver and IR Sensor Array
Image of RC_Car: A project utilizing L298 in a practical application
This circuit is a line-following robot that uses an Arduino Expansion Board to control two DC motors via an L298N motor driver. The robot uses a 5-channel IR sensor array to detect the line and adjust the motor speeds accordingly, powered by a 2200mAH LiPo battery and controlled through a PID algorithm implemented in the Arduino code.
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 L298 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
Arduino UNO Controlled Robot with Bluetooth and Ultrasonic Sensor
Image of vhjv: A project utilizing L298 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 L298 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

Explore Projects Built with L298

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 RC_Car: A project utilizing L298 in a practical application
Arduino-Based Line Following Robot with L298N Motor Driver and IR Sensor Array
This circuit is a line-following robot that uses an Arduino Expansion Board to control two DC motors via an L298N motor driver. The robot uses a 5-channel IR sensor array to detect the line and adjust the motor speeds accordingly, powered by a 2200mAH LiPo battery and controlled through a PID algorithm implemented in the Arduino code.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of obstacle-avoiding robot: A project utilizing L298 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
Image of vhjv: A project utilizing L298 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 L298 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

Common Applications:

  • Robotics (e.g., motorized robots, robotic arms)
  • Automation systems
  • Conveyor belts
  • Stepper motor control
  • DIY motorized projects

Technical Specifications

Below are the key technical details of the L298 motor driver IC:

Parameter Value
Operating Voltage 4.5V to 46V
Maximum Output Current 2A per channel (continuous)
Peak Output Current 3A per channel (non-repetitive)
Logic Voltage 5V
Power Dissipation 25W (with proper heat sinking)
Control Logic Levels High: 2.3V to Vss, Low: -0.3V to 1.5V
Operating Temperature -25°C to +130°C
Motor Types Supported DC motors, stepper motors

Pin Configuration and Descriptions

The L298 IC comes in a 15-pin Multiwatt package. Below is the pin configuration:

Pin Number Pin Name Description
1 Current Sense A Connect to ground via a resistor to monitor current for Motor A.
2 Output 1 Output pin for Motor A (connect to one terminal of the motor).
3 Output 2 Output pin for Motor A (connect to the other terminal of the motor).
4 Vss Logic supply voltage (typically 5V).
5 Enable A Enables or disables Motor A (High to enable, Low to disable).
6 Input 1 Logic input to control Motor A direction (works with Input 2).
7 Input 2 Logic input to control Motor A direction (works with Input 1).
8 Ground Common ground for logic and motor power.
9 Ground Common ground for logic and motor power.
10 Input 3 Logic input to control Motor B direction (works with Input 4).
11 Input 4 Logic input to control Motor B direction (works with Input 3).
12 Enable B Enables or disables Motor B (High to enable, Low to disable).
13 Output 3 Output pin for Motor B (connect to one terminal of the motor).
14 Output 4 Output pin for Motor B (connect to the other terminal of the motor).
15 Current Sense B Connect to ground via a resistor to monitor current for Motor B.

Usage Instructions

How to Use the L298 in a Circuit

  1. Power Connections:

    • Connect the motor power supply (4.5V to 46V) to the Vss pin.
    • Connect the logic power supply (5V) to the Vss pin.
    • Connect the ground pins (8 and 9) to the common ground of the circuit.
  2. Motor Connections:

    • Connect the motor terminals to the output pins (Output 1 and Output 2 for Motor A, Output 3 and Output 4 for Motor B).
  3. Control Logic:

    • Use the Input pins to control the direction of the motors:
      • For Motor A: Use Input 1 and Input 2.
      • For Motor B: Use Input 3 and Input 4.
    • Use the Enable pins to enable or disable the motors:
      • For Motor A: Use Enable A.
      • For Motor B: Use Enable B.
  4. Current Sensing:

    • Optionally, connect a resistor between the Current Sense pins and ground to monitor the current drawn by the motors.

Important Considerations:

  • Use a heat sink with the L298 IC to prevent overheating during high current operation.
  • Ensure the motor power supply voltage matches the motor's rated voltage.
  • Use external diodes for flyback protection if the motors generate significant back EMF.

Example: Controlling a DC Motor with Arduino UNO

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

// Define L298 pins connected to Arduino
const int enableA = 9;  // Enable pin for Motor A
const int input1 = 8;   // Input 1 for Motor A
const int input2 = 7;   // Input 2 for Motor A

void setup() {
  // Set pin modes
  pinMode(enableA, OUTPUT);
  pinMode(input1, OUTPUT);
  pinMode(input2, OUTPUT);

  // Initialize motor in stopped state
  digitalWrite(enableA, LOW);  // Disable motor
  digitalWrite(input1, LOW);  // Set direction to neutral
  digitalWrite(input2, LOW);  // Set direction to neutral
}

void loop() {
  // Example: Rotate motor forward
  digitalWrite(enableA, HIGH);  // Enable motor
  digitalWrite(input1, HIGH);   // Set direction forward
  digitalWrite(input2, LOW);    // Set direction forward
  delay(2000);                  // Run motor for 2 seconds

  // Example: Rotate motor backward
  digitalWrite(input1, LOW);    // Set direction backward
  digitalWrite(input2, HIGH);   // Set direction backward
  delay(2000);                  // Run motor for 2 seconds

  // Stop motor
  digitalWrite(enableA, LOW);   // Disable motor
  delay(2000);                  // Wait for 2 seconds
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. Motor Not Running:

    • Cause: The Enable pin is not set to HIGH.
    • Solution: Ensure the Enable pin is connected to a HIGH signal.
  2. Motor Running in the Wrong Direction:

    • Cause: Incorrect logic levels on the Input pins.
    • Solution: Swap the logic levels on the Input pins to reverse the motor direction.
  3. Overheating:

    • Cause: High current draw or insufficient heat dissipation.
    • Solution: Use a heat sink and ensure the motor's current rating is within the L298's limits.
  4. No Output Voltage:

    • Cause: Incorrect power supply connections.
    • Solution: Verify that the motor power supply and logic power supply are connected properly.

FAQs

  • Can the L298 drive stepper motors? Yes, the L298 can drive stepper motors by controlling the sequence of the Input pins.

  • Do I need external diodes with the L298? While the L298 has internal diodes, external diodes are recommended for motors with high back EMF.

  • What is the maximum current the L298 can handle? The L298 can handle up to 2A per channel continuously and 3A peak (non-repetitive).