25BYJ412-45 stepper motor command

Hi everyone,

I've been trying for the past three days to control a 25BYJ412-45 stepper motor using an H-bridge configuration with bipolar transistors applied to each coil, all controlled by an Arduino Uno (refer to attached schematic/figure). However, the motor only vibrates without rotating.

For testing purposes, I also tried using an L298N board, but I encountered the same issue. I am using this Arduino code (see attached), but so far, I haven't found any useful information online about commanding this specific type of stepper motor.

Has anyone had any experience with controlling the 25BYJ412-45 stepper motor (or a similar model) using bipolar transistors? Any insights, guidance, or recommendations you could share would be greatly appreciated. Additionally, if you have any advice or best practices for commanding this type of stepper motor, it would be extremely helpful.

Thanks in advance for your help!

Stepper Motor datasheet
25BYJ412-45.pdf (115.1 KB)
![Sens cmd moteur avec Transistor|626x500]

electrical diagram
(upload://2RR1QHopqxAXsGcXWW46wk7bHu3.png)

Code

int IN1 = 8; // A 
int IN2 = 9; // A/
int IN3 = 10; // B
int IN4 = 11; // B/

void setup() {
  pinMode(IN1, OUTPUT); 
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
}

void loop() {
  //step_1
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
  delay(100);
  
  //step_2
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);
  digitalWrite(IN3, HIGH);
  digitalWrite(IN4, LOW);
  delay(100);
  
  //step_3
  digitalWrite(IN1, LOW);
  digitalWrite(IN2, HIGH);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, HIGH);
  delay(100);

  //step_4
  digitalWrite(IN1, HIGH);
  digitalWrite(IN2, LOW);
  digitalWrite(IN3, LOW);
  digitalWrite(IN4, HIGH);
  delay(100);

}

Check if the wiring is correct. You may also try lowering the speed.

This a low impedance (5 ohm/3volt) motor, and should be driven with a chopper driver, not with a common (L298) H-bridge. Use a 12volt supply and an A4988 or similar driver, and adjust it to about 0.6Amp before connecting the motor. Use a stepper library, like AccelStepper or MobaTools.
Leo..

Try switching the wires on pins 9 and 10.

Thank you for you for your response :slight_smile:
How can I make the speed lower ? By increasing the 'Delay' period ?

The speed in the posted sketch is fairly low. A delay of 100ms after each step means 10 steps / sec. It doesn't make sense to lower it further.
There may be a HW issue. A current controlling stepper driver as suggested by @wawa could be a solution.

I cannot see any schematic.

Thak you @MicroBahner for your response.
I have made my schematic base of this figure:


The base of T1 and T1' are connected to pin 8
The base of T2 and T2' are connected to pin 9
The base of T3 and T3' are connected to pin 10
The base of T4 and T4' are connected to pin 11
Im using PN2222ABU as T1, T2, T3 and T4 NPN transistors
Im using PN2907ABU as T1', T2', T3' and T4' PNP transistors
Im using 1N5819 as free wheeling diode

That's useless. We need an schematic exactly how you wired your Arduino-Driver-Stepper.

Thanks @JCA34F for your response, I don't see the need to switch the 9 and 10 wires, but i conduct this change and i have a CC during one of the four steps of motor command.

I don't think that will work. E.g. T1 and T1' must be switched on simultaneously to let current flow through the coil. But you cannot switch both on (NPN and PNP), if their base are connected to the same pin.

How did you wire the L298 and how did you power it?