SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By knitsu
#145217
I cannot seem to find any good or understanding Ardumoto tutorials online... for stepper motors.... however tons of people seem to be using them just fine without a hitch!!

I bought a Arduino Uno (SparkFun Kit) and also the Ardumoto, and a Motor (ROB-10846) all from SparkFun. well technically Creatron Inc, however they supply Spark Fun Kit. great kit you guys have!!! went through all of them in about 4 hours and had a great experience and understood it all pretty well

The kit was amazing, however now Im moving to bigger and better things.... Stepper Motors ( as this is what I really bought all this for)

any good tutorials,examples would be great.... please help :-)

I understand the motor is BiPolar, and has 4 wires, A (Black,Green) and B (Red and Blue)
on the board I have them wired like so B3= Blue B4=Red and A2=Black and A1 = Green

my question is which port should each colour go in, on the Ardumoto, I know their is 4 ports, and 2 per side A/B but can they be in any order for each side?? and also I need some good example code, everything I find really doesn't have what I am looking for, just some basic steps and get it moving would be nice.

The Owner of Creatron was also nice enough to give me a power supply and 2 ceramic 10W8r2J resistors, I am curious as to which line they go into, as I was use to the example and they go in the -GND end, however hear since this is bipolar, all lines could be GND at some point lol..... help a confused man!!

great sites guys, and look forward to showing my work in the coming days.
By knitsu
#145262
Ok, so I have made a "noobie" schematic of what I am doing.

The one thing, is the Data Sheet, for the Moto has me confused, I know the pairs are (RED,BLUE) and (Black,Green) not to sure what ports they go in,

also I am using a 5.0 V - 2.0 A power adapter to power this.... My question is should that be plugged into the Arduino power in, or should I power it into the ArduMoto.... and if the Ardumoto, how do I cut the power supply head off, and know which side is + or - to plug into the terminals on my ardumoto

Here is my schematic, and here is my code

Image

Code: Select all
// DIR-A == PIN 12
// PWM-A == PIN 3
// DIR-B == PIN 13
// PWM-B == PIN 11

#include <Stepper.h>
#define motorSteps 400     // change this depending on the number of steps
                           // per revolution of your motor
#define motorPin1 3
#define motorPin2 11
#define motorPin3 12
#define motorPin4 13

// initialize of the Stepper library:
Stepper myStepper(motorSteps, motorPin1,motorPin2, motorPin3, motorPin4); 

void setup() {
  // set the motor speed at 30 RPMS:
  myStepper.setSpeed(30);
}

void loop() {
  // Step forward 200 steps:
  myStepper.step(200);
  delay(500);
}

By Ubbi
#145964
Hi everybody, I'm trying to realize something similare, but with an unipolar stepper (maybe I'll use it as bipolar :D).
@knitsu: are you externally powering the ardumoto? my motor takes draws less power than yours, so if you're feeding it directly through arduino, I could do the same..
By knitsu
#145975
I have a 5V AC Adapter plugged into my Arduino Uno, this has enough power to power my Ardumoto and Stepper with no additional wires going from VIN/5V to the inputs on the ardumoto.

Here is the code I am using for my stepper and the layout of the pins with coloured wires.....
Code: Select all
 // TO Get them to spin I put them in this order, on the ARDUMOTO MOTOR PINS A(1,2) B(3,4)
// NOTE ORANGE light on RIGHT side of ArduMoto stays on when it is delayed, and also the revolutions of 400, don't know if this is a hiccup or anything....
// BLUE -  Pin 3
// RED  -  Pin 4
// BLACK - Pin 2 ** RESISTER 10W8R2J
// GREEN - Pin 1

#include <Stepper.h>
const int stepsPerRevolution = 400;  // Stepper has 400 revolutions
Stepper myStepper(stepsPerRevolution, 3,11,12,13); // See reference for ARDUMOTO- use pins 3,11,12,13

void setup() {
  myStepper.setSpeed(70);  // set the speed at 70 rpm:
  // 70 is a nice fluid move  60-70 rpm, and a nice slow rotation could be 20
}

void loop() {
myStepper.step(stepsPerRevolution); // Do a full revolution, 400 steps
//delay(1000);
}
By Ubbi
#146026
What about the current of the AC adaptor? So no extra wires except the 4 ones of the motor, right? It's a different configuration from the one I've seen one your youtube video? there is a lot of wires on it!
Thanks for your quick responce!
By Ubbi
#146064
I get it working! but in a half: the sequence produced by stepper library isn't correct.
Now is doin 3-4-2-1

What I need to correctly move the motor is 3-1-4-2 (so B-A-B'-A').

Can anybody help me?
By TS-Tim
#165236
Wow. In the almost six years I have been at Sparkfun now, I can't think of any other person how actually has shared a functional DC motor controller for stepper control. Logically I can see how it would work, but kudos on actually taking the time and managing a real world example of this. Very cool stuff, thanks for sharing!!