Introduction
This DC Motor Driver can be used in 4WD mobile robot platforms, combat robots, smart car competition, to drive pumps, electric fans, conveyors, etc. This module uses 4 high-performance & high-current driver chips - BTS7960 with the function of current short, over temperature, over voltage protection. You can control 2 motors with only 4 digital IO at the same time. Dual 15A@13.8V max output current, good responsiveness & braking performance. Four indicator leds are provided for easy and convenient debugging without motors. This DC Motor Driver module is directly compatible with Arduino.
Specification
- Input Voltage: 4.8-27V
- Maximum output current: 15A@13.8V per channel
- Peak output current: 20A@13.8V per channel
- PWM capability: up to 25 kHz
- Interfaces: 4 digital IO (2 PWM output include)
- Driving mode: Dual high-power H-bridge driver
- Other specifications:
- Galvanic isolation to protect the microcontroller
- Dual current detection diagnostic functions
- Short circuit, overheating, over-voltage protection
- Size: 73×68×14mm
- For applications of more than 15A per channel
- Fast switching might damage the board, best to smooth it by software
- Avoid higher rating motors, and use lower PWM whenever possible
Tutorial
Diagram
LA_IS, LB_IS, RA_IS & RB_IS is for current sense and diagnosis.
In normal operation, the IS pin output a low level. In a fault condition, it will output a high level. The following code will show you how to do.
- LA_IS and RA_IS is used for Motor1
- LB_IS and RB_IS is used for Motor2
Sample Code
PWM mode
PLL mode
DRI0018 motor drive also support PLL control mode. Data is as follows:
Pin | Function |
---|---|
4 | motor 1 enable control |
5 | motor 1 direction control |
6 | motor 2 direction control |
7 | motor 2 enable control |
"PLL mode"
Demo data:
//Standard DLL Speed control
int E1 = 4; //M1 Speed Control
int E2 = 7; //M2 Speed Control
int M1 = 5; //M1 Direction Control
int M2 = 6; //M1 Direction Control
//When m1p/m2p is 127, it stops the motor
//when m1p/m2p is 255, it gives the maximum speed for one direction
//When m1p/m2p is 0, it gives the maximum speed for reverse direction
void DriveMotorP(byte m1p, byte m2p)//Drive Motor Power Mode
{
digitalWrite(E1, HIGH);
analogWrite(M1, (m1p));
digitalWrite(E2, HIGH);
analogWrite(M2, (m2p));
}
void setup(void) {
int i;
for(i=4;i<=7;i++)
pinMode(i, OUTPUT);
Serial.begin(19200); //Set Baud Rate
}
void loop(void) {
if(Serial.available()){
char val = Serial.read();
if(val!=-1){
switch(val){
case 'w'://Move Forward
DriveMotorP(0xff,0xff); // Max speed
break;
case 'x'://Move Backward
DriveMotorP(0x00,0x00);
; // Max speed
break;
case 's'://Stop
DriveMotorP(0x7f,0x7f);
break;
}
}
}
}
Data function: input "w", "x", "s": motor will have corresponding reaction.
Trouble shooting
More question and cool idea, visit DFRobot Forum