Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Motors & Actuators

L298N Motor Driver: Complete Guide for DC Motors and Steppers

L298N Motor Driver: Complete Guide for DC Motors and Steppers

April 1, 2026 /Posted by / 0

The L298N motor driver is one of the most widely used motor driver modules in the Arduino and robotics community. This dual H-bridge module can control two DC motors or one stepper motor, making it the go-to choice for robot cars, automated systems, and motor-based projects. In this complete guide, we cover the L298N’s working principle, wiring for DC motors and steppers, PWM speed control, and practical tips for managing heat.

Table of Contents

  • What Is the L298N Module?
  • How an H-Bridge Works
  • L298N Module Pinout
  • Wiring DC Motors with L298N
  • PWM Speed Control
  • Driving a Stepper Motor
  • Heat Management and Efficiency
  • Frequently Asked Questions

What Is the L298N Module?

The L298N is a dual full-bridge driver IC designed by STMicroelectronics. The breakout module includes the IC, heatsink, power terminal blocks, header pins, and a voltage regulator. It can drive motors with voltages from 5V to 35V and handle up to 2A continuous current per channel (3A peak).

Key features:

  • Two independent H-bridge channels (Motor A and Motor B)
  • Direction control for each channel via two input pins
  • Speed control via PWM on enable pins
  • Built-in 5V regulator (when input voltage is 7-12V)
  • On-board heatsink for the L298N IC
  • Flyback diodes for motor back-EMF protection
🛒 Recommended: L298N Dual H-Bridge DC/Stepper Motor Driver Module — The classic motor driver module with screw terminals, heatsink, and 5V regulator. Works with Arduino, ESP32, and Raspberry Pi.

How an H-Bridge Works

An H-bridge is a circuit arrangement of four transistors (or MOSFETs) that allows current to flow through a motor in either direction. The name comes from the H-shaped schematic:

  • Four switches arranged in an H pattern with the motor in the crossbar
  • Turning on the top-left and bottom-right switches drives current in one direction (forward)
  • Turning on the top-right and bottom-left switches reverses current (reverse)
  • Turning on both top or both bottom switches creates a short circuit (AVOID)
  • Turning off all switches lets the motor coast to a stop
  • Turning on both switches on one side creates a brake (motor stops quickly)

The L298N has two complete H-bridges, so it can independently control two motors’ speed and direction.

L298N Module Pinout

Pin/Terminal Function Connection
+12V (VMS) Motor power supply (5-35V) Battery/power supply positive
GND Common ground Battery negative AND Arduino GND
+5V 5V output (when jumper is on) Can power Arduino (or input 5V if jumper removed)
ENA Enable Motor A (PWM) Arduino PWM pin (or jumper for full speed)
IN1 Motor A direction input 1 Arduino digital pin
IN2 Motor A direction input 2 Arduino digital pin
IN3 Motor B direction input 1 Arduino digital pin
IN4 Motor B direction input 2 Arduino digital pin
ENB Enable Motor B (PWM) Arduino PWM pin (or jumper for full speed)
OUT1, OUT2 Motor A output Motor A terminals
OUT3, OUT4 Motor B output Motor B terminals

Wiring DC Motors with L298N

Components Required

  • Arduino Uno
  • L298N motor driver module
  • Two DC motors (e.g., BO motors)
  • Battery pack (7.4V-12V)
  • Jumper wires

Wiring Connections

Power:

  • Battery positive → L298N +12V terminal
  • Battery negative → L298N GND terminal
  • L298N GND → Arduino GND (common ground is essential)
  • Keep the 5V jumper on to use L298N’s regulator to power Arduino via 5V pin

Motor A (Left):

  • L298N ENA → Arduino pin 9 (PWM)
  • L298N IN1 → Arduino pin 8
  • L298N IN2 → Arduino pin 7
  • Motor A wires → L298N OUT1 and OUT2

Motor B (Right):

  • L298N ENB → Arduino pin 10 (PWM)
  • L298N IN3 → Arduino pin 5
  • L298N IN4 → Arduino pin 4
  • Motor B wires → L298N OUT3 and OUT4
🛒 Recommended: 100 RPM BO Motor (Straight) — Reliable BO motor for robot car projects, pairs perfectly with the L298N driver and standard 65mm robot wheels.

PWM Speed Control

The L298N’s enable pins (ENA, ENB) control motor speed through PWM (Pulse Width Modulation). Remove the jumper caps from ENA/ENB and connect them to Arduino PWM pins.

Direction Control Truth Table

IN1 IN2 Motor Action
HIGH LOW Forward
LOW HIGH Reverse
LOW LOW Coast (free spin)
HIGH HIGH Brake (quick stop)

Arduino Robot Car Code


// L298N Motor Driver - Robot Car Control
// Motor A (Left)
const int ENA = 9;
const int IN1 = 8;
const int IN2 = 7;
// Motor B (Right)
const int ENB = 10;
const int IN3 = 5;
const int IN4 = 4;

