You are on page 1of 17

PROJECT REPORT

HARDWARE INTERFACING

SUBMITTED BY:

SARMAD ASLAM (3178)


DC MOTOR SPEED CONTROL
Via PARALLEL PORT
TABLE of CONTENTS
1. Component List ……………………………………………………………… 4

2. ICS Configuration
a. DM74LS04 Hex Inverting Gates:
General Description…………………………………………………… 5
Function Table………………………………………………………… 5
Absolute Maximum Ratings………………………………………….. 5

b. DM74LS138 Decoder:
General Description…………………………………………………… 6
Function Table………………………………………………………… 7
Logic Diagrams…………………………………………………………7
Absolute Maximum Ratings…………………………………………...7
c. 555 timer IC:
General Description…………………………………………………… 8
Connection Diagram……………………………………………………8
Absolute Maximum Ratings…………………………………………...9

3. Introduction to Parallel Port…………………………………………….9

4. Construction…………………………………………………………………...10

5. Circuit Diagram……………………………………………………………….10

6. Working……………………………………………………………………………11

7. Astable circuits…………………………………………………………………11

8. Programming……………………………………………………………………13

9. Programming Codes…………………………………………………………13

10. Application:
Office equipment, medical equipment………………………………………...17
Commercial applications……………………………………………………….17
Industrial applications………………………………………………………….17
Vehicle applications…………………………………………………………….17
COMPONENT LIST:

IC1 74LS138

IC2 74LS04

IC3 74LS04

IC4 555

VARIABLE RESISTANCE: VR1-VR8

R1: 1M VARIABLE

R2: 56K ohm

R3: 1K ohm

DIODES: D1-D8

C1: 0.1µF

C2:0.1 µF

NPN Transistor

DC motor 5V
ICS CONFIGURATION:

DM74LS04 Hex Inverting Gates:


General Description:
This device contains six independent gates each of which performs the logic
INVERT function.

Function Table:

Input Output

A Y

L H
H L

H = High Logic Level


L = Low Logic Level
Absolute Maximum Ratings:
Supply Voltage 7V
Input Voltage 7V
Operating Free Air Temperature Range
DM54LS and 54LS - 55 C to + 125 C
DM74LS 0 C to + 70 C
Storage Temperature Range - 65 C to + 150 C
DM74LS138 Decoder:

General Description:

These Schottky-clamped circuits are designed to be used in high-performance


memory-decoding or data-routing applications, requiring very short propagation
delay times. In high-performance memory systems these decoders can be used to
minimize the effects of system decoding. When used with high-speed memories,
the delay times of these decoders are usually less than the typical access time of
the memory. This means that the effective system delay introduced by the
decoder is negligible.

The DM74LS138 decodes one-of-eight lines; based upon the conditions at the
three binary select inputs and the three enable inputs. Two active-low and one
active-high enable inputs reduce the need for external gates or inverters when
expanding. A 24-line decoder can be implemented with no external inverters,
and a 32-line decoder requires only one inverter. An enable input can be used as
a data input for de-multiplexing applications.

The DM74LS139 comprises two separate two-line-to-four-line decoders in a


single package. The active-low enable input can be used as a data line in de-
multiplexing applications.

All of these decoders/de multiplexers feature fully buffered inputs, presenting


only one normalized load to its driving circuit. All inputs are clamped with high-
performance Schottky diodes to suppress line-ringing and simplify system
design.
Function Tables:

Logic Diagrams:

Absolute Maximum Ratings:

Supply Voltage 7V
Input Voltage 7V
Operating Free Air Temperature Range 0°C to  C
Storage Temperature Range Cto  C
555 timer IC:

General Description:

The 555 timer is an extremely versatile integrated circuit which can be used to
build lots of different circuits. It includes 23 transistors, 2 diodes and 16 resistors
on a silicon chip installed in an 8-pin mini dual-in-line package (DIP-8).

