Weird random 28byj-48 stepper motor behaviour

I've been using these little (28byj-48) stepper motors for years, with great joy and succes.

But this week something happend that I can't explain and can't find here.

The problem is that when the Arduino starts the motor "randomly" chooses a direction to turn in,
most of the times (66%) it gets it right but then suddenly it turns the reverse direction on start.

Also now the motor turns in the reverse direction when the load gets too big, where it used to just stall or miss steps.

This is the code I usually start with (and is working in a lot of projects):

#include <Stepper.h>
const int stepsPerRevolution = 2048;
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);

void setup() {
  myStepper.setSpeed(12);
}

void loop() {
  myStepper.step(stepsPerRevolution);
  delay(1000);

  myStepper.step(-stepsPerRevolution);
  delay(1000);
}

I've been buying these motors for years and have tested both old and new versions of the motors and boards. With the same result.
I'm using the same 7.5V 0.35A power supply with a common ground to the Arduino.

Am I missing something or has the stepper.h lib changed?

Hope someone can point me in the right direction (no pun intended).

Cheers

Not familiar with your motors. Is 350mA sufficient.

These are cheap motors made by a variety of manufacturers, some may be sub-standard in construction
and misbheave, and I'd expect variation in the winding resistance between models and in pinout/wire colours.

  1. Check its not just that motor
  2. Check the power supply isn't struggling and dropping out
  3. Check the thing is wired up correctly (this is hard to do with a 5-wire motor, trial and error is
    probably needed).