Help with stepper motor

Hi,

I have purchased the following:

I have a 12v power supply available for the motors (lead acid battery).

I am not sure how to hook it all up - and would prefer neither damaging driver board nor Arduino.
I would assume that "IN1-IN4" goes to the Arduino output pins - configured with the Stepper.h library.
But which color wires goes where from the motor? They do unfortunately not come with a "plug", but bare colored wires :drooling_face:
Also, where does my 12v go? GND should be connected I assume, but where does the positive 12v go? Should I remove the jumper, and connect it to the one furthers to the side?
GND and VCC are from Arudino I assume.

Also - I have multiple motors and drivers of this type. If I want them all to run at same speed, could I hook them all to the same outputs from the Arduino, or would it draw too much current?

Thank you very much in advance!

I don't have any of those motors but this has been discussed in great detail in other Threads in the Forum. Ask Google to find them.

...R

I have googled quite a bit, but did not come up with a conclussive result, which is why I asked here.

Looking at tutorials, such as http://arduino.cc/en/Tutorial/MotorKnob the ULN-chip does not receive 5v at all.
I do however not know if the driver circuit I have should receive 5v (perhaps to drive the LEDs), or if the VCC it has should have 12v directly.
I guess I can match the colors of my motors leads to the ones on various pictures I can find, where the motor have a connector attached.
Whether I can drive multiple of these circuits from the same output pins will probably have to be a risk I will have to take,

I have nothing against doing my own research, and experimenting is a part of the game - but appreciate some pointers before attaching 12v to the system :slight_smile:

Normally with the 5V version of this motor the common wire is red.

But you can ask the motor itself with a multimeter. Use resistance range
and measure the resistances between pairs of wires. The common wire is the
one which measures the smaller resistance between it and other wires.
Common wire goes to +12V, as does the COM pin of the ULN2003 (this
is vital).

As for the sequence of connecting the other wires you can experiment, 8
ways of wiring it up will work (4 for each direction), 16 ways will fail.

However you can fix one wire arbitrarily as the first phase, then there are
only 6 possibilities, 2 of which work and 4 don't.

Just remember never to disconnect a stepper motor's wires while it is powered up,
this is likely to fry the driver. (It certainly will with big steppers).

Perfect, thank you MarkT! This is something I can work from :slight_smile:

Just one question - on the driver, which is the COM pin of the ULN2003?
There are these 4 pins next to each other
GND VCC <->
There is a jumper between two pins labeled <-> I am guessing it is the one to the right that is COM, and that the jumper connects COM to VCC if attached? And that VCC should be 5v?

Thanks a bunch for the help!

pin 8 = ground,
pin 9 = common (common of the freewheel diodes, to be precise).

Alright, I will go look at the PCB and trace the contacts to where it goes to the chip.
I can read that the jumper is apparently for disconnecting power to the motors, so I will not need to remove that - I should instead simply provide 12v to the VCC pin.

I will post how it goes when I get things tested.

Thanks!

Hi,

I got it working - awesome! No magic smoke came out or not'in :slight_smile:
Found out that the jumper is for disabling the LEDs on the board - motor moves regardless.

I feel stupid for asking all these questions, but here is more. If I could find it online I would, but none of what I searched for gave results.

Using the "stepper_oneRevolution" sample with the values I have found/tested, follows:

#include <Stepper.h>

const int stepsPerRevolution = 2038;  // change this to fit the number of steps per revolution
                                     // for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,9,10,11);            

void setup() {
  // set the speed 
  myStepper.setSpeed(14);
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one revolution  in one direction:
   Serial.println("clockwise");
  myStepper.step(stepsPerRevolution);
  delay(500);
  
   // step one revolution in the other direction:
  Serial.println("counterclockwise");
  myStepper.step(-stepsPerRevolution);
  delay(500); 
}

As seen, I have found that 2038 is the amount of steps per revolution. A speed of 14 appears to be the fastest with which it will move - faster than that, and it just sits still, clicking. This is fine - I assume the magnets are switching too fast for it to follow.

Now, my question is - as long as it moves, is it fine? I can feel it kinda "clicking" when holding it - is that how stepper motors are supposed to do? It also warms up - not much, so I guess it is fine...
Is 14 the maximum speed I will get out of this motor - or is there tricks to increase it (like slowly increasing speed, so it can catch up or similar)?

Thanks :slight_smile:

Hotcut:
I have googled quite a bit, but did not come up with a conclussive result, which is why I asked here.

My mistake. The common motors are 28byj48 - probably quite similar.

...R