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


► 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. 

Visit for more Tutorials, Tips, Projects and How It Works videos:

Like my page on Facebook:

Add me on Google+:


View More: Cuocdoidanghien Education


  1. 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.

  2. 1. Hei, can i use powebank for powering driver and arduino?

    2. Or i powering arduino from 9v battry, and driver from 3 or 4 18650 to 12v driver

    Tell me 1 or 2?

  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.

  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"
    The Arduino NAno 33 i/o

  5. Our one motor is running slow and one is running fast enough though the speed of both motors in our code is the same.Can u please tell us how to resolve this issue now.?'s urgent!!

  6. 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?

  7. muy bueno gracias por compartir el código,,vídeo sin código es lo mismo que nada. Thanks for sharing.


Please enter your comment!
Please enter your name here