You are on page 1of 3

technology workshop craft home food play outside costumes

How to use the L298 Motor Driver Module - Arduino Tutorial


by codebender_cc on August 9, 2015

Table of Contents

How to use the L298 Motor Driver Module - Arduino Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: How to use the L298 Motor Driver Module - Arduino Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: What you will need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: The Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3: The Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4: Well done! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

http://www.instructables.com/id/How-to-use-the-L298-Motor-Driver-Module-Arduino-Tu/
Author:codebender_cc author's website
Arduino Tutorials by Codebender.cc Team

Intro: How to use the L298 Motor Driver Module - Arduino Tutorial
This dual bidirectional motor driver is based on the very popular L298 Dual H-Bridge Motor Driver IC. This module will allow you to easily and independently control two
motors of up to 2A each in both directions.

It is ideal for robotic applications and well suited for connection to a microcontroller requiring just a couple of control lines per motor.

In this tutorial you will learn how to use it with Arduino uno to control two dc motors.

Step 1: What you will need


For this project you will need:

Arduino uno
Breadboard
L298 Module
2x DC motors

http://www.instructables.com/id/How-to-use-the-L298-Motor-Driver-Module-Arduino-Tu/
Step 2: The Circuit
The connections are pretty easy!

Module 5V (or Vcc) - Arduino 5V pin


Module GND - Arduino GND pin
Module 12V (or Vbat) - To external power source up to 35V.
For this tutorial just connect it with Arduino Vin pin.

Module output 1 & 2 - Connect dc motor A


Module output 3 & 4 - Connect dc motor B

Module IN1 - Arduino pin 5


Module IN2 - Arduino pin 6
Module IN3 - Arduino pin 10
Module IN4 - Arduino pin 9

Step 3: The Code


Here's the code, embedded using codebender!

Try downloading the codebender plugin and clicking on the Run on Arduino button to program your Arduino with this sketch. And that's it, you've programmed your
Arduino board!

You can keep playing with that by clicking the "Edit" button and start making your own modifications to the code. For example try to combine parts of code to move both
motors simultaneously.
Try to use analogWrite(pin, PWM value) instead digitalWrite(pin, HIGH/LOW) to control the speed of motors!

Step 4: Well done!


You have successfully completed one more Arduino "How to" tutorial and you learned how to use the L298 motor driver IC module to control two dc motors with the
Arduino uno board.

I hope you liked this, let me know in the comments.

There will be more of them, so make sure to click Follow button!

Related Instructables

Build your first


Control DC and Arduino SELF Automatic air Arduino??
stepper motors Modules - BALANCING quality robot by L298N??????
with L298N Dual L298N Dual H- ROBOT by monitoring ThisIsSteve by jeffrey.sun
Motor Controller Bridge Motor UtkarshS7 cruise robot by
Modules and Controller by asygoogle
Arduino by Reichenstein7
tronixlabs

Advertisements

Comments

http://www.instructables.com/id/How-to-use-the-L298-Motor-Driver-Module-Arduino-Tu/

You might also like