Controlling 10A DC Motor Driver Using Arduino Nano

INTRODUCTION

 

Enhanced 10Amp DC Motor Driver (MD10C) is an enhanced version of the MD10B which is designed to drive high current brushed DC motor up to 13A continuously and 30A peak (for Rev3.0). It offers several enhancements over the MD10B such as support for both locked anti-phase and sign-magnitude PWM signal as well as using full solid state components which result in faster response time and eliminate the wear and tear of the mechanical relay.

How does MD10C work?

One of the features of MD10C is it supports both sign-magnitude and locked anti-phase PWM signal, means you can control motor in 2 different ways!

  • Sign-magnitude mode
    You require 2 separate signals to control the motor, one is for direction (counterclockwise or clockwise) and another is for the speed. To control motor direction, DIR pin is connected to HIGH or LOW for different direction, whereas PWM pin is fed with PWM signal to control the motor speed.
  • Locked anti-phase mode
    In this mode, only 1 signal is required to control both speed and direction of motor. PWM pin of MD10C is always connected to HIGH (5V), while DIR pin is fed with d to PWM signal. The direction of motor depends on whether the duty cycle of PWM signal is less than or more than 50%. The motor will run in one direction if the duty cycle is less than 50% and another direction if more than 50%. The motor stops if duty cycle is 50% (approximately). The speed depends on the percentage of duty cycle.
 

HARDWARE REQUIRED

 
 

SOFTWARE REQUIRED

 
 

CIRCUIT DIAGRAM (FRITZING)

  1. Connect all wires as show as below and lastly connect battery.
  2. This ciruit diagram is for sign magnitude mode and locked anti-phased magnitude

SIGN-MAGNITUDE MODE

  1. Program your Arduino nano with the following codes.
    const int pwm = 9; // pin 10 as pwm
    const int dir = 10;  // pin 9 as dir
    int i=0; 
    
    void setup(){
    
      Serial.begin(9600);
      pinMode(pwm,OUTPUT); //declare pin pwm as OUTPUT
      pinMode(dir,OUTPUT); //declare pin dir as OUTPUT
    
    }
    
    void loop(){
      //SIGN MAGNITUDE MODE  
      //Controlling motor with program set
    
       digitalWrite(dir,HIGH);  // if DIR pin is HIGH, B will HIGH ; if DIR pin is LOW, A will HIGH
    
      //from slow to fast
       for(i=0;i<=255;i++){		// from 0 to 255, increment one for every 0.5 second
       analogWrite(pwm,i);    //write 'i' value to PWM pin
       delay(500);
       Serial.println(i);
       }
    
       //from fast to slow
       for(i=255;i>=0;i--){  //from 255 to 0, decrement one for every 0.5 second
        analogWrite(pwm,i);  //write 'i' value to PWM pin
        delay(500);
        Serial.println(i);
        }
    
       while(1) continue;        //avoid loop
    }

     

LOCKED ANTI-PHASED MODE

  1. Program your Arduino nano with the following codes.
    const int pwm = 9;
    const int dir = 10;
    int i=0;
    
    void setup(){
    
      Serial.begin(9600);
      pinMode(pwm,OUTPUT);  //declare pin pwm as OUTPUT
      pinMode(dir,OUTPUT);  //declare pin dir as OUTPUT
    
    }
    
    void loop(){
      // LOCKED ANTI-PHASE MODE
      //control motor with program set
    
       digitalWrite(pwm,HIGH);		// always set PWM to HIGH
    
       for(i=0;i<256;i++){		//fast to slow, slow to stop, stop to slow, slow to fast
       analogWrite(dir,i);
       delay(500);
       Serial.println(i);
    
       }
    
       while(1) continue;        //avoid loop
    }