Bi Polar Stepper Motor With L293D and Arduino
by sureshmali in Circuits > Arduino
64406 Views, 41 Favorites, 0 Comments
Bi Polar Stepper Motor With L293D and Arduino
![20140831_044322.jpg](/proxy/?url=https://content.instructables.com/FR5/MIRQ/HZGTFGHI/FR5MIRQHZGTFGHI.jpg&filename=20140831_044322.jpg)
![20140831_050418.jpg](/proxy/?url=https://content.instructables.com/FBK/DWPP/HZGTFHID/FBKDWPPHZGTFHID.jpg&filename=20140831_050418.jpg)
![20140831_051744.jpg](/proxy/?url=https://content.instructables.com/FE5/G9CG/HZGTFHK9/FE5G9CGHZGTFHK9.jpg&filename=20140831_051744.jpg)
Hi,
I had a Bi Polar stepper motor lying, which I'll be using to create a Dolly for my DSLR.
Components used:
- Arduino Uno
- Stepper Motor ML17A3 B (This is the model no printed on motor)
- Breadboard
- L293D
- 9v Battery Pack
- Some Jumper cables
To make the connections, follow the circuit diagram.
Connections on Breadboard
![20140831_050110.jpg](/proxy/?url=https://content.instructables.com/FL7/GMIG/HZGTFH6U/FL7GMIGHZGTFH6U.jpg&filename=20140831_050110.jpg)
![20140831_050142.jpg](/proxy/?url=https://content.instructables.com/FAD/R4VI/HZGTFH8L/FADR4VIHZGTFH8L.jpg&filename=20140831_050142.jpg)
![20140831_050230.jpg](/proxy/?url=https://content.instructables.com/F11/WHBR/HZGTFHAT/F11WHBRHZGTFHAT.jpg&filename=20140831_050230.jpg)
![20140831_050334.jpg](/proxy/?url=https://content.instructables.com/FJY/84QJ/HZGTFHE3/FJY84QJHZGTFHE3.jpg&filename=20140831_050334.jpg)
The images show the step by step connections made on bread board. I started off with GND pins and then to the motor and then Arduino and finally the Battery Pack.
Code
I used the code from Arduino IDE. I tried with stepper_OneRevolution and stepper_OneStepAtATime example and they worked fine. The code is listed below.
/*
This program drives a unipolar or bipolar stepper motor. The motor is attached to digital pins 8 - 11 of the Arduino. The motor should revolve one revolution in one direction, then one revolution in the other direction. Created 11 Mar. 2007 Modified 30 Nov. 2009 by Tom Igoe */
#include
const int stepsPerRevolution = 200; // 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 at 60 rpm:
myStepper.setSpeed(60);
// 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); }
Final Testing
The testing video.