# Stepper Motor doesn't work

**URL:** <https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877>\
**Category:** Motors, Mechanics, Power and CNC\
**Created:** [August 14, 2024, 8:18pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877 "2024-08-14T20:18:08Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 14, 2024, 8:18pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/1 "2024-08-14T20:18:09Z")

</div>

I'm using 28BYJ-48 stepper motor from the arduino mega project kit along with a ULN2003APG stepper Motor driver. I attached all the hardware correctly as a copied it exactly from the manual, and a YouTube video. I used a multimeter on the battery and it's not dead, so I'm not sure what the issue is. Here's the code I used:

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/5/5/e/55e2931b359e712b01c1b7fe7102544f0a24ee25.png)

If this helps, I added the serial.print command at the end because I noticed that it took around 6 seconds to get a response from the serial monitor when I had the mystepper.step command, compared to when I didn't.

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 14, 2024, 9:32pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/2 "2024-08-14T21:32:20Z")

</div>

Your code works... all the pins "output" and "2048" shows about every six seconds.

Check your wiring.  
Check your polarity of your battery and motors.  
Do you see lights on the motor driver?

You should post your code as text in a code block, not as an image.

> [@How to get the best out of this forum](https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966):
>
> See also [FAQ - Arduino Forum](https://forum.arduino.cc/faq) for general rules on forum behavior and etiquette. Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frus…

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 12:04am UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/3 "2024-08-15T00:04:41Z")

</div>

Code:

```arduino
> #include <Stepper.h>
> int spr = 2048;
> int motSpeed = 10;
> Stepper myStepper(spr, 8, 10, 9, 11); 
> void setup() {
> Serial.begin(9600);
> myStepper.setSpeed(motSpeed);
> 
> }
> 
> void loop() {
> myStepper.step(spr);
> 
> Serial.println(spr);
> }

```

Polarity and wiring looks good, no lights on the motor driver. There is a light on the power source though, only because of the button beside it. Here is a photo if you'd like to take a look for yourself.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/9/1/4/9140b5ab79a60418b977ea289535df4a6b20d388.jpeg)

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 2:18am UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/4 "2024-08-15T02:18:08Z")

</div>

Are you getting 5vdc to the ULN2003? Check voltage at the breadboard VCC and GND rails (near the stepper motor). I suspect the 9VDC battery.

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 2:30am UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/5 "2024-08-15T02:30:39Z")

</div>

I am getting 0.623 volts from there

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [August 15, 2024, 2:43am UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/6 "2024-08-15T02:43:02Z")

</div>

- Dead battery.

- Use 6v directly i.e. 4 X AA batteries, use no breadboard power supply.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/0/3/a/03a4b849e879e263c886e659242cd8ffdf976452.jpeg)

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 3:12am UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/7 "2024-08-15T03:12:31Z")

</div>

When you get the 4xAA batteries (4 x 1.5 = 6vdc... or 5xAA = 5 x 1.5 = 7.5vdc), replace the sketch you are using with this sketch... the reason is, this sketch move backwards and forwards at 18 RPM, then 1 RPM for 2048 steps, rather than continually moving forward. It lets you see more than just movement.

```arduino
int stepperrev = 2048;

Stepper myStepper(stepperrev, 8, 10, 9, 11); // sequence
void setup() {
  Serial.begin(115200);
}

void loop() {
  myStepper.setSpeed(18); // RPM
  myStepper.step(stepperrev); // forward
  Serial.println(stepperrev); // 2048
  myStepper.setSpeed(1); // RPM - look at the pretty lights
  myStepper.step(-stepperrev); // reverse
  Serial.println(-stepperrev); // 2048
}

```

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 11:10am UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/8 "2024-08-15T11:10:48Z")

</div>

After taking out the power supply on the breadboard, where am I supposed to plug the 4 x AA batteries into? Also are you able to explain why it can't be 9V please?

---

<div class="post-metadata">

