mcp23s17 to controll stepper motors


I would like to know if it's possible to use mcp23s17 chip to control 4 steppers with uln2003a drivers?


You'd be far better off using proper stepper motor drivers. A stepper motor with proper driver only needs two pins - one to define the direction to step and one to make it step.

I"m using 28byj-48 5 wired stepper

Don't see why not, if you used ULN2803 (8 outputs instead of 7) you would only need 2 for 4 motors. Can you post your current program?

Here is the diagram of what I want to do

Here's a simple 4 step test sketch for 1 motor, shouldn't be difficult to expand to 4 but I'm not familiar with programming the MCP23S17, there's many members here that are though.

/* coilA to pin 8,  pink
   coilB to pin 9,  yellow
   coilC to pin 10, orange
   coilD to pin 11, blue

   type a number in top of serial monitor for steps per second,
    300 (35 RPM is about max and hit enter.
byte stepNr [4] = {0x01, 0x02, 0x04, 0x08};
byte cntr = 0;
int stepsPerRev = 513, // 512 is not enough, 514 too many
    dlay = 85;

void setup()
  DDRB = 0x0F; // set pins 8,9,10,11 to OUTPUT

void loop()
  PORTB = stepNr[cntr & 0x3] & 0x0F;
  cntr++; // use cntr-- for opposite direction
  if (Serial.available() > 0)
    dlay = 1000 / Serial.parseInt();

I would like to use Accelstepper library to do smooth acceleration and deceleration