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

How to Use l298n v3.1: Examples, Pinouts, and Specs

Image of l298n v3.1
Cirkit Designer LogoDesign with l298n v3.1 in Cirkit Designer

Introduction

The L298N V3.1 is a dual H-bridge motor driver module designed to control the direction and speed of DC motors and stepper motors. Manufactured by ur mom with the part ID uru mom, this versatile component is widely used in robotics, automation, and DIY electronics projects. It can drive two motors simultaneously, with each channel capable of handling up to 2A of current. The module is ideal for applications requiring precise motor control, such as robotic arms, wheeled robots, and conveyor systems.

Explore Projects Built with l298n v3.1

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
WiFi-Controlled Basket-Carrying Robot with GPS and GSM Notification
Image of trash collecting vessel: A project utilizing l298n v3.1 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
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 v3.1 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 Robotic Vehicle with STM32 and L298N Motor Driver
Image of LINE FOLLOWER: A project utilizing l298n v3.1 in a practical application
This circuit is a motor control system that uses an STM32F103C8T6 microcontroller to control two DC motors via an L298N motor driver. The system also includes two IR sensors for obstacle detection, powered by a 18650 Li-ion battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Based Obstacle Avoiding Robot with Ultrasonic Sensor and L298N Motor Driver
Image of car: A project utilizing l298n v3.1 in a practical application
This circuit is a robotic vehicle control system that uses an Arduino Sensor Shield to interface with various sensors and actuators, including an ultrasonic sensor for obstacle detection, a GPS module for location tracking, a compass for direction sensing, and an HC-05 Bluetooth module for wireless communication. The L298N motor driver controls four DC motors for movement, and a servo motor is used for additional mechanical control. The system is powered by a combination of a solar panel and a Li-ion battery pack, with voltage regulation provided by an XL6009 module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with l298n v3.1

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 trash collecting vessel: A project utilizing l298n v3.1 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 Arduino-Controlled Line Following Robot with Dual DC Motors and L298N Driver: A project utilizing l298n v3.1 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 LINE FOLLOWER: A project utilizing l298n v3.1 in a practical application
Battery-Powered Robotic Vehicle with STM32 and L298N Motor Driver
This circuit is a motor control system that uses an STM32F103C8T6 microcontroller to control two DC motors via an L298N motor driver. The system also includes two IR sensors for obstacle detection, powered by a 18650 Li-ion battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of car: A project utilizing l298n v3.1 in a practical application
Arduino-Based Obstacle Avoiding Robot with Ultrasonic Sensor and L298N Motor Driver
This circuit is a robotic vehicle control system that uses an Arduino Sensor Shield to interface with various sensors and actuators, including an ultrasonic sensor for obstacle detection, a GPS module for location tracking, a compass for direction sensing, and an HC-05 Bluetooth module for wireless communication. The L298N motor driver controls four DC motors for movement, and a servo motor is used for additional mechanical control. The system is powered by a combination of a solar panel and a Li-ion battery pack, with voltage regulation provided by an XL6009 module.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Robotics (e.g., controlling wheels or robotic arms)
  • Automation systems
  • DIY motorized projects
  • Stepper motor control for CNC machines or 3D printers
  • Educational electronics projects

Technical Specifications

The L298N V3.1 module is built to provide reliable motor control with the following specifications:

Parameter Value
Operating Voltage 5V to 35V
Output Current (per channel) 2A (maximum)
Peak Current (per channel) 3A (short duration)
Logic Voltage 5V
Logic Current 0-36mA
Control Signal Voltage 4.5V to 7V (high level)
Power Dissipation 25W (maximum)
Dimensions 43mm x 43mm x 27mm
Weight ~30g

Pin Configuration and Descriptions

The L298N V3.1 module has several pins and terminals for motor control and power input. Below is a detailed description:

Power and Motor Terminals

Pin/Terminal Description
VCC Power supply for motors (5V to 35V).
GND Ground connection.
5V Logic voltage output (used to power external logic).
OUT1 Output for Motor A (positive terminal).
OUT2 Output for Motor A (negative terminal).
OUT3 Output for Motor B (positive terminal).
OUT4 Output for Motor B (negative terminal).

