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

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

ความคิดเห็น • 344

  • @HowToMechatronics
    @HowToMechatronics  3 ปีที่แล้ว +15

    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?

    • @TBoySpace
      @TBoySpace 2 ปีที่แล้ว

      @howtomechatronics Please what software or program did you use in creating the electrical connection animation?

    • @kylebenson5416
      @kylebenson5416 9 หลายเดือนก่อน

      where the code at?

    • @High-techSanket7
      @High-techSanket7 4 หลายเดือนก่อน

      Nice voice and video bro👍👍

  • @redpillcommando
    @redpillcommando 4 ปีที่แล้ว +89

    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.

  • @Lamefoureyes
    @Lamefoureyes 2 ปีที่แล้ว +6

    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.

  • @scoochyogooch
    @scoochyogooch 2 ปีที่แล้ว +3

    Thank you for including the written article for this video!! Both resources are clear and easy to follow.

  • @thegoldarmor6020
    @thegoldarmor6020 6 ปีที่แล้ว +10

    Great, and the schematics and illustrations are perfrect

  • @airesearch0844
    @airesearch0844 4 ปีที่แล้ว +12

    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 ?

  • @adityaraj-xq3ow
    @adityaraj-xq3ow 5 ปีที่แล้ว +17

    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!!

  • @DaveSmith-wn2kj
    @DaveSmith-wn2kj 4 ปีที่แล้ว +19

    Perfect. Explained very well, and clearly. Straight to the point as well. Fantastic video all round really. Thank you.

  • @davorpelivanovic4948
    @davorpelivanovic4948 6 ปีที่แล้ว +3

    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 !

  • @bugraates478
    @bugraates478 2 ปีที่แล้ว +1

    I like this in-depth review dude, you're awesome!

  • @EvanAndKatelyn
    @EvanAndKatelyn 5 ปีที่แล้ว +55

    This is so cool! All you need now is one more, then you can add weapons and fight them! 😜🤣

  • @omkulkarni5058
    @omkulkarni5058 3 ปีที่แล้ว +2

    Very well explained.The schematics and illustrations are perfrect. Fantastic video

  • @TonoNamnum
    @TonoNamnum 4 ปีที่แล้ว +2

    Thanks for the video it was helpful. No need to add potentiometer or buttons. Isolating everything makes it faster to undersand.

  • @samhat41
    @samhat41 4 ปีที่แล้ว +6

    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.

  • @Bea-jl9lt
    @Bea-jl9lt 2 ปีที่แล้ว +1

    This is so sick! I want an arduino so bad omg

  • @muhammadmustafadurrani6813
    @muhammadmustafadurrani6813 3 ปีที่แล้ว

    You are the best arduino teacher

  • @sripal.jain4
    @sripal.jain4 2 ปีที่แล้ว +1

    Very detailed demo of the project 👍

  • @StuartWoodwardJP
    @StuartWoodwardJP 4 หลายเดือนก่อน

    Great video! This is exactly what I was looking for and just the right amount of detail.

  • @SembeiNorimaki
    @SembeiNorimaki 4 ปีที่แล้ว +17

    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.

  • @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.

  • @pivotanimator321
    @pivotanimator321 7 ปีที่แล้ว +9

    Dude amazing video. Good quality tutorial

  • @manoharnaik6203
    @manoharnaik6203 5 ปีที่แล้ว +2

    very nice video. specially for novice. explains every details

  • @brandonmcbroom3732
    @brandonmcbroom3732 4 ปีที่แล้ว +3

    Great video! Very detailed and concise. Thank you.

  • @bmanishap
    @bmanishap 6 ปีที่แล้ว +10

    Very informative..

  • @srigowrinomula5990
    @srigowrinomula5990 5 ปีที่แล้ว +3

    🔥 fire really loved ur project

  • @walidoulondon8107
    @walidoulondon8107 5 ปีที่แล้ว

    Best electronic TH-cam channel

  • @krustykrus6603
    @krustykrus6603 8 หลายเดือนก่อน +1

    6:33 is it ok to supply the vin input with the 11.1V battery?

  • @ezzatluqman
    @ezzatluqman 2 ปีที่แล้ว +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

  • @oOcitizenOo
    @oOcitizenOo 7 ปีที่แล้ว +2

    Loved this tutorial! Thnx for explanations

  • @デュクシデュクシ-n7l
    @デュクシデュクシ-n7l 4 ปีที่แล้ว +3

    凄いなーー〜
    見た目がかっこいい!

  • @intellectracoon
    @intellectracoon 5 ปีที่แล้ว

    awesome video ... subscribed. good luck man.

  • @enkisonofanu2301
    @enkisonofanu2301 6 ปีที่แล้ว +4

    You make things real easy, great video.

  • @jumbo999614
    @jumbo999614 4 ปีที่แล้ว +3

    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.

  • @johngonsalves5268
    @johngonsalves5268 6 ปีที่แล้ว +9

    Outstanding write up! Thanks for sharing your skills and thills

  • @RajashreePint
    @RajashreePint ปีที่แล้ว

    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.

  • @mitsos_306
    @mitsos_306 2 ปีที่แล้ว

    Great video and explanation!

  • @OMARYassin1
    @OMARYassin1 2 ปีที่แล้ว

    You just rescued me ❤️

  • @abdallahkhamis881
    @abdallahkhamis881 2 ปีที่แล้ว

    Great Video thanks a lot .. We really really appreciated .. keep going

  • @Alexander_Meyer
    @Alexander_Meyer ปีที่แล้ว

    This is so useful, thank you so so much!

  • @mariabarbarasalinasluna4808
    @mariabarbarasalinasluna4808 2 ปีที่แล้ว

    Wow, excellent tutorial !!!! thanks :) :) :)

  • @schneebrett903
    @schneebrett903 3 ปีที่แล้ว

    This is a well done video!

  • @qolbola_bilimuz4424
    @qolbola_bilimuz4424 4 ปีที่แล้ว +1

    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

    • @johnturk158
      @johnturk158 4 ปีที่แล้ว

      PWM sends an 8bit signal so its values range from 0-255.. think of 255 as 100% and 0 as 0%.. if you want it to go 50% simply send it 127 and so on..

    • @qolbola_bilimuz4424
      @qolbola_bilimuz4424 4 ปีที่แล้ว +1

      @@johnturk158 thank you so much. Stay healthy

  • @FamilyManMoving
    @FamilyManMoving 7 ปีที่แล้ว

    Thanks for another great tutorial vid. Keep up the great work.

  • @charlesgoehring3445
    @charlesgoehring3445 4 ปีที่แล้ว +1

    That was very well done.

  • @naboulsikhalid7763
    @naboulsikhalid7763 6 ปีที่แล้ว +1

    always good in explanation. Thank you for sharing knowledge

  • @therealjordanvo
    @therealjordanvo 5 ปีที่แล้ว +2

    Hi there! I was just wondering what the purpose of the 10k ohm resistor in the diagram at 1:09 in the video

  • @bizeigel
    @bizeigel 2 ปีที่แล้ว

    Great video. Thank you!

  • @sayantanmaiti2513
    @sayantanmaiti2513 7 ปีที่แล้ว

    nice video sir ...very neatly explained

    • @rtesimpson
      @rtesimpson 7 ปีที่แล้ว

      Yeah, I agree!

  • @bonganingwenya8674
    @bonganingwenya8674 9 หลายเดือนก่อน

    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

  • @radazeonv8821
    @radazeonv8821 3 ปีที่แล้ว +1

    5:20 Shouldn't the 12V power supply ground be also connected to the Arduino ground as well?

    • @devrim6
      @devrim6 3 ปีที่แล้ว

      yep

  • @schneebrett903
    @schneebrett903 3 ปีที่แล้ว +1

    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.

  • @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).

  • @minhtrung2179
    @minhtrung2179 5 ปีที่แล้ว

    Thank you for your clear tutorial.

  • @thomasalexander1563
    @thomasalexander1563 7 ปีที่แล้ว

    Always nice explain,,,
    waiting for your new videos..

  • @SebaSera94
    @SebaSera94 6 ปีที่แล้ว

    Awesome tutorial! 👏 Are you italian?

  • @yoka7841
    @yoka7841 4 ปีที่แล้ว

    Outstanding ..... Thank you for sharing

  • @cesarhurtadodemendoza9746
    @cesarhurtadodemendoza9746 5 ปีที่แล้ว +1

    what is the white and black thing at the begining of the exit of the motor in the 1:20 minute?

    • @andrejcupac7359
      @andrejcupac7359 5 ปีที่แล้ว

      its a diode

    • @JarvisBeta
      @JarvisBeta 5 ปีที่แล้ว

      It's a diode and it's silver and black.
      You may also call it a p-n junction diode.
      Hope it helps...

  • @ycmgxekwa
    @ycmgxekwa 7 ปีที่แล้ว +3

    Great lessons. Thank you.

  • @renitehd8127
    @renitehd8127 3 ปีที่แล้ว +2

    Can i use more than 2 Motors? With the L298N?

  • @phiwatec2576
    @phiwatec2576 7 ปีที่แล้ว +3

    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.

  • @juanalvares11
    @juanalvares11 5 ปีที่แล้ว +1

    very well explained you have my thanks

  • @arnavm2003
    @arnavm2003 6 ปีที่แล้ว

    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

  • @siddharthgadepalli627
    @siddharthgadepalli627 4 ปีที่แล้ว +2

    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

  • @Burak-pl1jl
    @Burak-pl1jl 6 ปีที่แล้ว +2

    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!

  • @ΓΙΩΡΓΟΣΚΟΥΛΑΜΑΣ
    @ΓΙΩΡΓΟΣΚΟΥΛΑΜΑΣ 4 ปีที่แล้ว

    At 5:20 you use a resistance and you don't tell the value. What is the value for the resistance? Thanks

  • @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.

  • @arnavm2003
    @arnavm2003 6 ปีที่แล้ว +1

    5:34 it should be
    pinMode(in1, OUTPUT);
    pinMode(in2, OUTPUT);

    • @pawlack
      @pawlack 5 ปีที่แล้ว

      are you sure? Cause that's what I did and it didn't run, but when I changed those to INPUT it started to work, and now I'm baffled why. There is nothing in datasheet of bridge that would explain it ;(

  • @sumitsarkar4019
    @sumitsarkar4019 7 ปีที่แล้ว

    awesome video. thank u very much

  • @fortysomethin3432
    @fortysomethin3432 4 ปีที่แล้ว

    hi. what kind of mosfet did you use?
    great tutorial!
    thanks

  • @adhepradhan
    @adhepradhan 4 ปีที่แล้ว +3

    Is it important for making Arduino car with out remote

  • @noppanut3231
    @noppanut3231 5 ปีที่แล้ว +3

    would this kind of connection work if i add a routine loop coding and remove the joystick.

    • @Turtlehands
      @Turtlehands 4 ปีที่แล้ว

      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.

  • @fwheelbd1716
    @fwheelbd1716 5 ปีที่แล้ว +1

    Sir, Please teach or show me Arduino R3 with DC 3V-36V 15A Dual H-Bridge DC Motor Driver. You gave the best here

  • @djonealves9472
    @djonealves9472 6 ปีที่แล้ว +1

    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?

  • @AlessioSangalli
    @AlessioSangalli 5 ปีที่แล้ว

    Excuse me but
    why do you config in1 and in2 as inputs? 5:32
    Those control an H bridge so they should be outputs? You use digitalWrite() on them later

    • @HowToMechatronics
      @HowToMechatronics  5 ปีที่แล้ว

      Well, it's a typo, they are outputs, that's right.

    • @AlessioSangalli
      @AlessioSangalli 5 ปีที่แล้ว

      @@HowToMechatronics ok very good that's what I thought thanks!

  • @juancox99
    @juancox99 2 ปีที่แล้ว

    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!!

  • @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

  • @Abdelhamid_Helal
    @Abdelhamid_Helal 4 ปีที่แล้ว +1

    which programme did you use to draw the circuit diagram?

  • @nguyenthuy9824
    @nguyenthuy9824 4 ปีที่แล้ว +1

    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?

  • @ily4402
    @ily4402 4 ปีที่แล้ว +6

    4:12 my voice randomly when I hit puberty

  • @caffeinalized5575
    @caffeinalized5575 5 ปีที่แล้ว +1

    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  5 ปีที่แล้ว +2

      If they are rated 6V you cannot use 9V, you might burn them.

    • @BillyGates1721
      @BillyGates1721 3 ปีที่แล้ว

      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

  • @Billy_Dubs
    @Billy_Dubs 10 หลายเดือนก่อน

    In these examples are you removing the jumper for the pwm motor driver pins or not?

  • @albertbuzek5007
    @albertbuzek5007 5 ปีที่แล้ว +1

    Why are the pins that change the directions of the motor written in the code as inputs? aren't they sending a signal instead of receiving?

  • @mhzxtal922
    @mhzxtal922 6 ปีที่แล้ว +1

    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.

  • @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

  • @danwii4820
    @danwii4820 2 ปีที่แล้ว

    could the joystick be replaced by a receiver for wireless input. Great video btw :)

  • @luispires6935
    @luispires6935 5 ปีที่แล้ว +2

    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

  • @Mrjimmyboy727
    @Mrjimmyboy727 6 ปีที่แล้ว

    Great tutorial. Thank you! Can be added collision sensor switch module to last project ( L298N+Joystick)?

  • @lethaldriver
    @lethaldriver 5 ปีที่แล้ว +1

    Can this be used to run a DC motor with higher voltages such as 72 volts and 100amps or higher?
    what can be done to make it work?

    • @vaibhavgeek
      @vaibhavgeek 5 ปีที่แล้ว +1

      I am looking for the same answer. Please let me know if you find answer to your problem.

    • @2305989
      @2305989 5 ปีที่แล้ว

      100 Amps is way too high and some motor drivers like sabertooth are there which can provide around 60 amps but they cost a lot. So check for a motor driver which supplies your required current

    • @lethaldriver
      @lethaldriver 5 ปีที่แล้ว

      @@2305989 I was thinking that this can be used to control MOSFETS and not motors. And so for the high AMPS, the MOSFETs should be able to handle those.

  • @ricardooliveira4546
    @ricardooliveira4546 6 ปีที่แล้ว

    Valeu um Link e uma inscriçao, Parabens pelo video

  • @visionaryrobotics4065
    @visionaryrobotics4065 5 ปีที่แล้ว

    Great video,what did you use for a 12v power supply?

  • @drosophilamel
    @drosophilamel 4 ปีที่แล้ว +1

    Is it possible to make it turn into an autonomous car?

  • @TBoySpace
    @TBoySpace 2 ปีที่แล้ว

    @howtomechatronics Please what software or program did you use in creating the electrical connection animation?

  • @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.

  • @ahmadhafiz4567
    @ahmadhafiz4567 5 ปีที่แล้ว +1

    is it works If i use 12V battery and attach two 6v dc motor? please explain why?

  • @mmejiam
    @mmejiam 4 ปีที่แล้ว

    Are you using protected 18650 batteries?

  • @qolbola_bilimuz4424
    @qolbola_bilimuz4424 4 ปีที่แล้ว

    can we connect 3 DC motors to L298 and connect it to Arduino?

  • @betahex3589
    @betahex3589 3 หลายเดือนก่อน

    Won’t reducing the voltage also reduce the torque?

  • @EagleDescent
    @EagleDescent 2 ปีที่แล้ว

    How did you connect the jumper wires to the battery bay and Arduino board?

  • @sebastian19878
    @sebastian19878 7 ปีที่แล้ว +2

    Does it Works with a l293d too?

  • @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