Hey guys,
So I am pretty new to Arduino and I am by no means an electrical engineer.. this is for a university project and right now i just want to get the motor turning..
I have followed the steps for wiring up the SN754410NE motor control chip from http://www.tigoe.net/pcomp/code/category/code/arduinowiring/51 to the letter.. My motor is a http://www.littlebirdelectronics.com/products/Stepper-Motor-with-cable.html, 4 wire bipolar stepper motor, 200 steps per revolution with ~12V input..
Currently I have a small 12V battery into the V2 pin which should make this not a power problem. I have had a look at the Motor Datasheet from http://www.sparkfun.com/datasheets/Robotics/SM-42BYG011-25.pdf and have used A,C and B,D as pins 8,10 and 9,11 on my arduino digital output..
The code I am using to control the Motor is pretty much straight from the bottom of http://www.tigoe.net/pcomp/code/category/code/arduinowiring/51 just with the pins and change for the 4 wire motor made.. below is the code
/*
Stepper Motor Controller
language: Wiring/Arduino
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 and 9 of the Arduino.
The motor moves 100 steps in one direction, then 100 in the other.
Created 11 Mar. 2007
Modified 7 Apr. 2007
by Tom Igoe
*/
// define the pins that the motor is attached to. You can use
// any digital I/O pins.
#include <Stepper.h>
#define motorSteps 200 // change this depending on the number of steps
// per revolution of your motor
#define motorPin1 8
#define motorPin2 9
#define motorPin3 10
#define motorPin4 11
#define ledPin 13
// initialize of the Stepper library:
Stepper myStepper(motorSteps, motorPin1,motorPin2,motorPin3,motorPin4);
void setup() {
// set the motor speed at 60 RPMS:
myStepper.setSpeed(60);
// Initialize the Serial port:
Serial.begin(9600);
// set up the LED pin:
pinMode(ledPin, OUTPUT);
// blink the LED:
blink(3);
}
void loop() {
// Step forward 100 steps:
Serial.println("Forward");
myStepper.step(100);
delay(500);
// Step backward 100 steps:
Serial.println("Backward");
myStepper.step(-100);
delay(500);
}
// Blink the reset LED:
void blink(int howManyTimes) {
int i;
for (i=0; i< howManyTimes; i++) {
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(200);
}
}
I have tried swapping out the controller chip incase that was the problem, I have tried using another motor incase that was the problem.. makes no difference.. no errors when compiling or uploading and the serial monitor says "Forward", "Backward" etc
WHERE AM I GOING WRONG ![]()
Any help/suggestions would be awesome!!