Controlling DC Motors with the L298N H Bridge and Arduino

preview_player
Показать описание
In this video, I'll show you how to use the L298N H-Bridge Motor Controller with an Arduino. Includes plans for a simple robot car.

The L298N Dual H-Bridge Motor Controller is an inexpensive device that 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:

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

And if you enjoyed this video please like it and subscribe to the DroneBot Workshop YouTube channel!
Рекомендации по теме
Комментарии
Автор

Your channel is severely underrated, you explain things very concisely, as someone with very little knowledge of electronics, I appreciate your work.

davidbergaragonzalez
Автор

wow this guy is brutally descriptive, I love this channel already i wish i could give this video a 1000 likes. now i understand what is PWM. this video hit the spot on my quest for knowledge. Keep making videos like this, i have subscribed.

Nelsonswl
Автор

Absolutely outstanding video! you didn't skip any detail while keeping it professionally presented. Thank you so much for this <3 liked and subbed.

Matthew-tujq
Автор

You are just awesome. No words can describe how good this video is.! Thank you. You helped me a lot

faysalahmmed
Автор

I'm in love with that workshop. It is very well organized.

julioduran
Автор

I've watched and learned so much for your channel. Have been coding and working on hardware projects for a few years now, and still find my way back here. You rock.

randalltockes
Автор

Nicely done. Very easy to understand and follow your sketches. You have a rare ability to explain the concepts in an easy to understand way without talking down to your audience. Thank you and hope to see much more.

markzickefoose
Автор

This video is so informative, you need nothing else but this to understand how to use different motor drivers

general
Автор

2nd time i end up on your channel, 2nd time i'm impressed by the quality and clarity of the information. nice work!

jean-valerythoraval
Автор

This channel turned to be my favourite in a couple of hours. Thank you!

stefanoaltavilla
Автор

great video as usual.
love the way you systematically divide larger projects up into functional nibblets and then concisely and clearly communicate them with sufficiently high production value.
keep it up !!

mandelbro
Автор

This is the explanation I have been looking for. You covered all the little details thoroughly enough to give a newbie like the confidence to get started. I'm so happy I found your channel.

jdoc
Автор

I liked this project. I'm working as an English teacher in Moscow and some 12 to 16 y.os have no interest in learning English. Then neither did I at that age. Some of them are very bright and they start getting physics in school at about 13
So I want to teach them how to build a whole series of simple electric motors. This will be the perfect way to introduce them to the Arduino!!!

stargazzn
Автор

You are the best instructional video maker on the internet. Believe me, I've looked. You are truly a treasure.

acadman
Автор

To skip values < 9, you can speed=map(speedStick, 0 1023, -247, 247); the same as below, and analogWrite (enable 8+abs(speed));

byronwatkins
Автор

This channel has got some serious potential to get alot of subscribers! Please make more videos! Subbed

Kingwinyoutube
Автор

One of the best channels on Arduino and electronics. Congratulations!

joaquimferreira
Автор

Excellent explanation, organised and great presentation skills. You deserve a huge following, keep it up please it is greatly appreciated!

wedoourbest
Автор

Really thank you sir, I was not knowing all this until it got watched this. Thank again!!

adityaagarwal
Автор

Wow what a clean workbench! Good video.

jamescullins