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 high-power dual H-bridge motor driver integrated circuit (IC) designed to control the speed and direction of DC motors and stepper motors. It is capable of driving two DC motors simultaneously in either direction or one stepper motor in both bipolar and unipolar configurations. The L298 is widely used in robotics, CNC machines, and other applications where precise motor control is required.

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 LFR: 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 LFR: 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 and Use Cases

  • Robotics: Driving wheels or tracks
  • CNC machines: Controlling stepper motors for precise movements
  • Home automation: Operating blinds, curtains, or other motorized fixtures
  • Hobby projects: Remote-controlled vehicles, drones, etc.

Technical Specifications

Key Technical Details

  • Operating Voltage (V_S): Up to 46V
  • Logic Voltage (V_SS): 4.5V to 7V
  • Peak Output Current (I_O): 2A per channel
  • Total Power Dissipation (T_PD): 25W (at T_C = 75°C)

Pin Configuration and Descriptions

Pin Number Pin Name Description
1 Vs Supply voltage for the H-bridge output stages (Power input)
2 GND Ground
3 Vss Supply voltage for the logic circuitry (Logic power input)
4 Out 1 Output to motor channel A (Output 1)
5 Out 2 Output to motor channel A (Output 2)
6 Vs Sense voltage for channel A (Current sensing)
7 In 1 Input 1 for channel A (Logic input)
8 In 2 Input 2 for channel A (Logic input)
... ... ...
15 In 3 Input 1 for channel B (Logic input)
16 In 4 Input 2 for channel B (Logic input)
17 Sense B Sense voltage for channel B (Current sensing)
18 Out 3 Output to motor channel B (Output 3)
19 Out 4 Output to motor channel B (Output 4)
20 GND Ground

Usage Instructions

How to Use the Component in a Circuit

  1. Connect the motor supply voltage (up to 46V) to pin 1 (Vs).
  2. Connect the ground of the power supply to pin 2 (GND).
  3. Apply the logic supply voltage (4.5V to 7V) to pin 3 (Vss).
  4. Connect the outputs (Out 1, Out 2, Out 3, Out 4) to the motors.
  5. Use the input pins (In 1, In 2, In 3, In 4) to control the motor direction and speed.
  6. Optionally, connect a sense resistor to pins 6 (Vs) and 17 (Sense B) for current sensing.

Important Considerations and Best Practices

  • Ensure that the power supply can handle the current requirements of the motors.
  • Use appropriate heat sinking for the L298 IC to prevent thermal shutdown or damage.
  • Implement flyback diodes across the motor terminals to protect the L298 from voltage spikes.
  • Avoid running the IC at its maximum ratings for extended periods to ensure reliability.

Example Code for Arduino UNO

// Define the L298N control pins
#define IN1 2
#define IN2 3
#define IN3 4
#define IN4 5

void setup() {
  // Set all the control pins as outputs
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
}

void loop() {
  // Spin motor A clockwise
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  // Spin motor B counterclockwise
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, HIGH);
  delay(2000); // Run motors for 2 seconds

  // Stop both motors
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, LOW);
  delay(1000); // Wait for 1 second

  // Add more control logic as needed for your application
}

Troubleshooting and FAQs

Common Issues Users Might Face

  • Motor not running: Check power supply connections, ensure that the logic inputs are correctly set, and verify that the motor is functional.
  • Overheating: Ensure proper heat sinking and current limits are not exceeded.
  • Inconsistent motor behavior: Check for loose connections and ensure that the input signals are clean and without noise.

Solutions and Tips for Troubleshooting

  • Use a multimeter to check for proper voltage levels at the power and logic inputs.
  • If using PWM to control motor speed, ensure that the frequency is within the IC's operating range.
  • Double-check the wiring against the pin configuration table to ensure all connections are correct.

FAQs

Q: Can the L298 drive two motors independently? A: Yes, the L298 can control two DC motors independently with separate input controls for each channel.

Q: What is the maximum current the L298 can handle? A: The L298 can handle peak currents of up to 2A per channel.

Q: Do I need to use current sensing? A: Current sensing is optional but recommended if you need to monitor or limit the current to the motors.

Q: Can I use the L298 to drive a bipolar stepper motor? A: Yes, the L298 can be used to drive a bipolar stepper motor by appropriately energizing the coils in sequence.