Stepper Motor Circuit Not Working

I am so incredibly new to Arduino and breadboard circuits and I want to use my Arduino Uno to control a stepper motor. I have the following sketch and setup, but whenever I hit upload to Arduino, nothing happens. I'm sure I'm just overlooking something super simple, but was hoping to have another set of eyes catch it for me...



  • You cannot power a Stepper Motor from a 9v PP3 battery.

  • Those solderless breadboard power supply modules are not meant for high current loads.

Define “nothing happens”.
Does the code compile successfully?
Is the upload successful?

Hi, @kylejbickel
Welcome to the forum.

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

Can you please post your code in code tags as explained in the link above?

Have you been able to upload to that UNO previously with other code?

NOTE, Not your fault, but this is a UNO WiFi R4, different to 328 type controller UNO.

You have selected UNO R4 in the IDE?

Thanks... Tom.. :grinning: :+1: :coffee: :australia:

You cannot power a stepper motor from a 9volt PP3 battery (LarryD).

And you cannot power Vmot of a A4988 stepper driver with less than 8volt.
(the breadboard supply is set to 3.3volt).

Vmot of the A4988 should be 12volt, or even 24volt, regardless of stepper motor voltage.

Post a link to the stepper motor used.
Leo..

Your first attempt has several problems, some of which have already been addressed in previous posts.
Where did you get the sketch and setup from? I don't think the person who wrote this sketch knows much, if anything, about the AccelStepper library.

And don't post sketches as images - see advice from @TomGeorge

Hi @kylejbickel

welcome to the Arduino-Forum.

The microcontroller-world is not super-standardised like USB-devices.

You have to take care of more details than just "does the plug fit into the socket"

Reading datasheets is very important.

keep your stepper-driver A4988 alive:

Another thing that is important is:
Never connect / disconnect the motorwires when the power-supply is switched on.
You know these electric fences that give you an electric shock if you touch them?

The same thing happends to the step-motor-driver A4988 if you connect /disconnect the motorwires with power switched on.

The motorcoils are inductive loads and create high voltage spikes (just like these electric fences) if you disconnect a motorwire. This can destroy the A4988.

Tinkering with electronics and microcontrollers can be a lot of fun. I recommend that you ask a lot of questions here in the forum to gain the knowledge you need.

For learning in a safe way you can use the WOKWI-simulator.
Most things about programming-logic can be tested in the WOKWI-simulator.

use MobaTools instead of AccelStepper:

I recommend that you use the MobaTools-library instead of accelStepper.
Using the MobaTools will save you a lot of trouble if you go beyond a simple loop that just does rotate the stepper-motor.

With accelstepper you create either blocking code
or
your loop must always run very fast fast enough to create the next step-pulse at the right time.

The MobaTools avoid these problems through creating the step-pulses in the background.
This enables that your code can do other things in "parallel" to the step-pulse creation.
You can install the MobaTools from the library-manager in the Arduino-IDE

So here is a basic demo that shows how to drive a stepper-motor

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