28BYJ-48 4-Phase Stepper Motor

I have probably tried 12 different tutorials trying to get this motor to work without any success. I have hooked up exactly like below and have tried all my motors and boards.

The only time it has worked is when I didn't use any libraries and defined an array for motor next steps, but I can't get it to go anymore and I want to use the library.

Does anyone have any ideas of what can cause problems with these supposed easy beginner projects? Generally.

you can see a tutorial I've followed here

28BYJ-48 4-Phase Stepper Motor

image

`//Includes the Arduino Stepper Library
#include <Stepper.h>

// Defines the number of steps per rotation
const int stepsPerRevolution = 2038;

// Creates an instance of stepper class
// Pins entered in sequence IN1-IN3-IN2-IN4 for proper step sequence
Stepper myStepper = Stepper(stepsPerRevolution, 8, 10, 9, 11);

void setup() {
    // Nothing to do (Stepper Library sets pins as outputs)
}

void loop() {
	// Rotate CW slowly at 5 RPM
	myStepper.setSpeed(5);
	myStepper.step(stepsPerRevolution);
	delay(1000);
	
	// Rotate CCW quickly at 10 RPM
	myStepper.setSpeed(10);
	myStepper.step(-stepsPerRevolution);
	delay(1000);
}`

There's no power to the controller....

The code works fine on my hardware.

What is the power supply to the stepper motor?

Do the LEDs on the driver board flash? Or do anything?

Is the jumper next to the power input in place?

Clear photos of the wiring may be of value.

Can you post this code?

ops...

int Pin1 = 12;//IN1 is connected to 10 
int Pin2 = 11;//IN2 is connected to 11  
int Pin3 = 10;//IN3 is connected to 12  
int Pin4 = 9;//IN4 is connected to 13 
int switchCW  =14;//define input pin for CW push button
int switchCCW =12;//define input pin for CCW push button

 
int pole1[] ={0,0,0,0, 0,1,1,1, 0};//pole1, 8 step values
int pole2[] ={0,0,0,1, 1,1,0,0, 0};//pole2, 8 step values
int pole3[] ={0,1,1,1, 0,0,0,0, 0};//pole3, 8 step values
int pole4[] ={1,1,0,0, 0,0,0,1, 0};//pole4, 8 step values


int poleStep = 0; 
int  dirStatus = 3;// stores direction status 3= stop (do not change)

void setup() 
{ 
  //Robojax Stepper Motor Code STPB-2
 pinMode(Pin1, OUTPUT);//define pin for ULN2003 in1 
 pinMode(Pin2, OUTPUT);//define pin for ULN2003 in2   
 pinMode(Pin3, OUTPUT);//define pin for ULN2003 in3   
 pinMode(Pin4, OUTPUT);//define pin for ULN2003 in4   

 pinMode(switchCW,INPUT_PULLUP);
 pinMode(switchCCW,INPUT_PULLUP);  
 
} 
 void loop() 
{ 
  //Robojax Stepper Motor Code STPB-2
  dirStatus =1;
  driveStep(dirStatus);
  delay(5000);
}

 void driveStep(int c) {
  
 if(c ==1){ 
   poleStep++; 
    driveStepper(poleStep);    
 }else if(c ==2){ 
   poleStep--; 
    driveStepper(poleStep);    
 }else{
  driveStepper(8);   
 }
 if(poleStep>7){ 
   poleStep=0; 
 } 
 if(poleStep<0){ 
   poleStep=7; 
 } 
 delay(50); 
//Robojax Stepper Motor Code STPB-2
}// 



/*
 * @brief sends signal to the motor
 * @param "c" is integer representing the pol of motor
 * @return does not return anything
 * 
 * www.Robojax.com code June 2019
 */
void driveStepper(int c)
{
  //Robojax Stepper Motor Code STPB-2
     digitalWrite(Pin1, pole1[c]);  
     digitalWrite(Pin2, pole2[c]); 
     digitalWrite(Pin3, pole3[c]); 
     digitalWrite(Pin4, pole4[c]);   
}//driveStepper end here

See it running with your first code.
(The one from post #1)

Sweet. good for you . I must have worst luck EVER!! I've tried like 6 motor drivers, many different codes, followed youtube videos to a T, 2 different stepper motors and my latest attempt a dc motor with esc connected to the uno and I still don't have a working electronic window. Everything is so simple in tutorials and code compiles, but goes knowhere.

That's why I quit mechanical engineering degree after 3 years of busting my butt. I'd follow labs exactly and have the hardest time.

Post a picture of Arduino and ULN2003 showing wire connections.

Window of a doll house?

These motors draw about 300mA.
Which motor supply are you using.
Leo..

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