You are on page 1of 5

Laboratory Activity No.

2
Control of Stepper Motor

NAME:__________________________ DATE:_______________________
SECTION:_______________ INSTRUCTOR: ________________

Objectives
This experiment will enable the student
1. To control the direction of rotation of a stepper motor using H-bridge circuit.
2. To control the speed of rotation of a stepper motor.
3. To control the angular displacement of the stepper.
4. To create a computer program user interface to send data control to Arduino

Equipments and Materials


Qty Equipment/Materials
1 Personal Computer
1 Arduino microcontroller
1 Conveyor system
1 L293D motor driver
1 Power supply
1 Breadboard
8 Alligator clips
1 set Connecting wires

Introduction:

Arduino, conveyor and a stepper motor were used for this experiment. The
movement of the conveyor is controlled by the stepper motor through a program
implemented in Visual Studio and Arduino. Visual Studio is a computer software
that used to develop a program with an interface. Arduino is an open-source
platform used for building electronic projects. The communication between the
Arduino and Visual Studio is done using ASCII over serial/usb. The Arduino will
control the Stepper motor and the visual studio will provide the interface to
execute commands.

The interface is compose of enable/disable buttons and a track bar. The track
bar will set a value of steps from 0 which is the starting point up to 24724, which
is the number of steps to reach the end point, An enable button should be pressed
each time the track bar value change since the program is not set on real time and
to avoid an error due to overlapping. A label box is also included for it to show
the distance in millimeter the conveyor have moved.
Procedures
A. Set-up
1. Connect the computer and Arduino microcontroller using USB serial cable

2. Connect the DC motor to the power amplifier IC as shown below:

8 11

To Stepper To Stepper

9 10

3. Connect pin 2,7,10 and 15 of the IC to pin 8, 9, 10, and 11 of the microcontroller
consecutively.
B. Arduino Program:
1. Create a program that will control the direction of the motor by sending the right
sequence of pulse to the motor. Sending the sequence of pulse to make the motor
rotate clockwise. Sending the sequence of pulse in reverse order to make the motor
rotate counter clockwise. Stop sending pulse will cause the motor to stop.

2. Create a program that will control the speed of the motor by controlling the pulse
frequency of the microcontroller.

3. Create a program that will control the angular displacement of the motor by sending
a number of steps in the microcontroller.
C. Graphical User Interface
1. Create the GUI to the Microsoft visual studio as shown below.
D. Interface Code
1. Create code for the program that it will send character A if you press clockwise
button, send character B if you press counter clockwise button and send
character C if you press stop button.

2. Create code for the program that it will send integer value that correspond to the
rotational speed of the motor.

3. Create code for the program that it will send integer value that correspond to the
number of steps the motor will take.

You might also like