How to set up a bipolar stepper motor in under 10 minutes

Recently, I purchased several steppers and drivers for a 3D printer project and I was curious to see how quickly I could set a stepper up. For this I will not count time like waiting for the soldering iron to heat up. I thought this project would be perfect for the first project to upload here.

Gather Parts

Partlist:

  • EasyDriver 4.4 (Other versions will work similarly)
  • Arduino (I have tested both the Uno and Leonardo with this project)
  • Bipolar Stepper Motor (I used a NEMA 13 stepper in this project)
  • Several wires (Preferably of different colours)
  • Tape
  • Access to a computer or any other means of uploading code to the arduino
  • 12V power supply
  • Soldering Iron and solder
  • Breadboard

Step 1: Solder.

Start the timer
Note: Always solder in a well ventilated area with a fume extractor, removed from potentially flammable items, and beware, because the iron and the solder can get very hot

Break away the pins into the required smaller quantities and place them in the holes on the EasyDriver, the “short end” is the bit going into the driver, leaving the plastic and the longer lead pointing out of the bottom of the drive.

EasyDriver v4.4 board with pins

EasyDriver v4.4 board with pins

Turn this whole thing upside down, so now you have the driver laying upside down and the long ends of the pins (and the plastic) pointing upwards, and ensure all the pins are straight. Push a breadboard down gently on this and now all the pins should be stuck in the breadboard and the EasyDriver should be on the bottom. turn this entire thing upside down again so now you have the pins sticking into the breadboard and the easy bit driver on top. This bit was all done to fasten the pins in place to make things easier while soldering.

Proceed to solder the part of the pin sticking out the top of the EasyDriver to the driver itself, taking time to ensure to make sure all solder joints are made correctly.

Soldered EasyDriver 4.4 board

Soldered EasyDriver 4.4 board

Timer: 3 minutes


Step 2: Setting Up Power supply

Using your 12 Volt DC power Supply locate GND (Ground/Negative) and the +12V output. Connect wire to the neccessary terminals. In my image the outside of the connector was GND and the inside was +12V so I wrapped a wire around the outside and placed a folded up wire on the inside and taped everything together with some of that magical duct-tape . Then these two wires were connected to jumper cables (Red  for +12V, Black for GND). Do not plug these into anything yet.

12V power supply

12V power supply

+12V power supply with wires connected.

+12V power supply with wires connected.

Taping the power supply and wires together

Taping the power supply and wires together

The +12V input is connected to the red jumper cable and the GND is connected to the black

The +12V input is connected to the red jumper cable and the GND is connected to the black

Timer: 4.5 minutes


Step 3: Wire Up Stepper

First strip the end of the wires leading from the stepper. Then connect the stripped ends to the ends of jumper cables, colour coding is very useful to not get confused with all of the wires, so try to use the same jumper cable colour as the original stepper motor connector colour to avoid confusion, for me, I had to connect a white jumper to the grey wire as there were no white jumpers available.

Example of a bad connection to servo, ensure connectors are fully pushed connected

Example of a bad connection to servo, ensure connectors are fully pushed connected

Timer: 6.5 minutes


Step 4: Upload Code to Arduino

The basic code to just make the servo turn in one direction is as follows, and for this tutorial that is all I will cover , however with some simple modifications you can alter the speed and direction of this movement and can move on to more sophisticated projects from there

code:

void setup() {

pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
}

void loop() {
delay(1);
digitalWrite(9, HIGH);
delay(1);
digitalWrite(9, LOW);
}

Code

Code

Timer: 7.5 minutes


Step 5: Connect Everything on the Breadboard

Connect the stepper to the Driver pins marked MOTOR. With the first coil connected to A and the other connected to B. If you don’t know which wire corresponds to which coil don’t worry, just connect any arbitrary combination and see the note (Note 1) at the end of this tutorial.

Connect the Arduino pin 8 to the DIR pin, and pin 9 to the STEP pin, and GND to GND

Do not connect the 12V input or turn on the arduino yet.

Stepper wires connected to the Driver

Stepper wires connected to the Driver

Control inputs for EasyDriver, orange (Pin 9) is the step contol, White (Pin 8) is the direction control, black is the ground connection

Control inputs for EasyDriver, orange (Pin 9) is the step contol, White (Pin 8) is the direction control, black is the ground connection

Contol inputs for EasyDrive 4.4 board. White is the the direction, Orange is the step control and black is Ground

Contol inputs for EasyDrive 4.4 board. White is the the direction, Orange is the step control and black is Ground

Timer: 8.5 mins


Step 6: Thunderbirds are go

Check to make sure all wires are connected correctly then connect the arduino power supply, then the 12V supply to the EasyDriver Board, and you should have lift off . A red light on the board should light up and your stepper should begin to rotate

12V input to EasyDriver board

12V input to EasyDriver board

Easy Driver board functioning properly

Easy Driver board functioning properly

Timer: 9 mins


Note 1

If as stated above you aren’t aware of yoru servo wiring, just begin with any arbitrarity chosen combination of the 4 wires and let’s say that the order is now ABCD, test to see if that works, if not remove power from the EasyDriver board and reverse the last two wires to give you ABDC, power the driver and test to see if that works, if not remove power from the EasyDriver board and reverse the middle 2 giving you ADBC and power the driver to test to see if that works. If none of these combinations work it is likely that your driver is faulty or your connections are broken, or there was a bad solder joint. If the motor is spinning but in the opposite direction of where you intend then remove power from the driver and reverse the wiring, ABCD becomes DCBA and try again.

Note 2

Never unplug the stepper while the driver is connected to the power supply this could permanently damage the board

Advertisements