Go Down

Topic: 28BYJ-48 geared stepper 64 or 32 steps. (Read 1 time) previous topic - next topic


I recently acquired a few 5v unipolar steppers - 28BYJ-48. These are advertised as 64 step with 1/64 reduction gearing. They also ship wired in the order, Blue, Pink, Yellow, Orange, Red turning in one direction only. Swapping the Pink and Yellow wires however, has the stepper rotating CW and CCW. But I am not able to solve the fact that motorsSteps must be set at 32, to drive my application as required at 1 rpm, rather than 64 steps advertised. Other than that, these little motors run almost resonance free, which is great for astrophotos.

All my other steppers run as advertised using the standard Arduino library - not sure why the 28BYJ-48 requires only half the number of steps / revolution? I suspect it's a user problem, but have no idea where to start looking.

Furthermore, should I set the stepper pins to OUTPUT, or is this the default stepper library configuration any way?


i have 2 of these on a camera setup and here is the code i have that runs them off of 1 joystick.

#include <Stepper.h>

const int stepsPerRevolution = 64; 

Stepper pan(stepsPerRevolution, 8,10,9,11);
Stepper tilt(stepsPerRevolution, 3,5,4,6);

void setup() {
  pan.setSpeed(300);    // pan
  tilt.setSpeed(300);   // tilt

void loop() {
  int sensorReading = analogRead(A0); // pan

  if (sensorReading < 300) { pan.step(4); }   // pan left
  if (sensorReading > 800) { pan.step(-4); }  // pan right
  int sensorReading2 = analogRead(A1); // tilt

  if (sensorReading2 < 300) { tilt.step(4); } // motion down
  if (sensorReading2 > 800) { tilt.step(-4); } // motion up

simple and easy
good luck

Go Up