The LM555 is a highly stable device for generating accurate time delays or
oscillation. Additional terminals are provided for triggering or resetting if
desired. In the time delay mode of operation, the time is precisely controlled by
one external resistor and capacitor. For astable operation as an oscillator, the free
running frequency and duty cycle are accurately controlled with two external
resistors and one capacitor. The circuit may be triggered and reset on falling
waveforms, and the output circuit can source or sink up to 200mA or drive TTL
circuits.

Connection Diagram:
Absolute Maximum Ratings:
Supply Voltage +18V

Power Dissipation
LM555CM, LM555CN 1180 mW
LM555CMM 613 mW

Operating Temperature Ranges


LM555C 0˚C to +70˚C

Storage Temperature Range −65˚C to +150˚C

Introduction to Parallel Port:


The Parallel Port is the most commonly used port for interfacing. This port will
allow the input of up to 9 bits or the output of 12 bits at any one given time, thus
requiring minimal external circuitry to implement many simpler tasks. The port
is composed of 4 control lines, 5 status lines and 8 data lines. It's found
commonly on the back of your PC as a D-Type 25 Pin female connector. There
may also be a D-Type 25 pin male connector.
CONSTRUCTION:

The interface circuit consists of 1-of-8 decoder IC 74LS138 (IC1), hex inverter ICs
74LS04 (IC2 and IC3), resistor networks, timer IC 555 (IC4) and motor driver
transistor.

CIRCUIT DIAGRAM:
WORKING:

This circuit allows you to control the speed of a DC motor (in eight levels) from
your PC’s parallel port. The PC uses a software program to control the speed of
the motor. The motor is connected to the PC through an interface circuit. The
decoder IC accepts binary weighted inputs A0, A1 and A2 at pins 1, 2 and 3,
respectively. With active-low enable input pins 4 and 5 of the decoder grounded,
it provides eight mutually exclusive active-low outputs (Q0 through Q7). These
outputs are inverted by hex inverters IC2 and IC3.The resistor network
comprising presets VR1 through VR8, resistors R1 and R2 and capacitor C1 are
the timing components of timer IC 555 (IC4), which is configured in a stable
mode. The output of IC4 is a square wave, which is fed to the base of transistor
T1 via current-limiting resistor R3. Transistor T1 is used to drive the motor. The
pulse-width modulation (PWM) method is used for efficient control of the motor.
The output of the PC is decoded to select a particular preset (VR1 through VR8).
The value of the selected preset, along with resistors R1 and R2 and capacitor C1,
changes the output pulse width at pin 3 of IC4. Thus the motor speed can be
increased/decreased by choosing a particular resistance. For high-power motors,
the transistor can be replaced by an IGBT or a power MOSFET.

Astable circuits:

Astable circuits produce pulses. The circuit most people use to make a 555
astable looks like this:
As you can see, the frequency, or repetition rate, of the output pulses is
determined by the values of two resistors, R1 and R2 and by the timing capacitor,
C.

The design formula for the frequency of the pulses is:

PROGRAMING:

The software is written in ‘C’ language and compiled using Turbo C compiler.
Initially, when the motor is ‘off,’ the program prompts you to press ‘Enter’ key to
start the motor. Once you press the key, the motor starts running at full speed.
After a few seconds, the program asks you to press any key from the keyboard to
go to the next screen for controlling the speed of the motor. This screen has
options for increasing and decreasing the motor speed and also for exiting from
the program. For increasing the speed enter choice 1 and press ‘Enter’ key, and
for decreasing the speed enter choice 2 and press ‘Enter’ key. This action changes
the speed by one step at-a-time and the message “Speed de creased” or “Speed
increased” is displayed on the screen. To go to the main menu, again press
‘Enter’ key.

PROGRAMING CODES:
#include<stdio.h>
#include<conio.h>
#include<dos.h>
int a[7],i,c;

void start (void);

void main (void)

