• Home
  • How & Why
    • Arduino
    • Leapmotion with arduino
    • Sensors/Modules
    • Basic Electronics
    • NodeMcu
    • LabView
    • MATLAB
    • Industrial Automation
  • Projects
    • arduino projects
    • Robotics
    • Brain Wave Decoder
    • EEG
    • Leapmotion with arduino
    • Circuit Diagrams
    • Electrical
    • Mechatronics
    • IEE Projects
  • Ideas
  • Startups
  • Videos
No Result
View All Result
No Result
View All Result

How to use L293d Module motor shield with Arduino

L293D Motor Driver

Why do we use l293d?

Hey, Welcome to the make it much tutorials point.It’s the 4th one in the series of Arduino Learn by Doing projects series.So Today we will learn about how to use a motor Shield with Arduino. How to drive the motor with the motor driver.And How to use L293d motor driver module/shield with Arduino.
I have used this shield for making a remote control robot that I will show to at the end.We can easily control 4 motors with this driver module.Before moving towards the detailed study and use about l293d Module read these posts about:


Why we use Motor driver 

Contents:

  1. Introduction to L293D motor shield
  2. L293D motor shield Pinout Configuration
  3. Components List for L293d motor shield
  4. Arduino Code for L293d Motor driver Shield

Introduction to L293D Motor Shield

L293D is a Motor driver IC used to control motors with a microcontroller. This motor shield consists of three IC’s. We can control 4 motors with the shield so there are two L293d Ic’s used. The motor shield is used for (Arduino Uno) board.This shield can control servo’s, Dc motors and stepper motors.

The two chips of  L293D can control four motors with 0.6 A per bridge. The best thing about the shield is we don’t need to write the whole function for driving a motor there is a special library for this module.we just recall some commands to run the motor.

The shield is created by Adafriut so you can read more specifications about the motor shield on adafruit website

L293D Motor Shield Pinout Configuration

Here is the Pinout Configuration of the Module. Install the shield first on Arduino board and check everything that works fine. The four pins for Dc motors on Left and Right side. We can also connect stepper motors on these pins.

 

The Motor driver shield comes with 600 mA per motor and 1.2 A peak current.

The motors can be controlled from 4v to 25 volts.

Components List

  • Arduino Uno Board
  • Adafruit motor shield
  • Jumper wires
  • DC or stepper motors
Install the Library From this Link:

 Download L293d Motor Shield Library

https://github.com/adafruit/Adafruit-Motor-Shield-library/zipball/master

Arduino Code

When you install the library there will be different codes available in the library for controlling motors. Include the desired library in the code.

Here is the testing code for DC motors. The testing code is also available for servo and stepper motors.

In the library, we don’t need to define anything everything has already been defined. Just call the function Forward the motor will start working forward.Same for reverse and so on.

We can set the speed of the motor using command setSpeed(speed).The speed will be from 0-255.

We can also use this command for separated functions.In the testing code, the same speed is set for four motors.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <AFMotor.h>
AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
void setup() {
Serial.begin(9600);           // set up Serial library at 9600 bps
Serial.println("Motor test!");
 
motor.setSpeed(200);     // set the speed to 200/255
}
void loop() {
Serial.print("tick");
 
motor.run(FORWARD);      // turn it on going forward
delay(1000);
Serial.print("tock");
motor.run(BACKWARD);     // the other way
delay(1000);
 
Serial.print("tack");
motor.run(RELEASE);      // stopped
delay(1000);
}

 

Test the Code and Connections.If you found any problem using the motor shield then comment below.
Using only the Module for driving motor like L298N  is rather easier but we need to define each and everything where we connect motor pins on Arduino and which pins are used for Enable to control the speed.Somehow it is easier.
Read the Next post on How to make a Remote control Robot/CAR with L293D module.
Here is the picture of an upcoming post about Remote control Robot.
Comment below if you have any query and Subscribe to our YouTube Channel for Video tutorials.

 

Share248Tweet155SendShareShare43Pin56

Mak

Mechatronics Engineer - Entrepreneur - Solution Architect Love writing & Traveling - Being Average isn't a Choice Stay Happy - Live in Freedom & Always have Faith on Yourself...

Related Posts

Ideas

Mechatronics Projects for Final Year students with Industrial Aspect

January 30, 2021
Arduino

Top 10 Arduino Based Projects For Final Year Students | Arduino project ideas

January 30, 2021
Arduino

How to control (LDR) Light Dependent Resistor with Arduino | LDR Circuit

January 30, 2021

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Most Recent

Top 10 Best Ideas for business from home | Profitable Ideas

January 28, 2021

Fast & Furious Arduino Line Follower | PID Controller Basics

February 1, 2021

Rural Startups Ideas | Business ideas with low investment and high profit

February 1, 2021

Unique Agriculture Startup Ideas | Small Farming business ideas

January 30, 2021

Businesses that are Easy to Start Up | PRO-Startup Ideas

January 30, 2021

How & Why to Use DC Motors | How DC Motor Works

January 30, 2021

220v AC to 12v DC Power Supply Step by Step Project

February 1, 2021

Battery Level Indicator Circuit With Low Charge Alarm | Inverter Battery Circuit

January 30, 2021

Categories

  • Arduino (10)
  • arduino projects (8)
  • Basic Electronics (2)
  • Brain Wave Decoder (11)
  • Breadboard Circuits (1)
  • Circuit Diagrams (5)
  • Circuits (3)
  • EEG (11)
  • Electrical (3)
  • How & Why (1)
  • Ideas (23)
  • IEE Projects (2)
  • Industrial Automation (1)
  • Inspiration & Motivation (9)
  • IOT (3)
  • LabView (3)
  • Leapmotion with arduino (5)
  • MATLAB (1)
  • Mechatronics (8)
  • NodeMcu (1)
  • Projects (14)
  • Robotics (10)
  • Self Learning (7)
  • Sensors/Modules (6)
  • Soft skills (5)
  • Startups (8)
  • Success (4)
  • Home
  • Privacy Policy
  • About Us
  • Contact Us
E-mail: info@makeitmech.com

© 2021 Make it mech

No Result
View All Result
  • Home
  • How & Why
    • Arduino
    • Leapmotion with arduino
    • Sensors/Modules
    • Basic Electronics
    • NodeMcu
    • LabView
    • MATLAB
    • Industrial Automation
  • Projects
    • arduino projects
    • Robotics
    • Brain Wave Decoder
    • EEG
    • Leapmotion with arduino
    • Circuit Diagrams
    • Electrical
    • Mechatronics
    • IEE Projects
  • Ideas
  • Startups
  • Videos

© 2021 Make it mech

Exit mobile version