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., controlling wheels or robotic arms)
  • Automation systems
  • CNC machines
  • 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 Low: 0V, High: 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 Input 1 Logic input to control Motor A (High/Low).
6 Input 2 Logic input to control Motor A (High/Low).
7 Enable A Enable pin for Motor A (High to enable, Low to disable).
8 Ground Common ground for logic and motor power.
9 Ground Common ground for logic and motor power.
10 Enable B Enable pin for Motor B (High to enable, Low to disable).
11 Input 3 Logic input to control Motor B (High/Low).
12 Input 4 Logic input to control Motor B (High/Low).
13 VSS Logic supply voltage (typically 5V).
14 Output 3 Output pin for Motor B (connect to one terminal of the motor).
15 Output 4 Output pin for Motor B (connect to the other terminal of the motor).

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 for the control logic.
    • Connect the ground pins (8 and 9) to the common ground of the circuit.
  2. Motor Connections:

    • For Motor A, connect its terminals to Output 1 and Output 2.
    • For Motor B, connect its terminals to Output 3 and Output 4.
  3. Control Logic:

    • Use the Input pins (1, 2 for Motor A; 3, 4 for Motor B) to control the direction of the motors.
    • Use the Enable pins (7 for Motor A; 10 for Motor B) to enable or disable the motors.
  4. Current Sensing (Optional):

    • Connect a resistor between the Current Sense pins (1 for Motor A; 15 for Motor B) and ground to monitor the current.

Example: Connecting L298 to an Arduino UNO

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

Circuit Connections:

  • Connect Enable A to Arduino pin 9.
  • Connect Input 1 to Arduino pin 8.
  • Connect Input 2 to Arduino pin 7.
  • Connect the motor terminals to Output 1 and Output 2.
  • Connect the motor power supply to VSS and ground.

Arduino Code:

// Define pins for L298 connections
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 LOW
  digitalWrite(input2, LOW);   // Set direction to LOW
}

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
}

Important Considerations:

  • Use a heat sink with the L298 to prevent overheating during high current operation.
  • Ensure the motor power supply voltage matches the motor's specifications.
  • Avoid exceeding the maximum current rating (2A per channel) to prevent damage.

Troubleshooting and FAQs

Common Issues and Solutions:

  1. Motor Not Running:

    • Check if the Enable pin is set to HIGH.
    • Verify the power supply connections and ensure sufficient voltage is provided.
  2. Overheating:

    • Attach a heat sink to the L298 IC.
    • Reduce the motor load or use a motor with lower current requirements.
  3. Erratic Motor Behavior:

    • Ensure proper grounding of the circuit.
    • Check for loose connections or damaged wires.
  4. Arduino Not Controlling the Motor:

    • Verify the Arduino pin connections to the L298.
    • Ensure the logic voltage (5V) is supplied to the L298.

FAQs:

Q: Can the L298 drive stepper motors?
A: Yes, the L298 can drive stepper motors by controlling the sequence of inputs to the H-bridges.

Q: What is the purpose of the Current Sense pins?
A: The Current Sense pins allow you to monitor the current flowing through each motor channel by connecting a resistor and measuring the voltage drop.

Q: Can I use the L298 without a heat sink?
A: While it is possible for low-current applications, a heat sink is recommended for high-current loads to prevent overheating.

Q: What is the maximum voltage the L298 can handle?
A: The L298 can handle up to 46V for the motor power supply.