The L298N Dual H-Bridge Motor Driver, manufactured by Handson Technology (Part ID: Motor Driver), is a versatile and robust motor driver module. It is designed to control the direction and speed of two DC motors or one stepper motor using Pulse Width Modulation (PWM) signals. The module is capable of handling up to 2A per channel and operates with a supply voltage range of 5V to 35V, making it suitable for a wide range of motor control applications.
Explore Projects Built with L298N Dual H-Bridge Motor Driver
Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
This circuit consists of two L298N DC motor drivers controlled by an ESP32 microcontroller to drive two bipolar stepper motors. The ESP32 uses its GPIO pins to send control signals to the motor drivers, which in turn power the stepper motors with a 12V supply from either a battery or a power supply. The circuit is designed for precise control of stepper motors, likely for applications requiring synchronized movements, such as robotics or CNC machines.
This circuit is designed to control multiple DC motors using an L298N motor driver, which is interfaced with an Arduino UNO microcontroller. The Arduino controls the direction and speed of the motors, as well as a servo motor, and can activate a water pump via a relay module. Additionally, the circuit includes flame and smoke sensors for safety monitoring, and a SIM800L module for potential communication capabilities.
This circuit is designed to control two DC motors using an L298N Dual Motor Driver Module, which receives PWM control signals from an ESP32 microcontroller. The motors' rotational movement can be monitored by two Optical Encoder Sensor Modules connected to the ESP32. Power is supplied by a 4 x AAA battery mount, with the battery's positive terminal connected to the motor driver's 12V input and the negative terminal to the common ground.
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.
Robotics: Driving wheels or actuators in robotic systems.
Automation: Controlling conveyor belts or other motorized systems.
DIY Projects: Building remote-controlled cars, drones, or other motorized devices.
Stepper Motor Control: Driving stepper motors in CNC machines or 3D printers.
Technical Specifications
The following table outlines the key technical details of the L298N Dual H-Bridge Motor Driver:
Parameter
Value
Supply Voltage (Vcc)
5V to 35V
Logic Voltage (Vss)
5V
Maximum Current (per channel)
2A
Number of Channels
2
Control Signals
PWM, Direction (IN1, IN2, IN3, IN4)
Output Type
H-Bridge
Heat Dissipation
Built-in heatsink
Dimensions
43mm x 43mm x 27mm
Pin Configuration and Descriptions
The L298N module has several pins and terminals for power, control, and motor connections. The table below describes each pin:
Pin/Terminal
Description
Vcc
Power supply for motors (5V to 35V).
GND
Ground connection.
5V
Regulated 5V output (can be used to power logic circuits if Vcc > 7V).
IN1, IN2
Control inputs for Motor A. IN1 and IN2 determine the direction of rotation.
IN3, IN4
Control inputs for Motor B. IN3 and IN4 determine the direction of rotation.
ENA
Enable pin for Motor A. Can be connected to a PWM signal for speed control.
ENB
Enable pin for Motor B. Can be connected to a PWM signal for speed control.
OUT1, OUT2
Motor A output terminals.
OUT3, OUT4
Motor B output terminals.
Usage Instructions
How to Use the L298N in a Circuit
Power Connections:
Connect the motor power supply to the Vcc terminal (5V to 35V).
Connect the ground of the power supply to the GND terminal.
If the motor power supply is greater than 7V, the onboard voltage regulator will provide 5V to the 5V pin, which can be used to power external logic circuits.
Motor Connections:
Connect the terminals of Motor A to OUT1 and OUT2.
Connect the terminals of Motor B to OUT3 and OUT4.
Control Connections:
Connect the control pins (IN1, IN2, IN3, IN4) to the microcontroller's GPIO pins.
Connect the enable pins (ENA, ENB) to PWM-capable GPIO pins for speed control.
Logic Power:
If the motor power supply is less than 7V, connect an external 5V power source to the 5V pin to power the logic circuitry.
Important Considerations and Best Practices
Use a heatsink or active cooling if the current exceeds 1A per channel for extended periods.
Ensure the ground of the motor power supply is connected to the ground of the microcontroller.
Use flyback diodes across the motor terminals if the motors generate significant back EMF.
Avoid exceeding the maximum current and voltage ratings to prevent damage to the module.
Example: Controlling a DC Motor with Arduino UNO
Below is an example Arduino sketch to control the speed and direction of a single DC motor using the L298N module:
// Define control pins for Motor A
const int IN1 = 9; // Direction control pin 1
const int IN2 = 8; // Direction control pin 2
const int ENA = 10; // PWM pin for speed control
void setup() {
// Set motor control pins as outputs
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(ENA, OUTPUT);
}
void loop() {
// Rotate motor forward at 50% speed
digitalWrite(IN1, HIGH); // Set IN1 high
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 128); // Set PWM duty cycle to 50% (128/255)
delay(2000); // Run motor for 2 seconds
// Rotate motor backward at 75% speed
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, HIGH); // Set IN2 high
analogWrite(ENA, 192); // Set PWM duty cycle to 75% (192/255)
delay(2000); // Run motor for 2 seconds
// Stop the motor
digitalWrite(IN1, LOW); // Set IN1 low
digitalWrite(IN2, LOW); // Set IN2 low
analogWrite(ENA, 0); // Set PWM duty cycle to 0 (stop)
delay(2000); // Wait for 2 seconds before repeating
}
Troubleshooting and FAQs
Common Issues and Solutions
Motors Not Running:
Ensure the power supply voltage is within the specified range (5V to 35V).
Verify that the control pins are correctly connected to the microcontroller.
Check if the enable pins (ENA, ENB) are receiving a valid PWM signal.
Overheating:
Use a heatsink or active cooling if the module becomes too hot during operation.
Reduce the motor load or current draw if possible.
Erratic Motor Behavior:
Ensure proper grounding between the motor driver, power supply, and microcontroller.
Check for loose or faulty connections.
No Output on 5V Pin:
The onboard voltage regulator only provides 5V if the motor power supply (Vcc) is greater than 7V.
FAQs
Q: Can the L298N drive stepper motors?
A: Yes, the L298N can drive a single stepper motor by controlling the two H-bridges. You will need to sequence the control signals (IN1, IN2, IN3, IN4) appropriately.
Q: Can I use the L298N with a 3.3V microcontroller?
A: Yes, but ensure the logic voltage levels are compatible. You may need level shifters if the microcontroller's GPIO pins cannot reliably drive the L298N's inputs.
Q: What is the maximum current the module can handle?
A: The L298N can handle up to 2A per channel, but active cooling is recommended for currents above 1A.