Тёмный

Arduino DC Motor Control Tutorial - L298N | H-Bridge | PWM | Robot Car 

How To Mechatronics
Подписаться 678 тыс.
Просмотров 1,2 млн
50% 1

howtomechatronics.com/tutoria... ► 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: / howtomechatronics
Parts list (check website article for full list, affiliate links):
Amazon.com:
L298N Driver: amzn.to/2KwGM0o
12V High Torque DC Motor: amzn.to/2HoYuUe
Arduino Board: amzn.to/2Ccd5kC
Banggood.com:
L298N Driver: bit.ly/3c7tOY4
12V High Torque DC Motor: bit.ly/39eup8s
Arduino Board: bit.ly/2YioMjH
Visit HowToMechatronics.com for more Tutorials, Tips, Projects and How It Works videos:
► howtomechatronics.com/
Like my page on Facebook:
► / howtomechatronics

Опубликовано:

 

24 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 340   
@HowToMechatronics
@HowToMechatronics 3 года назад
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: www.patreon.com/howtomechatronics
@waelfathe9909
@waelfathe9909 3 года назад
dc brush or bl?
@TBoys_Space
@TBoys_Space 2 года назад
@howtomechatronics Please what software or program did you use in creating the electrical connection animation?
@kylebenson5416
@kylebenson5416 4 месяца назад
where the code at?
@redpillcommando
@redpillcommando 4 года назад
Who cares about your voice bro, it's your brain we come here for. This is the best tutorial on H bridge and arduion I have ever run across, thank you for making it.
@HowToMechatronics
@HowToMechatronics 4 года назад
Glad you found it helpful, cheers!
@Lamefoureyes
@Lamefoureyes 2 года назад
This is kind of amazing, I was able to follow this video as a non engineer because of some video tutorials on youtube and how well this was presented. Seriously, thank you.
@quintonvehon2638
@quintonvehon2638 2 года назад
Thank you for including the written article for this video!! Both resources are clear and easy to follow.
@adityaraj-xq3ow
@adityaraj-xq3ow 5 лет назад
Thanks dude for such amazing tutorial the quality of the content that you have provided to us is very much helpfull. Keep sharing your knowledge!!
@airesearch0844
@airesearch0844 3 года назад
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 ?
@DaveSmith-wn2kj
@DaveSmith-wn2kj 4 года назад
Perfect. Explained very well, and clearly. Straight to the point as well. Fantastic video all round really. Thank you.
@samhat41
@samhat41 4 года назад
This is a very informative video, I have just starting learning with my own arduino starter kit, this helps to explain a few things. Cheers buddy.
@TonoNamnum
@TonoNamnum 4 года назад
Thanks for the video it was helpful. No need to add potentiometer or buttons. Isolating everything makes it faster to undersand.
@omkulkarni5058
@omkulkarni5058 3 года назад
Very well explained.The schematics and illustrations are perfrect. Fantastic video
@davorpelivanovic4948
@davorpelivanovic4948 5 лет назад
Very good tutorial. I am working on version with NodeMCU and plan to use Blynk for controlling it over the internet. I get a lot of good information from this video. Thank you !
@HowToMechatronics
@HowToMechatronics 5 лет назад
Thanks, I'm glad you found it useful!
@thegoldarmor6020
@thegoldarmor6020 5 лет назад
Great, and the schematics and illustrations are perfrect
@pivotanimator321
@pivotanimator321 6 лет назад
Dude amazing video. Good quality tutorial
@ezzatluqman
@ezzatluqman 2 года назад
The most well explained video so far that i found! thanks for showing the better understanding how to connect this driver to arduino. I am planning to do an 8 motor of ROV on my own. My question is how can we connect this motor driver if i should be using 4 piece of them? since 1 piece of driver is use for a pair of motor
@bugraates478
@bugraates478 2 года назад
I like this in-depth review dude, you're awesome!
@user-kr8ok2no1s
@user-kr8ok2no1s 9 месяцев назад
Thank you to you for taking the time to put together a video to help others online with their robotics projects. There are some mistakes though...ena, in1, in2, should be outputs. Button should be an input. The resistor should be on the positive side of the or on the 5v wire or the pin 4 wire, this is to protect the circuit. You don't necessarily rotDirection in your code, you can change directions without this.
@brandonmcbroom3732
@brandonmcbroom3732 3 года назад
Great video! Very detailed and concise. Thank you.
@EvanAndKatelyn
@EvanAndKatelyn 5 лет назад
This is so cool! All you need now is one more, then you can add weapons and fight them! 😜🤣
@rishabseshadri3691
@rishabseshadri3691 3 года назад
@David Pacák burn.
@arushdwivedi3553
@arushdwivedi3553 3 года назад
@David Pacák ussr anthem in background😂🔥
@manoharnaik6203
@manoharnaik6203 5 лет назад
very nice video. specially for novice. explains every details
@oOcitizenOo
@oOcitizenOo 6 лет назад
Loved this tutorial! Thnx for explanations
@user-eq7ub2bn8e
@user-eq7ub2bn8e 4 года назад
凄いなーー〜 見た目がかっこいい!
@bmanishap
@bmanishap 5 лет назад
Very informative..
@srigowrinomula5990
@srigowrinomula5990 5 лет назад
🔥 fire really loved ur project
@johngonsalves5268
@johngonsalves5268 5 лет назад
Outstanding write up! Thanks for sharing your skills and thills
@HowToMechatronics
@HowToMechatronics 5 лет назад
Thank you!
@phiwatec2576
@phiwatec2576 6 лет назад
Could you please make a tutorial on how to transmit data over the powerline using the KQ-130F Power Line Carrier Module? It would be very nice.
@FamilyManMoving
@FamilyManMoving 6 лет назад
Thanks for another great tutorial vid. Keep up the great work.
@naboulsikhalid7763
@naboulsikhalid7763 6 лет назад
always good in explanation. Thank you for sharing knowledge
@IsaacPiera
@IsaacPiera 4 года назад
Don't change the rotation direction suddenly, you will damage the motor. You should reduce the speed to zero, delay for a bit to let the motor stop and then accelerate in the opposite direction.
@enkisonofanu2301
@enkisonofanu2301 5 лет назад
You make things real easy, great video.
@siddharthgadepalli627
@siddharthgadepalli627 3 года назад
Great video. Can you link a parts list and where you bought the parts from? I know you didnt mention a diode but I am assuming that is necessary? Also is the MOSFET a separate component? Or is it included with the L298N ? Sorry if these are beginner questions. I am new to this
@sripal.jain4
@sripal.jain4 Год назад
Very detailed demo of the project 👍
@walidoulondon8107
@walidoulondon8107 5 лет назад
Best electronic RU-vid channel
@Mrjimmyboy727
@Mrjimmyboy727 6 лет назад
Great tutorial. Thank you! Can be added collision sensor switch module to last project ( L298N+Joystick)?
@valamifantaziadusnev3728
@valamifantaziadusnev3728 3 года назад
I'm sorry that I can't support you but i have to tell that you would deserve more for these videos.
@therealjordanvo
@therealjordanvo 4 года назад
Hi there! I was just wondering what the purpose of the 10k ohm resistor in the diagram at 1:09 in the video
@Bea-jl9lt
@Bea-jl9lt 2 года назад
This is so sick! I want an arduino so bad omg
@muhammadmustafadurrani6813
@muhammadmustafadurrani6813 2 года назад
You are the best arduino teacher
@Burak-pl1jl
@Burak-pl1jl 6 лет назад
Well, how can I control a DC motor and a Servo motor at the same time? Would L298N control both of them at the same time or would I need two L298Ns for that? Or is there a better way to do that ? :) Thanks for the video!
@minhtrung2179
@minhtrung2179 5 лет назад
Thank you for your clear tutorial.
@schneebrett903
@schneebrett903 3 года назад
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.
@mhzxtal922
@mhzxtal922 6 лет назад
May I know, what kind of software you used to draw the L298N + Motor + Arduino Board on the presentation slides, Would you let me know ? Thanks.
@thomasalexander1563
@thomasalexander1563 7 лет назад
Always nice explain,,, waiting for your new videos..
@intellectracoon
@intellectracoon 4 года назад
awesome video ... subscribed. good luck man.
@vishalgandotra1328
@vishalgandotra1328 6 лет назад
I need your help! I want the adruino to read input from an accelerometer or any other angle tilting sensor and thus changes the direction of rotation of dc motor. Is it possible and is there any code related to this?
@djonealves9472
@djonealves9472 5 лет назад
how are you powering the arduino? is it using the batteries? and when you upload the code to the arduino board does it store it?
@devispiccioni5180
@devispiccioni5180 5 лет назад
Hi! congratulations for the tutorial👍🏻 I wanted to ask for help ... I would like to use the bts7960 43a driver to manage two powerful engines. you could change the code with these drivers! I would be very grateful to you 👍🏻 Thank you so much 👍🏻👍🏻
@hl5hl5
@hl5hl5 Год назад
Is there a way to have continuous loop motion, as for a linear actuator motor to go back and forth by itself? Do you just take away VOID loop out of the code?
@noppanut3231
@noppanut3231 5 лет назад
would this kind of connection work if i add a routine loop coding and remove the joystick.
@Turtlehands
@Turtlehands 3 года назад
Of course. You can do that. You can even do things like use the sonar sensor to "look" for an obstruction, then program it to back up, turn, and move again.
@nguyenthuy9824
@nguyenthuy9824 4 года назад
Hello 1) How do you think the code will be changed? if 1 motor uses to control left-right and 1 motor uses to move forward -backward? 2) do you think the code was without backward left and backward right situation?
@charlesgoehring3445
@charlesgoehring3445 4 года назад
That was very well done.
@franciscocarrizo7562
@franciscocarrizo7562 Год назад
Te hago una consulta.. que motores me recomendas de 12 o 24 v para mover un equipo de 40 kg de peso distribuido en 4 ruedas
@juanalvares11
@juanalvares11 5 лет назад
very well explained you have my thanks
@arnavm2003
@arnavm2003 5 лет назад
Amazing video....helped me for my school spy bot project. Wanted to control the motors using DTMF successfully done... But there is a mistake: 5:27 set the pinmode for the in1 and in2 as input. it should be output
@kanhaiyaupreti6702
@kanhaiyaupreti6702 4 года назад
Yes
@juancox99
@juancox99 Год назад
Great video, thanks. I am setting up the car for my kid´s science class - if I am using 6 v circuit, all coding should be the same? Thanks!!
@harshitsomani1717
@harshitsomani1717 5 лет назад
Can you please tell me how to give spring or suspension mechanism to the wheels?
@fwheelbd1716
@fwheelbd1716 5 лет назад
Sir, Please teach or show me Arduino R3 with DC 3V-36V 15A Dual H-Bridge DC Motor Driver. You gave the best here
@ahmadhafiz4567
@ahmadhafiz4567 4 года назад
is it works If i use 12V battery and attach two 6v dc motor? please explain why?
@fortysomethin3432
@fortysomethin3432 3 года назад
hi. what kind of mosfet did you use? great tutorial! thanks
@schneebrett903
@schneebrett903 3 года назад
This is a well done video!
@martinszalite
@martinszalite 4 года назад
Hi! I am searching for ideas on how to control my two brushed 500W 24v motors independently. The idea is like in this video, but I need it for my boats two outboards, so I could control them in the way you control two combustion outboards. I found Cytron two-channel 30A controller, but I can't find any wired or RC slider which could cover full speed range both directions and stay in its position without holding it (RC). Thanks.
@jaimerodrigovasconezrubio3348
@jaimerodrigovasconezrubio3348 4 года назад
muy bueno gracias por compartir el código,,vídeo sin código es lo mismo que nada. Thanks for sharing.
@samadhistate9637
@samadhistate9637 Год назад
In the website notes regarding the L298N you say: "In this case the 5V pin will be used as input as we need connect it to a 5V power supply in order the IC to work properly." But in your schematic diagram nothing is connected to the 5V pin. And it looks like the Arduino is being powered by the same 12V battery that is powering the 2 motors.
@reenapulikkal
@reenapulikkal 5 лет назад
Please make a video of RC speed controller for DC motor
@hpravija
@hpravija 6 лет назад
On my l298n although I have set the jumper and given 7.4v to the pin marked as "+12v" it doesn't work. Even the power light doesn't light up. Then I supplied 7.4v to the other pin marked as "+5v". Then the power light was on and it worked. But when I connected a motor and connected it to arduino the current supplied to the motor was very low even the motor didn't run sometimes. As a result I gave 5v to the +5v pin and another 7.4v to +12v pin and then the motor worked fine. But the problem I have is that same thing happens when I remove the jumper. What should I do? Set the jumper or remove it?
@PascalKolkman
@PascalKolkman 4 года назад
Question. Besides the L298N driver max 2 ampere. Wich type of Arduino board are you using or do you advise using in your DC motor control ? The "Uno R3" The "Mega 2560" or The Arduino NAno 33 i/o
@TBoys_Space
@TBoys_Space 2 года назад
@howtomechatronics Please what software or program did you use in creating the electrical connection animation?
@mitsos306ify
@mitsos306ify 2 года назад
Great video and explanation!
@Tropicsca
@Tropicsca 2 года назад
I will be using one these to make a gokart soon mwahaha. I'm going to craft the PWM around a foot pedal so I can adjust the speed with my foot
@ranimallesh2706
@ranimallesh2706 5 лет назад
Hi can v use ardunio uno board used before.and how to change or remove the code pls inform
@luispires6935
@luispires6935 4 года назад
I have one similar project but with a 5v motor and a 5v power suply, how can I connect the power suply to both arduino and motor and leds, cause if I conect via USB and it runs slow
@Izacundo1
@Izacundo1 4 года назад
Luis Pires have you found an answer to that problem? I’m trying to figure out the same thing
@chaitanyapatel7010
@chaitanyapatel7010 7 лет назад
Congratulations for 50k subscriber. When you will you make a IOT base project ???
@chaitanyapatel7010
@chaitanyapatel7010 7 лет назад
I'm currently work on IOT based project do you collabe with me please comment nd give me your e-mail address.
@clarencenikel_6420
@clarencenikel_6420 2 года назад
I want to use a foot motor from a vacuum cleaner, can I use this same setup using a 120v DC motor? If so, what type of battery should I use to power up a 120v?
@m.a.sherif6878
@m.a.sherif6878 5 лет назад
In here the input is from the joystick (human input). how can i make the input from a different source lets say a processor like a raspberry pi? in other words how can I make a raspberry pi talk/communicate to Arduino to give it inputs?
@BigHeartBreak93
@BigHeartBreak93 5 лет назад
Are there Alternatives to using batteries for delivering the power supply to the Driver?
@isaacgarcia1779
@isaacgarcia1779 3 года назад
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).
@fazilanasim1240
@fazilanasim1240 4 года назад
I want to control 4 gear motors with this method ... will it work on 3 li-ion cells?
@abdallahkhamis881
@abdallahkhamis881 2 года назад
Great Video thanks a lot .. We really really appreciated .. keep going
@vanucle2540
@vanucle2540 5 лет назад
I'm doing a late check. The exercise is: control 2 motor (forward, backward, left, right) using arduino and joystick. Can anyone help me? thank you !!!
@danwii4820
@danwii4820 Год назад
could the joystick be replaced by a receiver for wireless input. Great video btw :)
@adhepradhan
@adhepradhan 4 года назад
Is it important for making Arduino car with out remote
@mchaves
@mchaves 6 лет назад
Hi, its possible to conect L298n direct to output PWM from RX flysky ?
@bizeigel
@bizeigel 2 года назад
Great video. Thank you!
@Alexander_Meyer
@Alexander_Meyer Год назад
This is so useful, thank you so so much!
@HowToMechatronics
@HowToMechatronics Год назад
Glad it was helpful!
@Justice4ROC
@Justice4ROC 5 лет назад
Hi, may I know what type of power supply did you use for arduino?
@ricardooliveira4546
@ricardooliveira4546 5 лет назад
Valeu um Link e uma inscriçao, Parabens pelo video
@ycmgxekwa
@ycmgxekwa 7 лет назад
Great lessons. Thank you.
@dhakshingk
@dhakshingk 4 года назад
What do you do if you want to add 2 15V 2.85 amp motors. I am guessing a larger battery and a BEC? please someone answer this, I am gonna use it for my GCSE DT
@BadPracticeAutomation
@BadPracticeAutomation 2 года назад
I’ve tried to replicate the example with the motor l298n and push button. Everything works fine except the potentiometer isn’t controlling the speed. I’ve triple checked the pins and the code but I can’t figure out why the potentiometer isn’t working. I was wondering if anyone had any ideas.
@ronaldwollman2083
@ronaldwollman2083 5 лет назад
well these run two 12v motors with a 5A stall current
@fouzanjaved5441
@fouzanjaved5441 2 года назад
Sir, can you also give me the circuit diagram and the codes for the 4 dof ps2 controlled robotic arm car?
@caffeinalized5575
@caffeinalized5575 4 года назад
Thanks for this instructional & educational video! May I check with you... could I use a normal disposable 9V battery instead to power up 2 smaller DC motors each rated about 4-6V?
@HowToMechatronics
@HowToMechatronics 4 года назад
If they are rated 6V you cannot use 9V, you might burn them.
@BillyGates1721
@BillyGates1721 2 года назад
a standard 9V battery has a capacity of about 500 mAh. This battery will be empty after 2 or 3 hour of use even with small motors. If you would like to use them anyway you need a DC-DCstep-down voltage-regulator to reduce the voltage down to 6V
@Abdelhamid_Helal
@Abdelhamid_Helal 4 года назад
which programme did you use to draw the circuit diagram?
@bonganingwenya8674
@bonganingwenya8674 4 месяца назад
I wish sometimes these guys making youtube videos have Lectures live in universities to show other lectures how to guide people in search for solutions
@jumbo999614
@jumbo999614 4 года назад
Is it good idea to have separated power sources? one for L298N driver and one for Arduino? If so, do I need to share Ground between L298N and Arduino? Let' say I use 3.7v x 2 18650 battery for L298N driver and motors and 9v for Arduino. Will it cause problem due to different voltage sharing the same Ground?
@yoka7841
@yoka7841 4 года назад
Outstanding ..... Thank you for sharing
@Billy-mt6qr
@Billy-mt6qr 5 месяцев назад
In these examples are you removing the jumper for the pwm motor driver pins or not?
@ankursolanky4129
@ankursolanky4129 2 года назад
How did you connect the jumper wires to the battery bay and Arduino board?
@jumbo999614
@jumbo999614 4 года назад
5:26 why in1 and in2 not OUTPUT? (you have both pins run with digitalWrite command). Also, when you push a button, you can result in value of 0,1,HIGH,LOW,True,and False? Why do you choose True or False instead of 0&1 or High&LOW? and buttonState is declared in the beginning but is not used anywhere in the code.
@anhtrunghoang8296
@anhtrunghoang8296 3 года назад
Same quest as me! Lol.
@renitehd8127
@renitehd8127 3 года назад
Can i use more than 2 Motors? With the L298N?
@sumitsarkar4019
@sumitsarkar4019 6 лет назад
awesome video. thank u very much
Далее
Я ПОКУПАЮ НОВУЮ ТАЧКУ - МЕЧТУ!
39:05
Driving DC Motors with Microcontrollers
1:04:32
Просмотров 618 тыс.
How To Make A DIY Arduino Joystick Control Car At Home
6:34
I Built a Ball Balancing Robot
8:55
Просмотров 1 млн
Arduino Uno R3: Digitalwrite your First Robot Car
12:32
How does an Electric Motor work?  (DC Motor)
10:03
Просмотров 17 млн
You can learn Arduino in 15 minutes.
16:34
Просмотров 9 млн
Я ПОКУПАЮ НОВУЮ ТАЧКУ - МЕЧТУ!
39:05