So I’m using an Arduino Uno, sparkfun Easydriver, and a wantai stepper motor I got at a local hobby shop.
Yet I can’t get absolutely anything to work!!
I’ve verified with my multimeter that the soldering was solid and my cables were in the right place multiple times.
I’m trying to power it all using a 9v battery that a guide said would work fine. I can step the motor back and forth by switching it all around manually so I know the motor works for sure.
One thing I’ve noticed is that in some tutorials online I see a little red LED light up on the easydriver board, for me I’ve never seen my board do that. I thought it meant it was broken at first so I bought another one but that didn’t fix the issue at all.
The stepper motor is a Wantai model 42BYGHW208
If anyone has some insight as to what I’m doing wrong I’d greatly appreciate it. Or if I missed some info I’ll easily put some more in.
If the 9V battery is one of those rectangular smoke alarm batteries it cannot provide enough current. Get a 12V power supply that can supply at least 1A.
Monitor the 9V battery voltage while trying to run the motor. Does the voltage drop?
Ok so sorry for the late reply but I went and bought a 12v 3A power supply since groundFungus mentioned a 9v wouldn't work. And then I tried your example sketch and read up on some of the tutorial but still no luck. Everything is connected the way I think it should be. My multimeter guarantees everything is connected and soldered properly but still nothing. I'll post the datasheet link here if you can help.
So please ignore the horrid quality, I’m attempting to get fritzing working on my laptop as I write this so I will have a better sketch up soon if you need more quality
EDIT, I can’t see the image I uploaded using your guide. I’ll try to fix
// testing a stepper motor with a Pololu A4988 driver board or equivalent
// on an Uno the onboard led will flash with each step
// this version uses delay() to manage timing
byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20; // microseconds
int millisbetweenSteps = 250; // milliseconds - or try 1000 for slower steps
void setup() {
Serial.begin(9600);
Serial.println("Starting StepperTest");
digitalWrite(ledPin, LOW);
delay(2000);
pinMode(directionPin, OUTPUT);
pinMode(stepPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(directionPin, HIGH);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
delayMicroseconds(pulseWidthMicros); // this line is probably unnecessary
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
delay(3000);
digitalWrite(directionPin, LOW);
for(int n = 0; n < numberOfSteps; n++) {
digitalWrite(stepPin, HIGH);
// delayMicroseconds(pulseWidthMicros); // probably not needed
digitalWrite(stepPin, LOW);
delay(millisbetweenSteps);
digitalWrite(ledPin, !digitalRead(ledPin));
}
}
void loop() {
}
Robin2:
Please don’t bother with Fritzing - its pretty pictures are too easy to misunderstand. Just make a simple pencil drawing like I suggested in Reply #4
…R
Oh well I tried to upload the picture but when I used imgr it just didn’t work and when I tried attaching it the site said it’s too big…
It looks like you are drawing power for the motor from the Arduino. Don't do that.
You can power the Arduino and the motor from the same 12v supply but don't pass the motor power through the Arduino.
For testing it would be wise to power the Arduino separately from the motor, just to eliminate a potential problem. Just power the Arduino from the USB cable.
Definitely don't route the motor power through the Arduino, its a humble logic board, not a
gnarly robust high current motor driver!
Take power direct to the motor driver, also route power to the Arduino, even better if you power
the arduino completely separately via USB for now to rule out any power spike/dip issues.
yeah the reason I used a 9v battery was to power the motor seperately, then I heard it's best to just get a 12v supply to power the arduino and the motor from the arduino itself. But neither worked.