Controlling DC Motors with the L298N H Bridge and Arduino

Get more info about using the L298N at https://dbot.ws/l298nhbr
More projects and tutorials at https://dronebotworkshop.com
Pick the topic for my future videos – https://dbot.ws/dbnews

The L298N Dual H-Bridge Motor Controller is an inexpensive device which allows you to control two independent DC motors using 5 volt digital logic signals, such as the digital output pins of an Arduino. The L298N can also be used to control a single stepper motor or two sets of LED lighting strips.

In this tutorial we’ll learn how to control two 6-volt DC motors with the L298N.

First we will enlighten ourselves by learning a quick bit of the history of DC motors and discovering how they actually work. We will also learn what an “H-Bridge” is, how it works and how we can control the direction of rotation of a DC motor with it.

We will then quickly discuss the concept of Pulse Width Modulation, or PWM, as it is used to control the speed of DC motors. Don’t worry, it’s a lot easier than it sounds!

Then we will look at how the L288N H-Bridge module actually works, how to hook it up to a couple of motors and how to power it correctly.

Next we will connect the L298N Dual H-Bridge Motor Controller to an Arduino. Once that’s done we’ll run a motor demo sketch to put the device through its paces.

After the demo we will expand upon our sketch to allow a couple of potentiometers (connected to the Arduino’s analog inputs) to control the speed of each motor.

And now that we’ve become experts we will replace the potentiometers with a joystick and use it to control the motors. Just for fun we’ll use this setup to build an Arduino-driven car!

The L298N Dual H-Bridge Motor Controller is a very versatile device that is sure to find a lot of use in your robotics and IoT projects. Anywhere you want to make things move with an Arduino!

This is a long video, so if you’d like to jump ahead to a specific spot here is the table of contents:

What is a DC Motor & Where is it used? – 1:25
How does a DC Motor work? – 3:01
What is an H-Bridge? – 4:17
Popular L298N Interface boards – 5:25
L298N Module Pinouts and hookup – 6:49
Understanding PWM (Pulse Width Modulation) – 9:04
Testing the L298N without a controller – 9:58
Arduino Hookup to L289N – 13:28
Sketch 1 – Motor Control Demo – 14:53
Motor Control Demo – 19:29
Potentiometer Hookup to Arduino and L298N Module – 20:38
Sketch 2 – Two Potentiometer Control Demo – 21:38
Two Potentiometer Control Demo – 25:08
Joystick and Arduino Hookup – 25:43
Sketch 3 – Joystick Control Demo – 27:52
Driving our car! – 34:22

For more information and other great projects and tutorials please visit https://dronebotworkshop.com/ .

And if you enjoyed this video please like it and subscribe to the DroneBot Workshop YouTube channel!

source

You might be interested in