Stepper motors are powerful and precise. Good tutorial with circuits and library documentation
available from the Arduino site. Steppers can be annoying to control and take up four control wires if you don't use transistors. This breakout board, available at our store
, lets you control a bipolar stepper motor, like this one available from Sparkfun
with just two control lines. It has two transistors on board so the extraneous control lines, which are always the opposite of the other two, can be eliminated. It also has capacitors to help ensure your stepper runs smooth and doesn't disrupt the rest of your circuit.
This shows the PCB and electrical traces of the L293 chip on our breakout board. The stepper motor connects to the pins labelled 4,3,2,1 make sure 4 and 3 are on one coil and 1 and 2 are on the other coil. Pins labeled INPUT come from the arduino or your MCU of choice.
PCB Close Up
This is the PCB backside where L293 chip is soldered.
The electrical connections of L293 chip in the break out board.
The back of the PCB hooked up to the stepper
Get the Breakout Board
First get the L293D breakout board
at the LucidTronix store. You will also need a bi-polar stepper motor. You can get one at spark fun, or salvage one from an old printer or scanner. You will also need an Arduino
or other micro-controller. Lastly, you need a 12V power supply for the stepper motor. We use a drill battery in the video above, you can also use 8 AA batteries (8*1.5V = 12V), or 12V wall wort.
Wires or Headers?
Decide how to hook up to the breakout board. The board comes with male headers that you can solder in making it really easy to use in a solder-less breadboard. This is a good choice if you want to experiment a lot with your setup. On the other hand if you know exactly how you want to use your stepper motor, you can solder hook up wires straight to the breakout board. At minimum you will need to connect the 4 wires to the stepper motor, two wires to the micro-controller, 5V and ground from the microcontroller and 12V and ground from the motor's power supply.
Get the Wires Straight
The bi-polar stepper motor comes with four wires. Each wire is connected to one other through a motor coil. You can test which one is which by using the connectivity sensor on your multimeter or using the just seeing which pairs have zero resistance between them. Four the sparkfun motor, the blue and yellow wires are one pair, and the red and green wires are another pair. Connect these four wires to breakout board, so that the blue wire goes to slot 1, the yellow wire is in slot 2, the green wires is in slot 3, and the red wire is in slot 4. Use the image as a guide.
Connect to an Arduino
Now that the motor is hooked up to the breakout board, you are ready to connect to an Arduino. You can use any two digital pins, in the picture and in the code below, we are using pins 2 and 3.
Connect to Power! 12V and 5V
The L293D chip needs to connect to both the 5V micro-controller power supply as well as 12V stepper motor power source. Our breakout board has three pins for 12V power to come in. You just need to connect 1 to the power source the others are there if you want to power more motors (or other 12V accessories). There are also two pins where you can connect the 5V power. you can connect the 5V pin on the breakout board straight to the 5V pin on the Arduino. Lastly, you need to connect to ground. The L293 board, the 12V power supply and the micro-controller must share a common ground. We have pulled out four ground pins on our breakout board so you have plenty to spare. Just make sure the 12V ground pin AND the arduino ground (GND) pins are both connected to the L293.