BiPolar stepper motor works with only 3 wires instead of four

Items:

Problem: Motor runs in only one direction. Depending on the wires plugged in (which I understand why). But my bipolar motor won't run when all 4 wires are plugged in. When 3 wires are plugged in it rotates based on the code shown below. It only rotates on option 0 though.

#include <Stepper.h>

// change this to fit the number of steps per revolution

const int stepsPerRevolution = 48;

Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

int stepCount = 0; // number of steps the motor has taken

char data;

void setup() {

Serial.begin(9600);

myStepper.setSpeed(60);

displayInstructions();

}

/**

Displays instructions to user

*/

void displayInstructions() {

Serial.println("READY - PLEASE SEND INSTRUCTIONS AS FOLLOWING :");
Serial.println("\t0 : Send clockwise");

Serial.println("\t1 : Send counter-clockwise");

Serial.println("\t2 : Stop turning\n");

}

void loop() {

if (Serial.available()) {

data =` [`Serial.read`](https://Serial.read)`();

switch (data) {

// 0

case 48:

Serial.println("Running CW");

myStepper.step(stepsPerRevolution);

delay(500);

//runStepper(1);

break;

// 1

case 49:

Serial.println("Running CCW");

myStepper.step(-stepsPerRevolution);

delay(500);

//runStepper(-1);

break;

// 2

case 50:

Serial.print("Stopping");

Stop();

break;

}

}

}

void runStepper(int dirStep) {

Serial.println(dirStep);

while (stepCount < 500) {
Serial.print("steps:");

Serial.println(stepCount);

myStepper.step(dirStep);

stepCount++;
}

Stop();

}

void Stop() {

stepCount = 0;

Serial.print("Stopped");

myStepper.step(0);

}

Below is how everything is wired... I hope you can follow the image and the wires.

Wiring with all 4 wires plugged in. from left (Brown) to right(blue). B1-A => 8, B1-B =>9, GND => GND, power => power, A1-A => 10, A1-B => 11:

IMPORTANT: In the next photo I only remove the brown wire. Which is B1-A => 8. So only three wires are plugged in from ports 9-11. And it works in only one direction.

Excess info: The code basically rotates the stepper motor 1 whole revolution. And again. It works only when three wires are plugged in. But I want it to work when 4 wires are plugged in. Not sure why it isn't working when 4 wires are plugged. It won't rotate in the opposite direction when 3 wires are plugged in. It only rotates in one direction and only responds to an input of 0 in the serial monitor.

I can add more info if requested.

The picture is not useful. Please draw (by hand) and post a diagram of how things are connected. Be sure to label connections.

If you change motor wires with the setup powered, you will destroy the motor driver. Guaranteed.

Also, post a link to the motor driver product page.

Which motor wires correspond to which coils? The motor product page does not seem to indicate that.

Your driver needs to be referenced to Arduino GND.

Arduino GND driver GND.

Here's the power connection.

and here is the 3rd photo I tried to post where I simply remove one wire.

ummmm so it's running as mentioned before. It's just that it only runs when the three wires are plugged in.

The Arduino output pins need a ground return, connecting only the 4 outputs is not enough.

The return path for output currents need the Arduino GND connected to the driver GND.

As mentioned we need a schematic and a link to the driver.

ah is that why even though I can get the stepper motor to turn a full revolution at different speeds, it stutters when it turns?

Any good drawing tools I could use? Besides Microsoft paint?

Please confirm the the power supply is connected correctly.

It appears the power supply black wire (usually negative) is connected to the Vcc pin ? :scream:

A pencil and paper.

the black power is connected to power and the orange one to ground. I know, the colors don't match. i know the color standards aren't usual convention.

ok, i'll get something drawn later.

Hi,
Have you used a DMM to determine which wires of the stepper are paired to each of the coils in the stepper?

Tom.... :smiley: :+1: :coffee: :australia:

Ok update with pic of wiring and schematic.

This is the first time I've drawn a schematic. So let me know if it's not informative enough.

Your pictures are very confusing. In your first post, you wrote about a L9110 motor controller:

But on the pictures I see a ULN2003 board. And even more confusing, the ouputs of this board are connected to the UNO, and the inputs are connected to the stepper???
But anyway. You can't control your stepper with a ULN2003, you need an H-bridge like the L9110.

Hi, @bevpow

Your first post referred to L9110 driver, this is the correct driver for your stepper, so we need a circuit diagram of the project in post#1.

You will need to make sure that gnd of the UNO and gnd of the driver are connected.

Tom... :smiley: :+1: :coffee: :coffee: :australia:

Your connections to the Stepper Drive Board is WRONG :scream:



This is the correct way to power the PCB.

image

Don’t forget to add the switch jumper.

Not only the connections - the driver board itself is wrong. You cannot drive a bipolar stepper with this board.