In my recent project, I'm using DC motor driver 24V 20A[RKI-1340].

Motor Driver

After reading the manual of this I figure out information for this motor driver. Basically, this motor driver has 5 pins. Each has own functionality.

(1) 5V : Regulated 5V output from motor driver board (maximum 50mA supply)

(2) BRK : Breaking input to halt the motor in operations when 5V (logic high)

(3) PWM : Pulse Widht Modulation input to control speed of motor (recommended freq 20Hz to 400Hz)

(4) DIR : Pulled down to GND Forward by default and Backward when 5V (logic high)

(5) GND : Connect to GND on controlling board

Now, I connect this motor driver to my Arduino. My connection is like below:

Motor Driver : Arduino

5V - No connection with Arduino

DIR ---> Pin 4

PWM ---> Pin 5

BRK ---> Pin 6

GND - No connection with Arduino

And my code is like below:

const int kPinDIR = 4;
const int kPinPWM = 5;
const int kPinBRK = 6;

void setup()
  pinMode(kPinDIR, OUTPUT);
  pinMode(kPinBRK, OUTPUT);
  pinMode(kPinPWM, OUTPUT);

void loop()
  digitalWrite(kPinDIR, HIGH);   // Case 1
  digitalWrite(kPinBRK, LOW);

//  digitalWrite(kPinDIR, LOW);  // Case 2
//  digitalWrite(kPinBRK, HIGH);
//  digitalWrite(kPinDIR, LOW);  // Case 3
//  digitalWrite(kPinBRK, LOW);
//  digitalWrite(kPinDIR, HIGH); // Case 4
//  digitalWrite(kPinBRK, HIGH);

  analogWrite(kPinPWM, 255); 

As you can see that, I tried out 4 different case to run motor. But motor run only for first two case(case 1 & 2) and direction of rotation is same. And in other two case(case 3 & 4) motor is not rotating.

I don't understand that thing why case 1 and case 2 give same output. If I tried out logic according manual description means according manual DIR pin change the direction of motor's rotation. According that If I provide LOW logic(GND) to DIR pin then motor rotating in one direction and but If I provide HIGH logic(5V) to DIR pin then motor is not rotating. I tried every case(already written in my code) but motor is still rotating in same direction.

And here I provide supply to motor driver by regulated power supply. And for Arduino, it take supply through it's cable(cable is connected to LAPTOP).

Actually, I am trying to run Peltier module using this motor driver. I want to change Peltier's polarity using this. So, first I tried out with motor then If I succeed then I tried this one to Peltier. I think I have to connect GND of Motor Driver to Arduino's GND but I think it will my Arduino. I'm not sure about this GND connection between Motor Driver and Arduino. Please suggest me.

EDIT 1: My wiring is look like this.


simulate this circuit – Schematic created using CircuitLab

closed as off-topic by Chris Stratton, per1234, gre_gor, KIIV, AltAir Jan 10 '18 at 11:46

  • This question does not appear to be about Arduino, within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    I'm voting to close this question as off-topic because it is about an insufficiently documented motor driver and not about Arduino. – Chris Stratton Jan 1 '18 at 16:17
  • the motor may not be able to run in reverse. ... swap the wires to the motor and run Case 1. does it run backward? – jsotola Jan 2 '18 at 2:30
  • @ChrisStratton How it is off-topic? If you want to read the document of this motor driver then the link is above there. Just check it out. – Hasan Jan 2 '18 at 6:35
  • It's off topic because the question is really about the motor driver, not the Arduino. This is the Arduino site, not the motor driver site. – Chris Stratton Jan 2 '18 at 6:35
  • @jsotola I have another motor driver and it's working fine. But it has the limitation of 2 A current. That's why I used this motor driver but not able to drive motor in reverse direction. I don't want to swap wire physically. – Hasan Jan 2 '18 at 6:38

The motor driver's GND does need to be connected to the Arduino's GND so that the signal loop is complete. This won't break the Arduino.

  • I tried out your suggestion. But the problem is still there. Can't able to drive reverse motor. – Hasan Jan 1 '18 at 11:53
  • @Hasan What motor are you using? Please attach a wiring diagram or a photo and correct your question according to the new wiring diagram. – AltAir Jan 1 '18 at 12:32
  • PWM and Peltier – AltAir Jan 1 '18 at 12:42
  • @AltAir I'm using 9 V DC motor. But it is only testing purpose. Actually, I want to run Peltier means change Peltier's polarity. – Hasan Jan 2 '18 at 6:39
  • @Hasan on your electric scheme GNDs is not connected again. The motor spins in the opposite direction if you change the polarity manually on it? – AltAir Jan 2 '18 at 17:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.