Step motor 28BYJ-48

Hello, I'm new and my name is Marco :D I already had this type of step motor and it works perfectly. For a project, I had to buy more, but I buyed them from another online store. These new ones don't work, they only vibrate, as if the phase are in the wrong layout. The drive (with ULN2003) works. I can see that the wires have the same colours but they are in different order. Is there anyone who has already have this problem?

Try swapping pairs of wires until it works. Make sure the power is off while changing wiring, or you may destroy the driver.

I am experiencing the exact same problem with the servo motor in the Arduino Starter kit. Project 05 (Mood Cue) has us using a potentiometer to control the servo position. My servo dithers and vibrates but very little movement. I too am a very beginner into Arduino

They come in 5V AND 12V versions, make sure your voltage is correct.

Thanks for the answers. I tried to swap the wires in the same layout as the working step motor I already had. It works but not too good... It loses some steps or it stops and it vibrates. Probably I must find another layout of the wires. Furthermore, the motor works with 5V.

The wire colors may be misleading. Keep swapping pairs until it works.

Hi, This may be of help.

https://arduino-info.wikispaces.com/SmallSteppers

The RED wire will be the common connection to the two windings so it should stay connected to the +5V connection while you swap the others.

I have had the same problem with those steppers, the wiring code is not consistent, but I have found RED is always positive supply.

Tom.. :)

SamMcC: I am experiencing the exact same problem with the servo motor in the Arduino Starter kit. Project 05 (Mood Cue) has us using a potentiometer to control the servo position. My servo dithers and vibrates but very little movement. I too am a very beginner into Arduino

OP had a question about a stepper motor, not a servo motor.

Most problems with servo motors come from inadequate power supplies, e.g. 9volt smoke alarm batteries. Create your own thread if you want help with that. Leo..

Thank you, I think that these motors are not the best, because swapping the wires, a motor works perfectly, but other two work very badly (with the same swap of the wires).

Try this simple test sketch, type a number of steps in top of serial monitor and press [ENTER], change value of "dly’ to change speed (not lower than 3).

/* pin 8 to pin 1 on ULN2003, pin 16 to pink,   coilA
       9 to pin 2,                15    yellow, coilC
      10 to pin 3,                14    orange, coilB
      11 to pin 4,                13    blue,   coilD

   Type a number in top of serial monitor for steps to go,
    -32000 (CCW) to 32000 (CW), & press [ENTER].
*/
const byte stepNr [4] = {0b0001, 0b0010, 0b0100, 0b1000};
byte cntr = 0;
int stepsPerRev = 513, // 512 is not enough, 514 too many
    dlay = 40, // delay between steps, higher num, lower speed <<<<<<<
    stg; // steps to go

void setup()
{
  Serial.begin(9600);
  DDRB = 0x0F; // set pins 8,9,10,11 to OUTPUT
}

void loop()
{
  if (stg != 0)
  {
    PORTB = stepNr[cntr & 0x3] & 0x0F;
    delay(dlay);
    stg < 0 ? cntr-- : cntr++; // sets direction
    stg < 0 ? stg++ : stg--; // adds to or subtracts from stg
                             // depending on direction
  }  
    if (Serial.available() > 0)
    {
      stg =  Serial.parseInt();
      Serial.println(stg);
    }
  
}

because swapping the wires, a motor works perfectly, but other two work very badly (with the same swap of the wires).

DO NOT believe that the wire colors mean anything at all (the only unique wire is the common wire, which can be red).

Hi, Do you have a DMM? Can you measure the resistance between the RED wire and each of the others please?

Thanks.. Tom.. :)

Marco, yes I have had a similar problem. I have some of these motors from Kuman (via Amazon) and they come with ULN2003 driver boards.

Using the code supplied by the vendor to initialize the stepper library has a similar effect to what you describe.

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

Changing this line to the following fixes the issue:

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

This was pointed out in the reviews for the product so I was prepared for it.

This would have the same results as swapping wires so I don't know if this will help you.