https://howtomechatronics.com/tutorials/arduino/arduino-dc-motor-control-tutorial-l298n-pwm-h-bridge/ ► Find more details, circuit schematics and source codes on my official website.
In this Arduino Tutorial we will learn how to control DC motors using Arduino. We well take a look at some basic techniques for controlling DC motors and make two example through which we will learn how to control DC motors using the L298N driver and the Arduino board.
If you enjoy and find the content that I make useful, please consider supporting me on Patreon: https://www.patreon.com/howtomechatronics
Parts list (check website article for full list, affiliate links):
Amazon.com:
L298N Driver: https://amzn.to/2KwGM0o
12V High Torque DC Motor: https://amzn.to/2HoYuUe
Arduino Board: https://amzn.to/2Ccd5kC
Banggood.com:
L298N Driver: http://bit.ly/3c7tOY4
12V High Torque DC Motor: http://bit.ly/39eup8s
Arduino Board: http://bit.ly/2YioMjH
Visit HowToMechatronics.com for more Tutorials, Tips, Projects and How It Works videos:
► https://howtomechatronics.com/
Like my page on Facebook:
► https://www.facebook.com/howtomechatronics
, https://i.ytimg.com/vi/I7IFsQ4tQU8/hqdefault.jpg
source
I hope you enjoyed this video and learned something new! If you'd like to support me making more content like this, please consider supporting me on Patreon: https://www.patreon.com/howtomechatronics
please provide joystick library for proteus
5:20 Shouldn't the 12V power supply ground be also connected to the Arduino ground as well?
Can we run 4 motors using this L298N driver?if YES then how can we connect this motors to the L298N???PLZ Plz reply fast..
Can i use more than 2 Motors? With the L298N?
How do you stop it from veering to one side when it should be moving straight?
very nice
I'm sorry that I can't support you but i have to tell that you would deserve more for these videos.
Hi, Im trying to build a similar circuit: 24v power supply with a h bridge controller for a 24v servo motor, what I'm worried about its sending the 24V (+) to the VIN Power Pin of the Arduino card (min 06:40).
Very well explained.The schematics and illustrations are perfrect. Fantastic video
In case someone connects the motor to A or B with ENB enabled (means motor is not PWM regulated, runs at full speed) with 12V jumper enabled and is surprised nothing happens after turning power on, there is a simple reason. Just connect a wire to 5V out, power on again and then touch either one of two pins, for example IN1 if motor is connected to A, that regulate the rotation direction (forward/backward). The motor will start turning.
This is a well done video!
can u send me that c code
Can i use L398N analog input
All of your videos deserve lot of superlative adjectives. Extremely good quality project and your explanation of theory and the Arduino sketch were precise and clear. May I suggest you do a self balancing two wheel "robot" project and cover PID in detail ?
Great video and very cool, but i proved the code with my car and the same components and it doesn´t work. Can you tell me any thing for help please?
How can c control a 24v, 7A dc motor with same method as discussed in the video?
Great video! Very detailed and concise. Thank you.
and how did you define the motor speed PWM as 255 when your motor`s 12V with 100rpm
is there any calculation formula for PWM in motor speed
can we connect 3 DC motors to L298 and connect it to Arduino?
Русский акцент слышу , а вы ?
Here is code to control 4 dc motors on tank chassis:
int rc_pulse1=1; //reading signal from FS
int rc_pulse2=2;
int mpwm1=3; //PWM channels for motors
int mpwm2=4;
int mpwm3=5;
int mpwm4=6;
void setup() {
pinMode(1,INPUT);
pinMode(2,INPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
digitalWrite(6,LOW);
digitalWrite(7,LOW);
digitalWrite(8,LOW);
digitalWrite(9,LOW);
digitalWrite(10,LOW);
}
void loop() {
mpwm1=0;
mpwm2=0;
mpwm3=0;
mpwm4=0;
delay(50);
rc_pulse1=pulseIn(1,HIGH,25000);
rc_pulse2=pulseIn(2,HIGH,25000);
delay(50);
if(rc_pulse1>1024) {
mpwm1,mpwm2=map(rc_pulse1,1024,2047,0,255);
if(mpwm1,mpwm2>0) {
analogWrite(3,mpwm1);
analogWrite(5,mpwm2);
}
}
delay(50);
if(rc_pulse1<1023) {
mpwm1,mpwm2=map(rc_pulse1,1023,0,0,255);
if(mpwm1,mpwm2>0) {
analogWrite(4,mpwm1);
analogWrite(6,mpwm2);
}
}
delay(50);
if(rc_pulse2>1024) {
mpwm3,mpwm4=map(rc_pulse2,1024,2047,0,255);
if(mpwm3,mpwm4>0) {
analogWrite(7,mpwm3);
analogWrite(9,mpwm4);
}
}
delay(50);
if(rc_pulse2<1023) {
mpwm3,mpwm4=map(rc_pulse2,1023,0,0,255);
if(mpwm3,mpwm4>0) {
analogWrite(8,mpwm3);
analogWrite(10,mpwm4);
}
}
delay(50);
}
Pretty good but I think you kinda copied the dronebot workshop