Interfacing KL23H251 motor using NJM2670D2-ND

Hi Everyone,

This is my very first electronics project and so please bare with me for this naïve question.

I have attached an arduino to a H-Bridge using the Bipolar Stepper Motor circuit configuration (Data sheet: (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=NJM2670D2-ND). I tested the circuit by attaching LEDs to the output pins using the following arduino program:

void loop() { digitalWrite(enablePin, HIGH); // sets the Enable ON digitalWrite(intA1B1Pin, HIGH); // Send HIGH to A1 & B1 pins digitalWrite(intA2B2Pin, LOW); // Send LOW to A2 & B2 pins delay(2000); digitalWrite(enablePin, HIGH); digitalWrite(intA1B1Pin, LOW); digitalWrite(intA2B2Pin, LOW); delay(2000); // waits for a two seconds }

The LEDs connected to OUTA1 & OUTB1 glow once every two seconds. As far as I understand my circuit matches the data sheet and behaves exactly as it is supposed to.

Now, I connect the KL23H251-24-8B stepper motor to the output pins. Series connection:

Green goes to OUTA1 Yellow/Red are tied together Blue goes to OUTA2

White goes to OUTB1 Orange/Black are tied together Brown goes to OUTB2

I am using an external DC power supply (HY3005) that provides an adjustable voltage (set to 9V initially).

I then change my arduino program to the following and start the execution: void loop() { digitalWrite(enablePin, HIGH); // sets the Enable ON digitalWrite(intA1B1Pin, HIGH); // Send HIGH to A1 & B1 pins digitalWrite(intA2B2Pin, LOW); // Send LOW to A2 & B2 pins delay(10); digitalWrite(enablePin, HIGH); digitalWrite(intA1B1Pin, LOW); digitalWrite(intA2B2Pin, LOW); delay(2000); // waits for a two seconds }

I hear a faint buzz inside the motor. The motor won't start. I tried with different connections and voltages. I noticed that the motor buzzes loudly for different settings. The H-Bridge is getting heated up if I increase the delay when the intA1B1is HIGH.

I checked all the voltages across the Vcc & ground and looks like everything is just fine... Its just that the motor doesn't work...??? It a brand new one....

Whats wrong with my setup Any suggestions?? Thanks.

I had a similar "buzzing" experience with a unipolar stepper and in my case it was because i hooked up the wires from the stepper in the wrong sequence. But i guess you doublechecked that already.

Are you sure you have the right voltage for the motor ?

Can your powersupply deliver the required current ?

Sometimes the ground from the motor powersupply has to be connected to the Arduino ground.

Sometimes the ground from the motor powersupply has to be connected to the Arduino ground.

That would be always. ;) Its a good habit to do even in isolated circuits.

I checked the circuits carefully. I somehow can't upload the circuit diagram. Please look at the first figure on pg5: I checked the circuits carefully. I somehow can't upload the circuit diagram. Please look at the first figure on pg5. (http://www.keyen.com.tw/product/NJRC/NJM2670.pdf)

Are you sure you have the right voltage for the motor ? Can your powersupply deliver the required current ? Yes, I connected the Vmm ground to the common ground. My external power supply is this: http://www.elexp.com/tst_3003.htm . I set the voltage to 9V? and increased it to even 30V. When I executed the test, I can see about 1.5AMPs on the voltage supply's current output. Unfortunately, all this current is being used to heat up the H-Bridge instead of turning the motor. The power supply is brand new (I got it at Amazon).

I wanted to try this circuit on a bread board, but I hesitated to do so because the motor can end up drawing more than 1Amp, which is more than what a typical bread board can handle. So, I checked my circuit with LEDs on a breadboard. The LEDs connected to OUTA1 & OUTB1 glowed once every 2 secs. I alternated the test with OUTA2 & OUTB2 and everything seemed fine.

I thought that this is good enough to go to the next step. I then soldered a prototype board and rechecked the circuit again with LEDs. Looked like everything just worked fine. Now I connected the motor only to realize that everything fell apart.

When I checked the voltage across the Chip pins, I see 5V on Vcc, and 9V on OUT1A & OUT1B? (off course whenever the intA1B1Pin is set to HIGH).

The problem is that the chip is getting heated up if I set intA1B1 HIGH for a long time. So, I tried with intA1B1 HIGH for 10ms with a LOW for another 2sec. This takes care of the heating problem, but the motor doesn't turn.

This makes me sure that my arduino – Hbridge circuit is fine but my motor connections are wrong? but I tried all permutations and combinations of the motors? it just doesn't work! Weird...

I guess I got it working. :)

Use the following sketch if anyone wants to interface with NJM2670

int enablePin  = 4;    // select the input pin for the potentiometer
int intA1 = 3;
int intA2 = 4;
int enA  = 5;
int intB1 = 6;
int intB2 = 7;
int enB  = 8;
int delayTime=20;
int slow = 0;

void setup() {
  pinMode(enA, OUTPUT);  // declare the ledPin as an OUTPUT
  pinMode(intA1, OUTPUT);  // declare the ledPin as an OUTPUT
  pinMode(intA2, OUTPUT);  // declare the ledPin as an OUTPUT
  pinMode(enB, OUTPUT);  // declare the ledPin as an OUTPUT
  pinMode(intB1, OUTPUT);  // declare the ledPin as an OUTPUT
  pinMode(intB2, OUTPUT);  // declare the ledPin as an OUTPUT
  shutdown();
}
void shutdown()
{
  digitalWrite(intA1, LOW);    // sets the LED off
  digitalWrite(intA2, LOW);    // sets the LED off
  digitalWrite(intB1, LOW);    // sets the LED off
  digitalWrite(intB2, LOW);    // sets the LED off
  digitalWrite(enA, LOW);    // sets the LED off
  digitalWrite(enB, LOW);    // sets the LED off

}

void loop() {
   //Step 1 Coil A +
  digitalWrite(intA1, LOW);    // sets the LED off
  digitalWrite(intA2, HIGH);    // sets the LED off
  digitalWrite(intB1, LOW);    // sets the LED off
  digitalWrite(intB2, LOW);    // sets the LED off
  digitalWrite(enA, HIGH);    // sets the LED off
  digitalWrite(enB, LOW);    // sets the LED off
  delay(delayTime);
  shutdown();
   delay(slow);
   
  //Step 2 Coil B +
  digitalWrite(intA1, LOW);    // sets the LED off
  digitalWrite(intA2, LOW);    // sets the LED off
  digitalWrite(intB1, LOW);    // sets the LED off
  digitalWrite(intB2, HIGH);    // sets the LED off
  digitalWrite(enA, LOW);    // sets the LED off
  digitalWrite(enB, HIGH);    // sets the LED off
  delay(delayTime);
  shutdown();
   delay(slow); 
  //Step 3 Coil A -
  digitalWrite(intA1, HIGH);    // sets the LED off
  digitalWrite(intA2, LOW);    // sets the LED off
  digitalWrite(intB1, LOW);    // sets the LED off
  digitalWrite(intB2, LOW);    // sets the LED off
  digitalWrite(enA, HIGH);    // sets the LED off
  digitalWrite(enB, LOW);    // sets the LED off
  delay(delayTime);
   shutdown();
   delay(slow);
   
  //Step 4 Coil B -
  digitalWrite(intA1, LOW);    // sets the LED off
  digitalWrite(intA2, LOW);    // sets the LED off
  digitalWrite(intB1, HIGH);    // sets the LED off
  digitalWrite(intB2, LOW);    // sets the LED off
  digitalWrite(enA, LOW);    // sets the LED off
  digitalWrite(enB, HIGH);    // sets the LED off
  delay(delayTime);
  shutdown();
   delay(slow);
}