Everything in this code works great except for the stepper motor which just vibrates a little but doesn't spin

Every thing works except for the stepper motor which wont spin.
Thanks in advance .
these are the parts that I am using
MOVI Shield
MOVI - Audeme
Arduino Uno
Motor Driver
Stepper Motor Driver
Here is the Code :

#include "MOVIShield.h"     // Include MOVI library, needs to be *before* the next #include 
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_PIC32)
#include <SoftwareSerial.h> // This is nice and flexible but only supported on AVR and PIC32 architecture, other boards need to use Serial1 
#include <Stepper.h>
int servoPin = 9;
int motor1pin1 = 2;
int motor1pin2 = 3;

int motor2pin1 = 4;
int motor2pin2 = 5;
const int stepsPerRevolution = 500; 
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

MOVI recognizer(true);            // Get a MOVI object, true enables serial monitor interface, rx and tx can be passed as parameters for alternate communication pins on AVR architecture
void setup()  
   recognizer.init();      // Initialize MOVI (waits for it to boot)
 recognizer.callSign("Lazy"); // Train callsign Arduino (may take 20 seconds)
  recognizer.addSentence("Get me  water"); // Add sentence 1

   pinMode(motor1pin1, OUTPUT);
  pinMode(motor1pin2, OUTPUT);
  pinMode(motor2pin1, OUTPUT);
  pinMode(motor2pin2, OUTPUT);

  // Note: training can only be performed in setup(). 
  // The training functions are "lazy" and only do something if there are changes. 
  // They can be commented out to save memory and startup time once training has been performed.

                       // Train (may take 20seconds) 

  //  recognizer.setThreshold(5);      // uncomment and set to a higher value (valid range 2-95) if you have a problems due to a noisy environment.

void loop() // run over and over
  signed int res=recognizer.poll(); // Get result from MOVI, 0 denotes nothing happened, negative values denote events (see docs)
  if (res==1) {                     // Sentence 1.

  // step one revolution in the other direction:
  digitalWrite(motor1pin1, HIGH);
  digitalWrite(motor1pin2, LOW);

  digitalWrite(motor2pin1, HIGH);
  digitalWrite(motor2pin2, LOW);

  digitalWrite(motor1pin1, HIGH);
  digitalWrite(motor1pin2, LOW);

  digitalWrite(motor2pin1, HIGH);
  digitalWrite(motor2pin2, LOW);
   digitalWrite(motor1pin1, LOW);
  digitalWrite(motor1pin2, LOW);

  digitalWrite(motor2pin1, LOW);
  digitalWrite(motor2pin2, LOW);
  recognizer.say("Ariving now");

}`Preformatted text`

Hello, do yourself a favour and please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation of your ask).

thank you I will check it out

Most likely, you have the wrong motor driver for your stepper, the wrong motor power supply, or the setup is not adjusted correctly.

For help with that you will need to post links to the motor, the motor driver, the motor power supply, and also post a wiring diagram.

1 Like

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

Did you read the manual of that shield?
One of the first pages states that the shield is using pin 10 and 11 to communicate with the Arduino.

Here is a Link to the Motor And Driver


How would I fix this

Use pins that the shield isn't using.
You can even try the analogue pins for that.
Stepper myStepper(stepsPerRevolution, A0, A1, A2, A3);

Thank You

i tried doing this and now the motor is not even vibrating

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