ULN2003 and steeper motor not working

I am trying a simple stepper motor example using the ULN2003 with a 28BYJ-48 steeper motor. I have set the speed to very slow so that when i connect the ULN2003 without the motor I can see the LEDs flashing in their correct order: CD, BC, AB, DA. However when I plug the motor in the LEDs all turn off and the motor does nothing. I have tried four different motors and four different ULN2003 boards. What am I doing wrong?

#include <Stepper.h>

const int stepsPerRevolution = 2048;

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

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

void loop() {
  myStepper.step(1);
  delay(500);
}

Hi,

"What am I doing wrong?"

Using a 9V battery.

Look at the figure below which is the battery voltage per elapsed time as a function of the drained current.

Using 9V with motor for 12V.
Look engine datasheet.
" 28BYJ48 pdf, 28BYJ48 Description, 28BYJ48 Datasheet, 28BYJ48 view ::: ALLDATASHEET :::

These batteries do not supply enough current that the motor needs.

Use an external 9V source.

Ruilviana,
Thanks for the useful response. However the motor is a 5v motor, I'll see if I can find an external power supply but the battery was a fresh one, so i'm still puzzled.
fig3

1 Like

If you remove the battery you can plug in a usb 5V adaptor into the USB port. That should power the motor

Jim
Thanks. That fixed it.

You are welcome
Have fun

Hi,

true,
in this datasheet it is 5V.
https://www.mouser.com/datasheet/2/758/stepd-01-data-sheet-1143075.pdf

Oh my goodness, you can't even trust datasheets anymore lol

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.