void setup() {
  pinMode(ENA, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(ENB, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
}

void moveForward(int speed) {
  analogWrite(ENA, speed);
  analogWrite(ENB, speed);
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
}

void moveBackward(int speed) {
  analogWrite(ENA, speed);
  analogWrite(ENB, speed);
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, HIGH);
}

void turnLeft(int speed) {
  analogWrite(ENA, speed / 2);
  analogWrite(ENB, speed);
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
}

void turnRight(int speed) {
  analogWrite(ENA, speed);
  analogWrite(ENB, speed / 2);
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
}

void stopMotors() {
  analogWrite(ENA, 0);
  analogWrite(ENB, 0);
}

void loop() {
  moveForward(200);   // 0-255 speed
  delay(2000);
  turnRight(200);
  delay(1000);
  moveForward(200);
  delay(2000);
  turnLeft(200);
  delay(1000);
  moveBackward(150);
  delay(2000);
  stopMotors();
  delay(3000);
}
🛒 Recommended: 65mm Robot Smart Car Wheel (Yellow) — Standard robot car wheel that fits directly onto BO motor shafts. Available in multiple colours.

Driving a Stepper Motor with L298N

The L298N can drive a bipolar stepper motor (like the NEMA 17) using both H-bridges. Each H-bridge controls one coil of the stepper motor.

Wiring:

  • Stepper coil A → OUT1 and OUT2
  • Stepper coil B → OUT3 and OUT4
  • Remove jumpers from ENA and ENB, connect both to Arduino 5V (always enabled)
  • IN1, IN2 control coil A; IN3, IN4 control coil B

Stepper Motor Code


#include <Stepper.h>

const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 8, 7, 5, 4);

void setup() {
  myStepper.setSpeed(60);  // 60 RPM
  Serial.begin(9600);
}

void loop() {
  Serial.println("Clockwise");
  myStepper.step(stepsPerRevolution);
  delay(500);
  Serial.println("Counter-clockwise");
  myStepper.step(-stepsPerRevolution);
  delay(500);
}
🛒 Recommended: 4-Wheel Car Chassis Acrylic Frame — Ready-made robot car platform with motor mounts, battery compartment, and space for sensors. Pair it with L298N and BO motors.

Heat Management and Efficiency

The L298N has a significant voltage drop across its internal transistors — typically 1.4-3V. This means if you supply 12V, the motor only receives about 9-10.6V. This wasted energy is converted to heat.

Tips for managing heat:

  • The onboard heatsink handles normal loads, but add airflow for continuous high-current operation.
  • For loads above 1.5A per motor, consider upgrading to a MOSFET-based driver (like the BTS7960 or TB6612FNG) which has much lower voltage drop.
  • Use a higher voltage battery to compensate for the voltage drop if your motor needs a specific voltage.
  • In hot Indian summers, ensure adequate ventilation around the driver module.

Frequently Asked Questions

Can the L298N handle 12V motors?

Yes, but remember the 1.4-3V voltage drop. A 12V motor on a 12V supply will only receive about 9-10.6V. Use a 14.8V (4S LiPo) or higher supply if you need the full 12V at the motor terminals.

Why is my L298N getting very hot?

The L298N uses BJT transistors which have inherent voltage drop (unlike MOSFETs). This is normal under high current loads. If the IC gets too hot to touch (above 70°C), reduce the current load, add a fan, or upgrade to a MOSFET-based driver like the BTS7960.

L298N vs L293D: Which should I use?

The L293D handles up to 600mA (1.2A peak) per channel and is suitable for small motors. The L298N handles up to 2A (3A peak) per channel. Use L293D for small BO motors and L298N for larger motors or when you need more current.

Can I drive 4 motors with one L298N?

No. The L298N has two channels. To drive four motors, you need two L298N modules. Alternatively, wire two motors in parallel per channel if they are identical motors that should move together (like tank drive).

Do I need to connect Arduino GND to L298N GND?

Yes, absolutely. The Arduino and L298N must share a common ground for the logic signals to work correctly. This is the most common mistake beginners make.

Conclusion

The L298N motor driver module is an affordable and versatile solution for controlling DC motors and stepper motors with Arduino. While it has limitations (voltage drop, heat), it remains the best starting point for robotics projects. As your projects grow more demanding, you can upgrade to more efficient drivers like the TB6612FNG or BTS7960.

Shop the L298N and other motor drivers at Zbotic.in and start building your next robot today.

Tags: Arduino, DC motor, H-bridge, L298N, motor driver
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
PCB Assembly Services in India...
blog pcb assembly services in india pcba complete guide 612446
blog multimeter buying guide india best options under %e2%82%b95000 612451
Multimeter Buying Guide India:...

Related posts

Svg%3E
Read more

Gear Motor Guide: N20, JGB37, and Planetary Motors Compared

April 1, 2026 0
When your project needs more torque than a bare DC motor can provide, a gear motor is the answer. By... Continue reading
Svg%3E
Read more

Miniature Pump Hydroponics: Automated Nutrient Dosing System

April 1, 2026 0
Hydroponics grows plants in nutrient-rich water instead of soil, and automating the nutrient dosing process with peristaltic pumps and Arduino... Continue reading
Svg%3E
Read more

Drone Motor Testing: Thrust Stand Build and KV Measurement

April 1, 2026 0
If you are building a drone, selecting the right motor-propeller combination is critical for flight performance. A drone motor thrust... Continue reading
Svg%3E
Read more

Pump Selection Guide: Peristaltic, Submersible, and Diaphragm

April 1, 2026 0
When your Arduino project needs to move liquid — whether for automated plant watering, hydroponics, aquarium management, or a coffee... Continue reading
Svg%3E
Read more

Solenoid Guide: Door Locks, Valves, and Automation Projects

April 1, 2026 0
A solenoid is an electromechanical device that converts electrical energy into linear motion. When you energise the coil, a plunger... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now