7A Dual DC Motor Driver SKU: DRI0041

Introduction

This is an ultra small Dual DC motor driver for some room limited projects. UVLO (Under Voltage Latch-Out) features a safe guard for your system. It is very considerate to own an Photo Coupler isolation for all the signals in case of that the motor's Reverse Current would interfere the control signals. Besides all, all the interfaces includes ESD (electro-static discharge) protection.

Specification

Dimension

Board Overview

DFR0041_overall.png

Num Label Description
1 9 - 24V Power Supply, +
2 PGND Power Supply, GND
3 OUT1 Motor1_+
4 OUT2 Motor1_-
5 OUT3 Motor2_+
6 OUT4 Motor2_-
7 ENA Motor1 PWM
8 IN1 Motor1 control signal
9 IN2 Motor1 control signal
10 ENB Motor2 PWM
11 IN3 Motor2 control signal
12 IN4 Motor2 control signal
13 +5V Voltage Reference Input, +5V OR 3.3V

Control Method

IN1 IN2 ENA/ ENB Motor1/2 Behavior
0 0 x Stop (brake)
1 1 x Vacant
1 0 1 Forward 100%
0 1 1 Reverse 100%
1 0 PWM Forward at PWM speed
0 1 PWM Reverse at PWM speed

In this table

Note:

IN1 & IN2

To protect your motor, before switching the motor steering direction, make sure firstly to BRAKE motor by setting IN1 - 0 & IN2 - 0, especially when the PWM was set as 100%, full speed. And the suggestion time to brake is >0.1S, depending on your motor.

+5V

When the microcontroller operation voltage is 5V/3.3V, then please connect the reference voltage 5V/ 3.3V from the microcontroller. Or you will fail to control motors.

Tutorial

This tutorial will cover how to use PWM to control a motor using the shield. Do the wiring according to the Connection Diagram below, and then upload the sample code below to the Arduino card, here we use a arduino UNO as the controller, you could see your motor run forward for 3 second and then run reversely for another 3 seconds and repeat this behavior then.

Requirements

Connection Diagram

DFR0041_conection_with_mc.png

Back view, conductive layer

Facility Safety and the Personal Safety: Please add a fuse@20A between the Power source and this shield.

Installation Tips

The backside of the driver, as right-hand picture shows, that its conducting layer can be very wide, so you should take some measurements to ensure it won't short-circuit, like applying 1mm layer conductive epoxy or any other similar materials.

Pluggable Connector

You may find that the connector is designed as pluggable type to adapt with Male or Female wires.

pluggable connector

Sample Code

/*
* @file Motor driver DRI0042_Test.ino
* @brief DRI0042_Test.ino  Motor control program
*
* control motor positive inversion
*
* @author bernie.chen@dfrobot.com
* @version  V1.0
* @date  2016-8-10
*/
const int IN1=5;
const int IN2=4;
const int ENA=6;

const int IN3=8;
const int IN4=7;
const int ENB=9;

void setup() {
     pinMode(IN1, OUTPUT);
     pinMode(IN2, OUTPUT);
     pinMode(ENA, OUTPUT);

     pinMode(IN4, OUTPUT);
     pinMode(IN3, OUTPUT);
     pinMode(ENB, OUTPUT);
}

void loop() {
 Motor1_Brake();
 Motor2_Brake();
 delay(100);
 Motor1_Forward(200);
 Motor2_Forward(200);
 delay(1000);
 Motor1_Brake();
 Motor2_Brake();
 delay(100);
 Motor1_Backward(200);
 Motor2_Backward(200);
 delay(1000);
}

void Motor1_Forward(int Speed)
{
     digitalWrite(IN1,HIGH);
     digitalWrite(IN2,LOW);
     analogWrite(ENA,Speed);
}

void Motor1_Backward(int Speed)
{
     digitalWrite(IN1,LOW);
     digitalWrite(IN2,HIGH);
     analogWrite(ENA,Speed);
}
void Motor1_Brake()
{
     digitalWrite(IN1,LOW);
     digitalWrite(IN2,LOW);
}
void Motor2_Forward(int Speed)
{
     digitalWrite(IN3,HIGH);
     digitalWrite(IN4,LOW);
     analogWrite(ENB,Speed);
}

void Motor2_Backward(int Speed)
{
     digitalWrite(IN3,LOW);
     digitalWrite(IN4,HIGH);
     analogWrite(ENB,Speed);
}
void Motor2_Brake()
{
     digitalWrite(IN3,LOW);
     digitalWrite(IN4,LOW);
}

FAQ

Q. General Arduino Problems/FAQ/Tips

A. Click the topic link on DFRobot Forum.

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.

More Documents

DFshopping_car1.png Shopping from 15A Single DC Motor Driver or DFRobot Distributor.

Category: DFRobot > Sensors & Modules > Motors & Actuators & Drivers > DC Motor Drivers

Turn to the Top