Stepper Motor Control Unit
Stepper Motor Control Unit
PROCEDURE:-
• Go to https://www.arduino.cc/en/Main/Software - select windows 10 &
just Download.
• Double click the arduino-2.0.1-windows setup file & proceed with installation
by simply clicking ‘agree & next‘ in installation pop-up window.
• Double click Arduino icon. Open library manager install Adafruit Motor shield
v1.0.1
• Go to Menu - File → New. Write c program for stepper motor control unit.
• go to menu bar &click on verify ✅ option.(clear if any errors are there)
• Connect your Arduino board to laptop using it’s usb cable
• Go to menu – Tools – Board - Arduino Uno R3.
• Go to Tools → Port - COM3(Arduino uno)
• go to Menu – select the right arrow icon ➡ (Upload).
• Then remove the usb cable from Arduino board
• Connect the circuit as per circuit diagram
• Make sure all the connections are made properly & avoiding loose connections.
• Switch on the power supply and verify its functionality with theoretical.
PIN CONNECTIONS:
• L293D motor module designed in a way as that it can be directly placed on
Arduino uno board.
• There would be 4 terminals for the stepper motor connect 1st 2 terminals to the
2 ports of M3 of the L293D, another 2 terminals to the 2 ports of M4 of the
L293D module respectively.
• Red wire(+5v) of stepper motor wire should be ignored.Because providing
source to stepper motor through L293D module which is connected to battery
• ARDUINO CODE:-
#include <AFMotor.h> //Adafruit motor shield package
const int stepsPerRevolution = 48;
// 48 steps per output rotation, Change this as per your motor's specification
AF_Stepper motor(stepsPerRevolution, 2);
void setup() {
motor.setSpeed(100 ); // 100 rpm
}
void loop() {
//Single step coils
motor.step(100, FORWARD, SINGLE);
motor.step(100, BACKWARD, SINGLE);
//Microsteps coil
motor.step(100, FORWARD, MICROSTEP);
motor.step(100, BACKWARD, MICROSTEP);
}
OBSERVATION:-
• The actuator moved in to and fro according to the given program.
RESULT:- Thus designed the stepper motor control unit & verified its functionality.