Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Ardiuno UNO and a4983 with regulator and stepper motor


Ahhh I should have known Capital S in stepper Line 1

Ok, so I have all the wires hooked up with power, no soldering yet.
I hooked up the 12v Batter to the VMOT and GND on the driver
(Red to VMOT and Black to GND.)

It seem as though the Arduino is not talking to the Driver board - Is my breadboard correct in its wiring (last post image)

I understand that defining pins 6 and 7 needs to be to done to talk to the driver boards STEP and DIR pins - do they need to be defined somehow too? I am sort of lost here as to how the boards talk to each other.


There really is no hope of all your header pins making contact with the carrier’s pads unless you nicely solder them together. I suspect that is your problem.

- Ryan


Hmmm im hesitant to solder yet.

So they way everything looks to you is correct right?

Would there be a way to test and ensure the Arduino is talking to the a4983?

Sorry what is the carrier? is that the breadboard?


While I still think the soldering is crucial to it working, I just looked at the Stepper library, and there isn’t any reason to expect it to work with this driver. (The description of pin1 and pin2 parameters of the Stepper constructor make no mention of direction and step lines.) Can you try not using the library and just try setting DIR to HIGH and toggle STEP using digitalWrite?

When I say “carrier,” I am referring to just our board, the A4983 Stepper Motor Driver Carrier. You should definitely not be soldering the header pins to the breadboard. The whole point of using a breadboard is that you can easily rewire your circuit.

- Ryan


Do you have an example of this please?



You might find this thread helpful:

- Ben


Thanks Ben - why do I feel like I am missing parts on my circut here, when I look at those examples?

I cant rewire based on those specs, as from what I read this should all work with what I have… ideas?


I think Ben was mainly pointing you at the code that is attached to the first post of that thread. If you’ve soldered those header pins to the carrier, your connections should all be fine. The reason the wiring is different is because most people are using the version of the board without regulators on it.

Were you asking for an example of the code or of the soldering?

- Ryan


Hi again Ryan, I was asking for a sample of code to get the thing going so that I can make sure its all wired correctly.

A simple stepper sketch would be amazing please.


The forum thread Ben linked to has an attachment called StepperTester.pdf that is a simple stepper sketch. You can modify it to work for you by removing the lines that refer to the enablePin and setting dirPin and stepPin to the pins that match your wiring.

- Ryan


Ok Tried this - nothing…

#define stepPin 6 #define dirPin 7 //#define enablePin 4 void setup() { // We set the enable pin to be an output //pinMode(enablePin, OUTPUT); // then we set it HIGH so that the board is disabled until we // get into a known state. //digitalWrite(enablePin, HIGH); Serial.begin(9600); Serial.println("Starting stepper exerciser."); pinMode(stepPin, OUTPUT); pinMode(dirPin, OUTPUT); } void loop() { int j; // set the enablePin low so that we can now use our stepper driver. //digitalWrite(enablePin, LOW); // wait a few microseconds for the enable to take effect // (That isn't in the spec sheet I just added it for sanity.) delayMicroseconds(2); // we set the direction pin in an arbitrary direction. digitalWrite(dirPin, HIGH); for(j=0; j<=10000; j++) { digitalWrite(stepPin, LOW); delayMicroseconds(2); digitalWrite(stepPin, HIGH); delayMicroseconds(1000); }}

Are we positive my connections on the board are correct?


Have you soldered your the header pins to the stepper driver board yet? There is no reason to expect anything to work with unsoldered pins, so it’s not worth trying to help you debug your system while there is still such a glaring problem. By the way, there really isn’t any down side to soldering first (soldering header pins does not commit you to any particular connections).

- Ben


Point well taken Ben.

So please excuse my lack of knowledge here

The header pins are the strips of pins encased in plastic correct?
And do I only use/solder the amount of header pins that are being used on the chip?
2 on the bottom left and 8 on the right?

Or shold I just solder them all, incase I need to use more pins later?

Please advise, thanks.


Yes, the header pins look like this:

The short sides of the pins protrude through the through-holes on the board (like in the picture you posted earlier) and should be soldered to the surrounding pads on the top side of the PCB if you want to be able to plug it into a breadboard. If you do not have much soldering experience, I strongly suggest you find a tutorial on soldering and familiarize yourself with it before you start so you know how to apply the solder, how much solder to add, what a good solder joint looks like, etc. Otherwise, you might damage the board or create bad solder joints that don’t make adequate electrical connections.

Specifically, you should at least solder the places circled in the picture below:

I recommend you solder header pins in all the holes while you’re at it, but this isn’t absolutely necessary. The crucial part is soldering the pins you are using to the board. If you solder all the pins, it makes it easier to make alternate connections later (i.e. you won’t have to go looking for soldering iron again).

Also, this might sound obvious, but just in case it isn’t: you should not solder the board while power is being applied. In general, make sure you are really paranoid about applying power with incorrect connections as putting the wrong voltages on pins or shorting outputs together can permanently destroy electronics.

- Ben


Ben this is exactly the information i was looking for - thanks so much!

I’ll get soldering tonight after ive had a bunch of beer and put my tinfoil gloves on :wink: Jokes

I am super paranoid about messing this up, hence all my questions.

Thanks again.
Ill get on this either tonight or tomorrow and get back to you.


Ok guys, working so-so here

The Stepper Motor, rotates about a1/4 the way around > pauses for 1 second > repeats

Variation i just did was to comment out the delay, and set the speed to (1)

Next step (no pun) How would I wire and code the Potentiometer?

With following Sketch

[code]// Stepper
#include <Stepper.h>

// steps value is 360 / degree angle of motor
#define STEPS 200

// create a object on pins 6 and 7
Stepper stepper(STEPS, 6,7);

void setup()
void loop()
///// Turn the stepper 200 steps with a 1 sec delay between steps at 60rpm
/// then reverse the direction and do 50 steps at 20rpm with a 1sec delay between steps


It looks like you are still using the stepper library that I mentioned has little chance of working. Can you confirm that this is the stepper library you are using? http://www.arduino.cc/en/Tutorial/Stepper I looked at the code for this stepper library and confirmed that it will not work with our driver.

For the potentiometer, you would connect two ends of the pot between 5V and GND of your Arduino and then connect the wiper to one of the Arduino’s analog inputs. Then you can use analogRead to read the wiper voltage. Feel free to post your circuit before you power it.

- Ryan


Hi there, yes that is the Stepper Library I am using.

So are you saying that, with that library, the POT wont work? Currently with that library installed I am able to control the Steps and RPM of the motor.
Should I comment that include line out?


Here is my illustration for the POT wiring - will it be ok to run the wire from the POT to the same 5V pin on the Arduino as the Driver board?
I dont see anywhere else to ruin it too


I just noticed that my Stepper Motor was extremely HOT to the touch

I am using a 12v 3.6Ah/C20 Lead Acid battery

I then plugged in a regular off the shelf 9v battery, ran the sketch and the Motor gave off a high pitched squeal - but still ran fine.

Should I be concerned with this?

The motor I am using is
Stepper Motor: Unipolar/Bipolar, 200 Steps/Rev, 42x48mm, 4V, 1200mA