|
KiCADKicad
|
Arduino Customized L298M Dual Motor Driver Module
Introduction
The Arduino Customized L298M Dual Motor Driver Module is designed to handle high-power DC and Stepper Motors. It comprises an L298 motor driver IC and a 78M05 5V regulator. The module enables control of up to 4 or 2 DC motors with directional and speed adjustments.
Specifications of a L298M
The various specifications, as well as the features of an L298M motor driver module, include;
- Ø A L298N 22A driver model
- Ø L298N double H bridge driver chip
- Ø A 46V maximum motor voltage
- Ø 2A maximum motor current
- Ø 5V logic voltage
- Ø 5-35V driver voltage
- Ø 2A driver's current
- Ø 0 to 36mA logic current
- Ø 25W maximum power
- Ø Current sense for every motor
- Ø Power-on LED indicator
- Ø A heatsink that upgrades the performance
Module’s Pinout Configuration
The L298N Motor Driver Module has various pins that serve multiple functions. The IN1 and the IN2 control motor A’s spinning direction, while IN3 and IN4 control motor B’s spinning direction. Both ENA and ENB enable PWM for motors A and B, respectively. The OUT1 and OUT2 pins are the output pins for motor A, whereas OUT3 and OUT4 are the output pins for motor B. The 12V plug is also the input DC, and the 5V pin supplies power to the L298n IC’s switching logic circuitry. Lastly, the GND is the ground pin.
What does L298M entail?
The L298N Motor Driver module incorporates an L298 Motor Driver IC, 78M05 Voltage Regulator, resistors, capacitor, Power LED, and a 5V jumper in an integrated circuit. The 78M05 regulator activates when the jumper is in place, powering the internal circuitry when the supply is ≤12V. The 5V pin functions as an output to power the microcontroller. For supply >12V, the jumper is removed, and a separate 5V input is provided to power the internal circuitry. ENA & ENB control Motor A and Motor B speed, while IN1& IN2 and IN3 & IN4 determine their directions.
L298N Motor Driver with the Arduino
Now, let's apply these concepts practically. For our first example, we'll control motor speed with a potentiometer and change rotation direction using a push button. Here's the circuit diagram:
Components needed: L298N motor driver, DC motor, potentiometer, push button, and Arduino board.
Arduino Program
In the program, first, define pins and variables. In the setup section, set pin modes and the initial rotation direction of the motor. In the loop section, read the potentiometer value, map it to the PWM signal (0-255), and send it to the L298N board's Enable pin using analogWrite(). Check if the button is pressed; if true, change the motor's rotation direction by setting Input 1 and Input 2 inversely. The push button functions as a toggle, altering the motor's rotation direction each time it's pressed.
Easy Way to Manufacture This Project
To all readers, such a project can be manufactured for you through many manufacturing companies around the globe. I have always preferred working with PCBWay due to its benefits. One of the top benefits you get is project sponsorship. PCBWay has sponsored thousands of projects worldwide, especially for educational purposes. To benefit from such projects, you must visit their sponsorship page, follow the easy steps, and apply.
/* Arduino DC Motor Control - PWM | H-Bridge | L298N - Example 01
by Dejan Nedelkovski, www.HowToMechatronics.com
*/
#define enA 9
#define in1 6
#define in2 7
#define button 4
int rotDirection = 0;
int pressed = false;
void setup() {
pinMode(enA, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(button, INPUT);
// Set initial rotation direction
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
}
void loop() {
int potValue = analogRead(A0); // Read potentiometer value
int pwmOutput = map(potValue, 0, 1023, 0 , 255); // Map the potentiometer value from 0 to 255
analogWrite(enA, pwmOutput); // Send PWM signal to L298N Enable pin
// Read button - Debounce
if (digitalRead(button) == true) {
pressed = !pressed;
}
while (digitalRead(button) == true);
delay(20);
// If button is pressed - change rotation direction
if (pressed == true & rotDirection == 0) {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
rotDirection = 1;
delay(20);
}
// If button is pressed - change rotation direction
if (pressed == false & rotDirection == 1) {
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
rotDirection = 0;
delay(20);
}
}
Arduino Customized L298M Dual Motor Driver Module
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Simon Mugo
- High Power Three Channel LED Driver IntroductionI have been thinking about how to drive RGB LED patterns most simply. In my day-to-day r...
- 433 MHz Radio Frequency Transmitter Module IntroductionTwo devices can communicate with each other using radio frequencies and using an RF tran...
- Customized Servo Motor Driver Board IntroductionServo motors, also called rotary or linear actuators, are designed for minimal control o...
- Arduino Customized L298M Dual Motor Driver Module IntroductionThe Arduino Customized L298M Dual Motor Driver Module is designed to handle high-power D...
- Overvoltage Protection Board PrecautionBefore making use of the circuit in this design project, ensure that you first set the var...
- Automatic Residential Lighting System Board Based on AT89C51 In our day-to-day activities, we often don't remember to switch off or on the lights in our rooms. T...
- The Energy Saving Bulb Board The traditional incandescent bulb is an energy waster and it should be removed off shelves. My new t...
- ESP8266 MINI TEST BOARD Design Of The SchematicThe schematic design is done in KiCAD. The process starts with finding the da...
- POWER SUPPLY FOR THE ESP8266 ESP8266 is a microchip of low cost that is produced by a company by the name of ESPPRESSIF stems. It...
- 1N4148 INCOPORATING 741 IC TEMEPERATURE SENSOR Creating a simple temperature sensor using a diode (1N4148) and an operational amplifier (741 IC) is...
- TSL25911 Light Sensor IntroductionWe interact with different intensities and strengths of light in our daily activities. T...
- SIM800 GPS module ElevatorThis project demonstrates how you can develop various GPS/ GPRS and SMS capability developme...
- nRF51822 Mini Evaluation Board IntroductionDemand for development and evaluation boards the world over has increased. Due to such d...
- Customized LM393D Soil Moisture Sensor Board ElevatorThe project is good at converting analog signals from the soil to digital signals for soil m...
- PAM8403 Amplifier Module IntroductionThis is a simple project for improving your musical or audio entertainment by powering y...
- 741 IC Bass Booster IntroductionIn this project, we are going to design a bass booster circuit using the 741 IC. This is...
- LM317 AND LM337 ADJUSTABLE POWER SUPPLY CIRCUIT BOARD IntroductionThe LM317/LM337 symmetrical power supply circuit is an electronic setup for meeting the ...
- 230V AC to 1.5V DC PCB for Your Application IntroductionA power management integrated circuit (PMIC) is utilized to supply the necessary power t...
-
-
-
kmMiniSchield MIDI I/O - IN/OUT/THROUGH MIDI extension for kmMidiMini
109 0 0 -
DIY Laser Power Meter with Arduino
156 0 2 -
-
-
Box & Bolt, 3D Printed Cardboard Crafting Tools
152 0 2 -
-
A DIY Soldering Station Perfect for Learning (Floppy Soldering Station 3.0)
542 0 2