{
int P=0x0378,j,c=7,c1,x,y;

clrscr();
outportb(P,0);
textbackground(9);
textcolor(3);

for(x=0;x<=80;x++)
for(j=0;j<=25;j++)
{
gotoxy(x,j);
cprintf(" ");
}

for(i=0;i<8;i++)
a[i]=i;

gotoxy(23,11);
printf("press Enter to start the motor");
getch();

gotoxy(28,13);
printf("WAIT STARTING MOTOR");

start();

gotoxy(25,15);
printf("Motor started successfully");

gotoxy(2,17);
printf("Press any key for speed control");
getch();
while(1)
{
clrscr();

gotoxy(25,3);
for(j=0;j<79;j++)
{
gotoxy(j+1,2);
printf("*");
}

gotoxy(23,3);
printf("DC MOTOR SPEED CONTROL USING PC");

for(j=0;j<79;j++)
{
gotoxy(j+1,4);
printf("*");
}

printf("\n");
printf("\t\t\t1.INCREASESPEED\n\t\t\t2.DECREASE SPEED
\n\t\t\t3.EXIT");
for(j=0;j<79;j++)
{
gotoxy(j+1,8);
printf("*");
}
for(j=0;j<79;j++)
{
gotoxy(j+1,10);
printf("*");
}
gotoxy(1,9);
printf("Enter your choice");
scanf("%d",&c1);

switch(c1)
{
case 1:
if(c==7)
{
clrscr();
gotoxy(23,13);
printf("MOTOR IS RUNNING IN FULL SPEED");
getch();
}

if(c<7)
{
clrscr();
c++;
outport(P,a[c]);
gotoxy(33,13);
printf("SPEED INCREASED");
getch();
}

break;

case 2:

if(c==0)
{
clrscr();
gotoxy(23,13);
printf("MOTOR IS RUNNING IN LOW SPEED");
getch();
}
if(c>0)
{
clrscr();
c--;
outport(P,a[c]);
gotoxy(33,13);
printf("SPEED DECREASED");
getch();
}
break;

case 3:
for(j=c;j>=0;j--)
{
outportb(0x0378,j);
delay(100);
}
outportb(P,0);
clrscr();
gotoxy(17,13);
textcolor(2);
getch();
exit(1);
}
}

}
void start()
{
outportb(0x0375,0);
for(i=0;i<8;i++)
{
outportb(0x0378,i);
delay(1000);
}
}

APPLICATION:

Office equipment, medical equipment:

There is a wide variety of motorized office equipment such as personal


computers, computer peripherals, copy machines and fax machines as well as
smaller items such as electric pencil sharpeners. Motor controllers for these types
of equipment are built into the equipment. Some quite sophisticated motor
controllers are used to control the motors in computer disc drives. Medical
equipment may include very sophisticated motor controllers.

Commercial applications:

Commercial buildings have larger heating ventilation and air conditioning


(HVAC) equipment than that found in individual residences. In addition, motors
are used for elevators, escalators and other applications. In commercial
applications, the motor control functions are sometimes built into the motor-
driven equipment and sometimes installed separately.

Industrial applications:

Many industrial applications are dependent upon motors (or machines), which
range from the size of your thumb to the size of a railroad locomotive. The motor
controllers can be built into the driven equipment, installed separately, installed
in an enclosure along with other machine control equipment or installed in
motor control centers. Motor control centers are multi-compartment steel
enclosures designed to enclose many motor controllers. It is also common for
more than one motor controller to operate a number of motors in the same
application. In this case the controllers communicate with each other so they can
work the motors together as a team.

Vehicle applications:

All types of engine-driven vehicles from automobiles, airplanes, aircraft carriers


and agricultural equipment to zambonis may have electric motors to perform a
variety of functions. In electric vehicles, diesel-electric vehicles, and hybrid
vehicles, electric motors are used to propel the vehicle. The motor controllers in
vehicle applications are integrated into the vehicle.

You might also like