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

How to Use ln298: Examples, Pinouts, and Specs

Image of ln298
Cirkit Designer LogoDesign with ln298 in Cirkit Designer

Introduction

The LN298, manufactured by QWER (Part ID: QWD), is a dual H-bridge motor driver IC designed for controlling two DC motors or a single stepper motor. It enables bidirectional control of motors, making it an essential component in robotics, automation, and motor control applications. The LN298 is widely used due to its ability to handle high currents and voltages, as well as its compatibility with microcontrollers like Arduino.

Explore Projects Built with ln298

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Battery-Powered Line Following Robot with L298N Motor Driver and KY-033 Sensors
Image of obstacle-avoiding robot: A project utilizing ln298 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
WiFi-Controlled Basket-Carrying Robot with GPS and GSM Notification
Image of trash collecting vessel: A project utilizing ln298 in a practical application
This circuit is designed for a 4-wheeled WiFi-controlled car with a basket, which uses an ESP8266 NodeMCU microcontroller for logic control. It features an IR sensor for basket full detection, a GPS module for location tracking, and a GSM module (Sim800l) for sending SMS notifications. The L298N motor driver controls four DC gearmotors for movement, and the system is powered by a Li-ion battery with a 7805 voltage regulator providing stable power to the GSM module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Based Line Following Robot with L298N Motor Driver and IR Sensor Array
Image of RC_Car: A project utilizing ln298 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
Arduino UNO Controlled Robot with Bluetooth and Ultrasonic Sensor
Image of vhjv: A project utilizing ln298 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

Explore Projects Built with ln298

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 obstacle-avoiding robot: A project utilizing ln298 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 trash collecting vessel: A project utilizing ln298 in a practical application
WiFi-Controlled Basket-Carrying Robot with GPS and GSM Notification
This circuit is designed for a 4-wheeled WiFi-controlled car with a basket, which uses an ESP8266 NodeMCU microcontroller for logic control. It features an IR sensor for basket full detection, a GPS module for location tracking, and a GSM module (Sim800l) for sending SMS notifications. The L298N motor driver controls four DC gearmotors for movement, and the system is powered by a Li-ion battery with a 7805 voltage regulator providing stable power to the GSM module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of RC_Car: A project utilizing ln298 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 vhjv: A project utilizing ln298 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

Common Applications

  • Robotics (e.g., motorized robots, robotic arms)
  • Automation systems
  • Electric vehicles (small-scale prototypes)
  • Conveyor belts
  • Stepper motor control in CNC machines and 3D printers

Technical Specifications

The LN298 is a robust motor driver IC with the following key specifications:

Parameter Value
Supply Voltage (Vcc) 4.5V to 46V
Logic Voltage (Vss) 4.5V to 7V
Output Current (per channel) Up to 2A
Peak Output Current 3A (non-repetitive, per channel)
Power Dissipation 25W (with proper heat sinking)
Control Logic Levels TTL-compatible
Operating Temperature -25°C to +130°C

Pin Configuration and Descriptions

The LN298 comes in a 15-pin package. Below is the pinout and description:

Pin Number Pin Name Description
1 Enable A Enables H-bridge A (active HIGH)
2 Input 1 Logic input for H-bridge A (controls motor direction)
3 Output 1 Output for H-bridge A (connect to motor terminal)
4 Ground Ground connection
5 Ground Ground connection
6 Output 2 Output for H-bridge A (connect to motor terminal)
7 Input 2 Logic input for H-bridge A (controls motor direction)
8 Vcc (Motor) Supply voltage for motors (4.5V to 46V)
9 Enable B Enables H-bridge B (active HIGH)
10 Input 3 Logic input for H-bridge B (controls motor direction)
11 Output 3 Output for H-bridge B (connect to motor terminal)
12 Ground Ground connection
13 Ground Ground connection
14 Output 4 Output for H-bridge B (connect to motor terminal)
15 Input 4 Logic input for H-bridge B (controls motor direction)

Usage Instructions

Using the LN298 in a Circuit

  1. Power Connections:

    • Connect the motor power supply to the Vcc (Motor) pin (Pin 8). Ensure the voltage is within the range of 4.5V to 46V.
    • Connect the logic power supply (4.5V to 7V) to the Vss pin.
    • Connect all Ground pins (Pins 4, 5, 12, and 13) to the ground of the power supply.
  2. Motor Connections:

    • Connect the motor terminals to the Output pins (Pins 3 and 6 for Motor A, Pins 11 and 14 for Motor B).
  3. Control Logic:

    • Use the Input pins (Pins 2, 7 for Motor A; Pins 10, 15 for Motor B) to control the direction of the motors.
    • Set the Enable pins (Pins 1 and 9) HIGH to activate the respective H-bridge.
  4. Heat Management:

    • The LN298 can dissipate significant heat during operation. Attach a heat sink to the IC to prevent overheating.

Arduino Example Code

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

// Define motor control pins
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 motor control pins as outputs
  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);
  delay(2000);                  // Run motor for 2 seconds

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

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

Important Considerations

  • Ensure the motor's current and voltage ratings are within the LN298's specifications.
  • Use proper decoupling capacitors across the power supply to reduce noise.
  • Avoid exceeding the peak current rating (3A) to prevent damage to the IC.

Troubleshooting and FAQs

Common Issues

  1. Motor Not Running:

    • Check if the Enable pin is set HIGH.
    • Verify the power supply connections and ensure the voltage is within the specified range.
    • Confirm that the motor connections are correct.
  2. Overheating:

    • Ensure a heat sink is attached to the LN298.
    • Check if the motor's current exceeds the IC's maximum rating.
  3. Erratic Motor Behavior:

    • Verify the logic input signals are correct and stable.
    • Use decoupling capacitors to minimize electrical noise.

FAQs

Q: Can the LN298 drive stepper motors?
A: Yes, the LN298 can drive a stepper motor by controlling both H-bridges. You will need to sequence the inputs appropriately to achieve stepper motor rotation.

Q: What is the maximum motor voltage the LN298 can handle?
A: The LN298 can handle motor supply voltages up to 46V.

Q: Do I need external diodes for the LN298?
A: No, the LN298 has built-in flyback diodes to protect against voltage spikes caused by inductive loads like motors.

Q: Can I use the LN298 with a 3.3V microcontroller?
A: The LN298 requires logic levels of at least 4.5V. You may need a level shifter to interface it with a 3.3V microcontroller.