Stepper motor (28BYJ-48) problem with Spark Core

I want to drive a stepper motor (28BYJ-48) with my Spark Core. I am trying to do with a code that I get good results in Arduino. However when I plug this motor to the Spark it didn’t work. It is turning but not as good as in Arduino. I tried to give voltage from Spark and externally. It didn’t change anything. I tried also all possible pin configuration that are (D0,D1,D2,D3) (D0,D1,D3,D2) (D0,D2,D1,D3) (D0,D2,D3,D1)… etc.

Is there anyone who can drive stepper motor and can give some clues about it??

Here is the code I am using:

#include "Stepper/Stepper.h"

const int STEPS=500; //Step number of motor
const int Speed=25;       //Speed of motor

Stepper motor(STEPS,D0,D1,D2,D3);

void setup() {
    motor.setSpeed(Speed);
}

void loop() {
   motor.step(100);
}

By the way I figured out that the pin voltages of the motor are around 2.5V when it is connected to Arduino, 1.5V when it is connected to Spark. Does it really important?


I’ve edited your post to properly format the code. Please check out this post, so you know how to do this yourself in the future. Thanks in advance! ~Jordy

Did you have a look at the included library, and have you tried the example provided?

Hi @mrtbarutcu

If you don’t have any kind of driver circuit, it isn’t going to work well. Another difference is that Spark outputs are 3.3V not 5V.

You really should have a driver in both cases but particularly on the 3.3V Spark.

1 Like