Control Pins

Pin Description
ENA Enable pin for Motor A. High to enable, low to disable.
IN1 Control input 1 for Motor A.
IN2 Control input 2 for Motor A.
ENB Enable pin for Motor B. High to enable, low to disable.
IN3 Control input 1 for Motor B.
IN4 Control input 2 for Motor B.

Usage Instructions

How to Use the L298N V3.1 in a Circuit

  1. Power the Module: Connect the VCC pin to a power source (5V to 35V) and the GND pin to ground. If your motor voltage is below 12V, you can use the onboard 5V regulator to power the logic circuit by connecting the 5V pin to your microcontroller.
  2. Connect the Motors: Attach the motor terminals to OUT1/OUT2 (Motor A) and OUT3/OUT4 (Motor B).
  3. Control Signals: Use the IN1, IN2, IN3, and IN4 pins to control the direction of the motors. Use ENA and ENB to enable or disable the motors.
  4. Logic Voltage: Ensure the control signals are within the logic voltage range (4.5V to 7V).

Example: Connecting to an Arduino UNO

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

Circuit Connections

  • Connect the L298N V3.1's VCC to a 12V power supply and GND to ground.
  • Connect the motor terminals to OUT1 and OUT2.
  • Connect ENA to Arduino pin 9, IN1 to pin 8, and IN2 to pin 7.
  • Connect the Arduino's GND to the L298N's GND.

Arduino Code

// Define control pins for Motor A
#define ENA 9  // Enable pin for Motor A
#define IN1 8  // Input 1 for Motor A
#define IN2 7  // Input 2 for Motor A

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

  // Initialize motor in stopped state
  digitalWrite(ENA, LOW);  // Disable motor
  digitalWrite(IN1, LOW);  // Set IN1 low
  digitalWrite(IN2, LOW);  // Set IN2 low
}

void loop() {
  // Example: Rotate motor forward
  digitalWrite(ENA, HIGH);  // Enable motor
  digitalWrite(IN1, HIGH);  // Set IN1 high
  digitalWrite(IN2, LOW);   // Set IN2 low
  delay(2000);              // Run motor for 2 seconds

  // Example: Rotate motor backward
  digitalWrite(IN1, LOW);   // Set IN1 low
  digitalWrite(IN2, HIGH);  // Set IN2 high
  delay(2000);              // Run motor for 2 seconds

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

Important Considerations

  • Heat Dissipation: The L298N V3.1 can get hot during operation. Use a heat sink or active cooling for high-current applications.
  • Power Supply: Ensure the power supply voltage matches the motor's requirements.
  • Current Limits: Do not exceed the 2A continuous current rating per channel to avoid damage.

Troubleshooting and FAQs

Common Issues

  1. Motors Not Running:

    • Check if the ENA/ENB pins are set to HIGH.
    • Verify the power supply voltage and connections.
    • Ensure the control signals (IN1, IN2, etc.) are correctly configured.
  2. Overheating:

    • Ensure the current draw of the motors does not exceed 2A per channel.
    • Use a heat sink or fan for cooling.
  3. Erratic Motor Behavior:

    • Check for loose connections or faulty wiring.
    • Verify that the power supply is stable and within the specified range.

FAQs

Q: Can the L298N V3.1 drive stepper motors?
A: Yes, the module can control stepper motors by using both H-bridges. You will need to sequence the control signals appropriately.

Q: Can I use the onboard 5V regulator to power my Arduino?
A: Yes, if the input voltage to the L298N is above 7V, the onboard 5V regulator can provide power to your Arduino via the 5V pin.

Q: What happens if I exceed the current rating?
A: Exceeding the 2A continuous current rating can cause the module to overheat or become damaged. Use motors within the specified current limits.

Q: Can I control the speed of the motors?
A: Yes, you can use PWM (Pulse Width Modulation) signals on the ENA and ENB pins to control motor speed.