**Author:** ![cherk](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/cherk/32/217875_2.png) [@cherk](https://forum.arduino.cc/u/cherk)\
**Post date:** [August 15, 2024, 11:29am UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/9 "2024-08-15T11:29:35Z")

</div>

They are for smoke alarms............  
 ![PP3 NO2](https://europe1.discourse-cdn.com/arduino/original/4X/c/3/a/c3af9e3cdee1e34f6d6fed8bed95384eb1d5cb67.jpeg)

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 2:21pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/10 "2024-08-15T14:21:09Z")

</div>

> [@matthewgri](#):
>
> where am I supposed to plug the 4 x AA batteries into?

Plug the battery module into the UNL2003 (motor driver module) where you will see a "- +" (near the "5v 12v" jumper)

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 4:41pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/11 "2024-08-15T16:41:47Z")

</div>

I don't know where I'm supposed to add it. I used a circular shaped end of the cord, correct?

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/4/6/b/46b70d27556191c15a9076b561a597671b2fbeeb.jpeg)

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 5:14pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/12 "2024-08-15T17:14:13Z")

</div>

On the motor driver module, the two wires together (red and black) are for your power supply. From where are those red and black wires in the picture?

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 5:20pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/13 "2024-08-15T17:20:11Z")

</div>

They connect to the breadboard which connects to the power supply. I don't have a 4 x AA battery holder yet so it is still in place

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 5:22pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/14 "2024-08-15T17:22:11Z")

</div>

~~Make the motor power supply go straight to the motor power connections. Solderless breadboards are for low-power devices.~~

I see... you are using the breadboard power supply for the motor.

Use the breadboard power supply just for the low-power devices, and put the 4xAA power supply directly on the motor driver module.

Ensure grounds from each device and power supply meets on a bus-bar or a single point.

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 5:34pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/15 "2024-08-15T17:34:21Z")

</div>

The only device as of now I'm trying to power is the stepper motor and its driver module. How am I supposed to put the 4xAA power supply directly on the motor driver module?? You can use the other pictures for reference

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 5:40pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/16 "2024-08-15T17:40:37Z")

</div>

> [@matthewgri](#):
>
> 4xAA power supply directly on the motor driver module

~~The 4xAA power supply probably has bare wire at the end of the red wire and black wire. I like to cut a male-male jumper wire into two, then solder each piece of jumper to the power supply wires. That gives you male ends for the power supply and male ends for the motor driver module. Using two female-female DuPont jumper wires, connect red-male-pins together and black-male-pins together.~~

~~OR...~~

Cut one female-female DuPont jumper wire and solder the female pieces directly to the power supply red/black wires... you will have female pins on the power supply with male pins on the motor driver module.

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 6:18pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/17 "2024-08-15T18:18:41Z")

</div>

I do not have a solder machine

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 6:20pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/18 "2024-08-15T18:20:50Z")

</div>

For a temporary solution of mating two bare wires, strip enough wire from one end of each wire where you can put several twists in the pair that they stay together, then cover the bare wire with tape.

---

<div class="post-metadata">

**Author:** ![matthewgri](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@matthewgri](https://forum.arduino.cc/u/matthewgri)\
**Post date:** [August 15, 2024, 6:22pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/19 "2024-08-15T18:22:01Z")

</div>

Should I just get a new power supply module instead?

---

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [August 15, 2024, 6:35pm UTC](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877/20 "2024-08-15T18:35:17Z")

</div>

Your goal with electronics, and especially power transfer, is to have a "connector-free" connection. With off-the-shelf electronic devices you can "see" (measure) the voltage drop that occurs where connections are made. That is why "soldering" (or "crimping", if higher power and heat are involved) is required, or at the hobby level, recommended.

A soldering-practice-kit cost 10 dollars/pounds/euro and with practice under the lead of a good video or ten, you will make perfect solder connections... and save money buying purpose-built power supplies.

"Should I get a new power supply?" No. You should learn to make secure connections so you KNOW the power connection (or any connection) is not the issue.

However; If you want to buy more power supplies, that is your right.

[Next page](https://forum.arduino.cc/t/stepper-motor-doesnt-work/1291877.md?page=2)
