Hi,
I am using the circuit diagram in http://arduino.cc/en/Reference/StepperBipolarCircuit (4-pin one) to control my stepper motor. However, nothing seems to be happening when I tried it out. Here is how I connected the pins, can you please validate these connections ?
- 1,2 en pin, 3,4 en pin and V1 are all connected to pin marked as 5V on Arduino
- 1in, 2in connected to digital pins 2 and 3 on Arduino
- 3in, 4in connected to digital pins 4 and 5 on Arduino
- All 4 GND pins go to GND on breadboard (which in turn was connected to GND pin on Arduino)
- 1 out, 2out, 3 out, 4 out are connected to motor. My motor has cables labeled as 1, 2, 3 and 4 so I just connected them in that order.
- V2 is connected to pin marked as 5v. This is probably a big assumption I made ... I don't actually know what voltage my motor operates on as I bought it in a hobby shop and there are not data sheets for it but I am making a guess here. The motor face plate has the following:
Portescap
Malaysia
S15M020N28
0403
I googled a bit but didn't find anything. I checked their website and they don't have any stepper motors that match this. Can someone help ? Regarding the connections, other than 6) does everything else look fine ? BTW, where can I find cheap and small stepper motors ? I don't care about its torque or other things as long as I can make it rotate (just for fun).
The Arduino sketch I tried is:
#include <Stepper.h>
#define STEPS 5 // not sure about this value, just a guess
Stepper stepper(STEPS, 2, 3, 4, 5);
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
stepper.setSpeed(10); // again, 10 is randomly chosen
}
void loop()
{
stepper.step(10); // randomly chosen
delay(10000); // wait for 10 seconds
}
Thanks,
RO.