# My stepper motor isn't working properly( its taking less steps then it should)(Arduino)

#### filipmr

Joined Jan 2, 2021
64
So I used a stepper motor in the past, and it worked as it should, but today I used it again, and I set it up to have 360 steps in a revolution, but when I say motor.step(90) it steps 15(I estimate ), and when I put step(1000) it stepped 180. Is my motor broken or what? I hooked it up like this: https://osoyoo.com/wp-content/uploads/2017/07/stepper_fritzing.jpg

#### bertus

Joined Apr 5, 2008
21,449
Hello,

Looking at the drawing, you are powering the steppermotor is powered with 5 Volts.
What is the stepper motor data?

Bertus

#### filipmr

Joined Jan 2, 2021
64
Hello,

Looking at the drawing, you are powering the steppermotor is powered with 5 Volts.
What is the stepper motor data?

Bertus
What do you mean with stepper motor data? I am a beginner, so i am not sure. This is my code:
C-like:
#include <Stepper.h>
int motorPin1=8;
int motorPin2=9;
int motorPin3=10;
int motorPin4=11;

Stepper motor(360,motorPin2,motorPin4,motorPin3,motorPin1);
void setup() {
motor.setSpeed(75);

}

void loop() {
motor.step(1000);
delay(1000);
// motor.step(-100);
}
I put motor.step(-100) in // beacause I was testing if that was the problem.

#### filipmr

Joined Jan 2, 2021
64
Btw a few hours ago my motor didn't want to go in one side, but it worked perfectly in the other.

#### bertus

Joined Apr 5, 2008
21,449
Hello,

What is the motor voltage and current?

Bertus

#### filipmr

Joined Jan 2, 2021
64
I know that the voltage is 5V, but I am not sure about the current, I am trying to find documentation online on my stepper(model 28byj-48 ). Thank you

#### bertus

Joined Apr 5, 2008
21,449
Hello,

Strange the current is not given, but it will be in the range of 100 mA.

Bertus

#### Attachments

• 192.7 KB Views: 4

#### filipmr

Joined Jan 2, 2021
64
Yeah, I am pretty sure that all of the connections are good.

maybe my motor is just "dead"

#### bertus

Joined Apr 5, 2008
21,449
Hello,

Is the powersupply for the 5 Volts stable?

Bertus

#### filipmr

Joined Jan 2, 2021
64
I'm pretty sure that it is. Thanks for your effort btw

#### shortbus

Joined Sep 30, 2009
8,708
First off, the 5Volts may work OK if it isn't moving a load. A 20V power supply would give much better proformance from a 5V stepper motor. The thing about steppers is the current is much more important than the voltage on them. The voltage rating comes from having one coil activated with no stepping at all.

Now to why it's not moving the way you are expecting. That motor has a built in gear box, see how the output shaft is offset? It has a 64 to 1 gear reduction, so it will take 4096 steps to go a full 360 degree rotation.
Steps= (360°/5.625°) * 64 = 4096 steps
From - http://embark360.weebly.com/byj48-stepper-motor.html

Joined Jul 18, 2013
23,357
The rated voltage is OK for up to a few hundred RPM, as the inductive reactance increases, and hence current decreases, the torque starts to drop fairly rapidly.
A much higher P.S. voltage is required for higher RPM, in order for the drive to automatically control the plate rated current of the motor to a constant level. Neither higher or lower.
Max.

#### MrSoftware

Joined Oct 29, 2013
2,015
You're missing steps. If the controller tries to step too fast, the motor will skip steps. First try adding a longer delay between steps. I'm not familiar with the library you're using, but it's likely the SetSpeed() parameter when you setup the controller.

edit --> Google shows me your setSpeed() call sets the max speed in RPM, 75 is pretty low and I would think should be OK.

Second try boosting the voltage to the stepper motor. It's OK to go a little above the rated voltage for the motor. Heat is what kills electric motors. Heat comes from current. In this case it's the average current you're worried about, and since the steps are just a little blip of current, your average current will be very low.

Third do you have anything attached to the stepper that has mass? Try just a piece of tape so you can see it spin.

#### drc_567

Joined Dec 29, 2008
1,135
One way to insure a precise step waveform is to insert a forward biased schottky diode in each of the stepper motor driver wires. ... Maybe this will improve performance.

Last edited:

Joined Jul 18, 2013
23,357
Quality stepper controller manufacturers such as Gecko for example, use the continuous rated current operation in all their drives throughout the rpm range of the motor.
Max.

#### BobTPH

Joined Jun 5, 2013
3,490
Everyone, please look at post #11 and read the second paragraph. The reason it is not moving the desired angle is because it is geared and requires over 4000 steps per rotation.

Bob

#### filipmr

Joined Jan 2, 2021
64
Thank you all, I will try all of the suggestion.

#### shortbus

Joined Sep 30, 2009
8,708
Everyone, please look at post #11 and read the second paragraph. The reason it is not moving the desired angle is because it is geared and requires over 4000 steps per rotation.

Bob
How come you get all of the likes for what I found out about the motor?

#### skdubey

Joined Mar 24, 2021
2

#### Papabravo

Joined Feb 24, 2006
16,486
What speed are you trying to run at? They cannot go from 0 velocity to a high rate without ramping up the mechanical velocity of the rotor. It sounds like all the pulses were sent but the mechanics could not keep up.