Sie sind auf Seite 1von 4

Laboratory Activity No.

1
DC Motor Control with Computer and Microcontroller Interfacing

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

Objectives
This experiment will enable the student
1. To control the direction of rotation of a DC motor using H-bridge circuit.
2. To control the speed of rotation of a DC motor using Pulse width modulation.
3. To create an Arduino programming to control the DC motor.
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:

The objective of the experiment is to control the speed and the direction of the conveyor
with the use of the DC motor. With this, the members will use motor driver which is L293D.
The function of this motor driver is for the DC motor to change its direction from clockwise
to counterclockwise and vice-versa.

MS Visual Studio provides graphical user interface (GUI) to control the Arduino board.
When you input a command in the computer, this program will trigger the Arduino and its
output will be the input of the motor driver then the motor driver will make the DC motor to
function.

The GUI consists of clockwise, counterclockwise and stop buttons by which when
clicked, runs. The track bar controls the speed of the motor. 0-255 represents the speed of
the motor. When you move the track bar from left to right, the motor speeds up, and when
you move it from right to left it speeds down.
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:

3. Connect pin 2 and pin 7 of the IC to pin 4 and pin 5 of the microcontroller.
B. Arduino Program:
1. Create a program that will control the direction of the motor by sending character
message to the microcontroller. Sending character A will make the motor rotate
clockwise. Sending character B will make the motor rotate counter clockwise.
Sending character C will cause the motor to stop.

2. Create a program that will control the speed of the motor by controlling the pulse
width of the microcontroller. The width of the pulse depend on the sent integer to the
microcontroller ranging from 0 to 255. Sending 0 will cause the speed of the motor
to the slowest (stop). Sending 255 will cause the speed of the motor to the fastest.
C. Graphical User Interface

1. Create the GUI to the Microsoft visual studio as shown below.

D. Interface Code
1. Code 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. Code the program that it will send integer on the slider every time you press it.

Das könnte Ihnen auch gefallen