I have an Arduino Uno and Motor Shield R3. I have not been able to find any information on the Motor Shield R3, except for this: http://arduino.cc/en/Main/ArduinoMotorShieldR3

Can anyone help me connect a bipolar stepper motor and get it running. I have found tutorials with older Arduino Motor Shields but no the R3. Do I connect all 4 of the stepper motor wires to the A+,A-,B+,B- ? And then control the steps with the #12 & #13 pins (Dir A, Dir B)

Can anyone help me connect a bipolar stepper motor and get it running. I have found tutorials with older Arduino Motor Shields but no the R3. Do I connect all 4 of the stepper motor wires to the A+,A-,B+,B- ? And then control the steps with the #12 & #13 pins (Dir A, Dir B)

Yes. Be sure to set pins 3 and 11 (PWM-A and PWM-B) to HIGH to turn on power. You should probably also turn 8 and 9 to LOW to turn off the brakes.

If you want to hold position without heating up the stepper you can use analogWrite() on 3 and 11 to reduce the power. If you want to release the motor so you can turn the shaft by hand, set 3 and 11 to LOW.

// set the PWM and brake pins so that the direction pins // can be used to control the motor:pinMode(pwmA, OUTPUT); pinMode(pwmB, OUTPUT); pinMode(brakeA, OUTPUT); pinMode(brakeB, OUTPUT); digitalWrite(pwmA, HIGH); digitalWrite(pwmB, HIGH); digitalWrite(brakeA, LOW); digitalWrite(brakeB, LOW);

Thanks for posting the code, that looks like exactly what I need. Could you possibly elaborate on how you connected up the stepper motor? I have 8 wires in total from my stepper motor (a Nema23 model) which are coloured Black, White, Orange, Yellow, Brown, Red, Blue and Green. If I can figure out how to wire it up I will post a diagram.

...Can anyone help me connect a bipolar stepper motor and get it running. I have found tutorials with older Arduino Motor Shields but no the R3. Do I connect all 4 of the stepper motor wires to the A+,A-,B+,B- ? And then control the steps with the #12 & #13 pins (Dir A, Dir B)

Im in the same exact boat!!! I have an Arduino uno+R3 motor shield with a nemea 23 stepper but it had 6 wires. According to wiring diagram the green and black was one coil and the red and blue was the other, then directions i found stated to have the center taps, in my case white and yellow connected to ground. I then plugged in black to A+ and Green to A- , then Red to B+ and Blue to B- I took the white and yellow twisted together and connected to the GND terminal. which I can't verify that it works cause the code below sort of moves the motor, the shaft sort of vibrates and when it gets to what i think is wave the flag the motor shaft turns a little:

If any of you guys see something wrong with the code or the wiring for the motor let me know. the Arduino book I have by Simon Monk arrived and turned out to not have anything about wiring up steppers. Which is frustrating

I also gave the other sketch a try and for a minute the motor was incrementally rotating and you could see the LED for A+ A- B+ B- moving and the shaft rotating but then it started doing other things like ticking back and fourth by 1.8 degrees randomly. I was curious when you up load the sketch does it erase the previous one?

It does sound like your code though. The r3 board, I think, uses different parameters.

I'm just learning this myself.

I was able to get this code to work though. Its basically the knob stepper example, but for the R3 motor shield. The values on the potentiometer could be played with to get better motion. Potiometer wiper to Analog 0, one end of the element to GND, other end to Vin.

#include <Stepper.h>

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

Yes. Be sure to set pins 3 and 11 (PWM-A and PWM-B) to HIGH to turn on power. You should probably also turn 8 and 9 to LOW to turn off the brakes.

Ugh. This was *exactly* my problem. Wish there was more documentation about the motor shield. Thanks, John.

Quote from: johnwasser

If you want to hold position without heating up the stepper you can use analogWrite() on 3 and 11 to reduce the power. If you want to release the motor so you can turn the shaft by hand, set 3 and 11 to LOW.

Can you talk more about this? If most of the time, my stepper's going to be stationary, should I be setting it to LOW manually (and only doing a .step() when I actually want to move it, then analogWrite(3,LOW))?

I have an Arduino Uno and Motor Shield R3. I have not been able to find any information on the Motor Shield R3, except for this: http://arduino.cc/en/Main/ArduinoMotorShieldR3

Can anyone help me connect a bipolar stepper motor and get it running. I have found tutorials with older Arduino Motor Shields but no the R3. Do I connect all 4 of the stepper motor wires to the A+,A-,B+,B- ? And then control the steps with the #12 & #13 pins (Dir A, Dir B)