• No results found

Device Switching Using Pc's Parallel Port

N/A
N/A
Protected

Academic year: 2019

Share "Device Switching Using Pc's Parallel Port"

Copied!
24
0
0

Loading.... (view fulltext now)

Full text

(1)

DEVICE SWITCHING USING PC'S PARALLEL PORT

F ARAHIY AH BINTI GHAZALI

This Report Is Submitted In Partial Fulfillment Of Requirements For The Bachelor Degree Of Electronic Engineering (Industrial Electronic)

Faculty of Electronic Engineering & Computer Engineering Universiti Teknikal Malaysia Melaka

(2)

UNIVERSTI TEKNIKAL MALAYSIA MELAKA

FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER BORANG PENGESAHAN STATUS LAPORAN

PROJEK SARJANA MUDA II

Tajuk Projek Sesi

Pengajian

DEVICE SWITCHING USING PC'S PARALLEL PORT

2006/2007

Saya ... FARAHfYAH BINTI GHAZALI ... . (HURUF BESAR)

mengalcu membenarkan Laporan Projek Sarjana Muda ini disimpan di Perpustakaan dengan syarat-syarat kegunaan seperti berikut:

l. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.

2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.

3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi pengajian tinggi.

4. Sila tandakan (

0 )

:

D

SULIT*

D

TERHAD*

0

TIDAK TERHAD

l

(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia seperti yang termaktub di dalam AKT A RAHSIA RASMI 1972)

(Mengandungi maklumat terhad yang telah ditentukan oleh organisasi/badan di mana penyelidikan dijalankan)

Disahkan oleh:

AN PENULIS) (COP

D

::.

f

A.

Ji::

:G

:

'\

PEI'YEL!A) Ala mat Tetap: BATU 12, KAMPUNG RAMBAI.

TOKAI, 06660, ALOR STAR, KEDAH.

Tarikh: ...

J~

.

.J

o

.~

.

. /v.l.

.

.

...

sm

HUZAIMAH BT HUSIN

Pensyarah

Fakulti Kej Eletltronik dan Kej Kom~tuter (FKEKK), Untversiti Tek,ll<al Malaysia Melaka (UTeM),

l<arung Beril.und 1200,

(3)

111

"I agree that this report is my work except for some summary and information which I already stated"

Signature

Name

Date

..

.

~'

..

: F ARAHIY AH BINTI GHAZALI

(4)

"I admit that to have read this report and it has follow the scope and quality in Partial

Fulfillment of Requirement for the Degree of Bachelor of Electronic Engineering (Industrial Electronic)"

Signature

Supervisor's Name

Date

: ...

~~~

... .

: MADAM SIT! HUZAIMAH BINTI HUSIN

: 3o AfR-/.L

(5)

v

DEDICATION

(6)

VI

ACKNOWLEDGEMENT

My sincerest appreciation must be extended to my supervisor, Madam Siti

Huzairnah binti Husin who has sent in valuable advice, comments, corrections, and

suggestions. Her consultation and assistance have enabled me to present this fmal year

project. I also extend my thanks and appreciation to all of my friends who were directly

(7)

Vll

ABSTRACT

This project proposed a system that could control different devices at home or

industry by using a single PC. This project aims to control the printer power, loads &

other household electrical appliances. The circuit comprises decoder, inverter, latch &

relay driver sections. To control these equipments the system are using PC's parallel port. The PC parallel port is a powerful and efficient platform for implementing projects dealing with the control of real-world peripherals. The program of controlling this

equipment is written in C language. The computer program through the interface circuit controls the relays, and then act as a switch to on or off the appliances. It is compiled

(8)

Vlll

ABSTRAK

Projek ini mencadangkan satu sistem yang boleh mengawal alatan di rumah atau

industri dengan hanya menggunakan sebuah komputer peribadi. Projek pensuisan ini

bermatlamat untuk mengawal pencetak, beban dan peralatan elektrik di rumah yang lain.

Litar untuk projek ini terdiri daripada penyahkod, penyongsang, selak, dan bahagian

pemacu geganti. Untuk mengawal kelengkapan tersebut, sistem ini menggunakan liang

selari komputer peribadi. Liang selari komputer peribadi ini adalah sebuah pelantar yang

berkuasa dan efektif untuk melaksanakan projek yang berkaitan dengan mengawal

perkakasan dalam kehidupan sebenar. Aturcara untuk mengawal

kelengkapan-kelengkapan ini ditulis dalam bahasa C. Aturcara komputer melalui litar pengantara

akan mengawal geganti, dan kemudian bertindak sebagai suis untuk membuka dan

menutup perkakasan. Seterusnya ia akan disusun menggunakan Penyusun Turbo C.

Selain itu, aturcara perisian membolehkan pengguna untuk mengetahui status semasa

(9)

lX

TABLE OF CONTENTS

CHAPTER DESCRIPTION PAGE

PROJECT TITLE

VERIFICATION OF WORK iii

SUPERVISOR'S APPROVAL iv

DEDICATION v

ACKNOWLEDGEMENT vi

ABSTRACT vii

ABSTRAK viii

TABLE OF CONTENTS ix

FIGURE LIST xi

TABLE LIST xii

DIAGRAM LIST xiii

FLOWCHART LIST xiv

LIST OF APPENDIX XV

I INTRODUCTION

1.1 Introduction 1

1.2 Project Objectives 3

1.3 Project Statement 3

1.4 Scope of Work 4

1.5 Project Methodology 4

1.6 Thesis Arrangement 5

II LITERATURE REVIEW

(10)

III

IV

v

2.1.1 Introduction to Parallel Port

2.1.2 Centronics

2.1.3 Parallel Port Address

2.2 IC 74LS154: 4-line to 16-line Decoder I

De-Multiplexer

2.3 IC 74LS74: Dual D-Type

Positive-Edge-Triggered Flip-Flops

2.4 IC 74LS05: Hex Inverter

2.5 IC ULN 2803: Octal Peripheral Driver Arrays 2.6 Relay

PROJECT METHODOLOGY 3.1 Introduction

3.2 Project Plan and Requirement 3.3 Circuit Construction

3.4 Flowchart of the Project

3.5 Software Development

RESULT AND PROJECT ANALYSIS 4.1 Expected Result

4.2 Result

4.3 Programming

CONCLUSION AND SUGGESTION

5.1 Discussion and Suggestion

5.2 Conclusion

(11)

Xl

FIGURE LIST

CHAPTER FIGURE DESCRIPTION PAGE

II

2

.

1

Parallel Port Pin Layout 7

II

2.2

Logic Symbol for IC 74LS74 18

II

2

.

3

Clock to Output Delays, Data Set-up and Hold 22

Times, Clock Pulse Width Waveforms

II

2.4

Set and Clear to Output Delays, Set and Clear 22

Pulse Width Waveforms

II

2.5

IC 74LS05 23

n

2

.

6

ULN 2803 25

II

2.7

ULN 2803 Pin Layout 26

II

2

.

8

Output and Input Characteristics for ULN 2803 28

II

2

.

9

Relay symbol 28

III

3

.

1

Block diagram for project methodology 31

III

3.2

PCB Design using Proteus 32

III

3.3

Circuit drawing transition to transparency 33

III

3.4

Laminated PCB board with thin film and circuit 33

drawing

III

3.5

UV exposure process 34

III

3.6

PCB board soaking process 34

III

3.7

Etching process 35

IV

4.1

Switching Circuit 42

IV

4.2

The PCB layout which is design in the Proteus 44

software (top view)

IV

4.3

The PCB layout which is design in the Proteus 45
(12)

xii

TABLE LIST

CHAPTER TABLE DESCRIPTION PAGE

n

2.1 Parallel Port Pin Details 8

II 2.2 Data Port Pin's Description 9

II 2.3 Status Port Pin's Description 9

II 2.4 Control Port Pin's Description 10

II 2.5 Parallel Port Address 14

II 2.6 Function Table for IC 74LS 154 16

II 2.7 Recommended Operating Conditions for 16

IC 74LS154

II 2.8 Electrical Characteristics for IC 74LS154 17

II 2.9 Switching Characteristics for IC 74LS 154 17

n

2.10 Function Table for IC 74LS74 19

II 2.11 Recommended Operating Conditions for 20 IC 74LS74

II 2.12 Electrical Characteristics for IC 74LS74 21

II 2.13 Switching Characteristics for IC 74LS74 21

II 2.14 Function Table for IC 74LS05 24

II 2.15 Recommended Operating Conditions for 24 IC 74LS05

II 2.16 Electrical Characteristics for IC 74LS05 24

(13)

Xlll

DIAGRAM LIST

CHAPTER DIAGRAM DESCRIPTION PAGE

I

1

.

1

Block Diagram of the System 2

I

1.2

Block diagram for main components of the 2

switching system

II

2.1

Simplified diagram of the Centronics Protocol 12

II

2.2

Connection Diagram for IC 74LS154 15

II

2.3

Logic Diagram for IC 74LS74 18

II

2.4

Connection Diagram for IC 74LS74 19

II

2.5

Connection Diagram for IC 74LS05 23

II

2.6

Connection Diagram for IC ULN2803 26
(14)

CHAPTER FLOW CHART

III 3.1

III 3.2

FLOWCHART LIST

DESCRIPTION

The entire project methodology

Project's hardware methodology

XlV

PAGE

36

(15)

NO

A

B

c

D

LIST OF APPENDIX

DESCRIPTION

IC 74LS154 data sheet IC 74LS74 data sheet IC 74LS05 data sheet ULN 2803 data sheet

XV

PAGE

52

53

(16)

CHAPTER I

INTRODUCTION

1.1 Introduction

The PC's parallel port is most commonly used port for interfacing home made

project. The PC's parallel port adapter is specifically design to attach printer with a

parallel port interface, but it can be used as a general input/output port for any device or appliances that matches its input/output capabilities. The computer program through the

interface circuit controls the relays, which, in turn, switch the appliances on or off.

The parallel port has 12 outputs including 8 data lines and 4 control lines. It can be used to control up to 255 electrical appliances using only eight data lines from the

(17)

2

Computer Program &

OUTPUT

Internal

INPUT (appliances

(keyboard) Circuitry ON or

(PC's

Parallel OFF)

Port)

Diagram 1.1: Block Diagram of the System

The block diagram in Figure 1 depicts the main components of the switching

system for electrical loads using PC. The control command to switch on/off the

appliances is given through the keyboard. The software program scans the input and as

per the input command, the data is available at the parallel port.

IC 74LSI54 OUT IC 74LS74

IC74LS05 O.TYPE ICULN210l RII.AYSAND DECODER

t----1 H H RII.AY ~ IUClRICAL

INVERJfR fllP.fLOp

(LATCH) DRIVIRS APPLIANCES

2 COMPUTER

SYSTEM

r

--

-

---

---

-

-

-

--

-

----

,

I

I

El'iA.BU

COMPIJilJ\

2HINO. I rAJ.ro

INPliT PRO CRAM I (KIYBO.Wl) H .t INTERN.U. ___, CONNECTOR D4-D7

CIRCUITRY LPTPORT

I I

I

-

-

----

___

_

____

_

__

__

....

___, IC 74LSI54

DECODER

I

Diagram 1.2: Block diagram for main components of the switching system

Out of eight bits, first four bits (DO through D3) are data signal bits and the

remaining four bits (04 through 07) are used as control signals. Control signals are

given to decoder 1. The output of decoder 1 is given to Enable pins of decoders 2. Data signals are given to decoder 2. The outputs of decoder 2 are inverted and fed to a D-type

(18)

3

ULN2803. The relay drivers drive the relays for switching the appliances. But in this project, I've only used LED to represent as electric appliances.

1.2 Project Objectives

The main objective of this project is to build a switching system that can control

home appliances by only using a single PC and at the same time this system could also provide convenience and easier lifestyle. This system is not only easy to use but it also

reveals people nowadays using high-technology like using in advanced country. Beside

as a convenient, this control system also provides more safety environment in home.

1.3 Project Statement

In this decade, there are many new technologies which are being implemented in real world for making life easier. Some of these technologies are expensive but offered a very good service and there are some cheaper but yet still provide good service for users.

Based on all this aspect, I have come up with this good and acceptable proposed

project. Although it is quite costly but is very efficient in control real world peripheral. This project is actually provides users a simple life by giving more choices to them. This switching system allowed users to control home appliances by only using a PC. The

(19)

4

1.4 Scope Of Work

The scope of work for this project is mainly about produce a convenience switching device controlling by only a single port and make a test in order to prove the

efficiency of the project. This device must be able to control the entire load that is needed by the user. The study of how the parallel port is working and its characteristic

must be done. Since this project is using C language as its software programming, the study of this language also must be done. Besides, the software programming must be

easy to understand by the user in order to allow them to know the current status of the loads. This project is involved hardware and software programming, so to make sure this project work successful, the test must be done before and after combination.

1.5 Project Methodology

The first process in this project is to search and create ideas which are relevant to the project I'm working with. Then, the next process is to start the literature study on the project. These are done by referring a number of books and surf the internet which guided me to retrieve relevant and useful information on this project. The following process is to design and simulate the project circuit. After the simulation, the circuit is drawn and PCB layout is printed out. The components then are placed and soldered on

(20)

5

1.6 Thesis Arrangement

Generally, this thesis comprises five chapters.

Chapter I will describe in general why this project is done.

Chapter II then will discuss related theories with this project. These theories are

useful as comprehension for me to execute this project.

Chapter IV will present the result of this project. Every result will follow by

briefly description to support the result.

Finally, the last chapter will clarify the conclusion for this project. This chapter

(21)

CHAPTER II

LITERATURE REVIEW

2.1 Parallel Port

2.1.1 Introduction to Parallel Port

PC's parallel port can be very useful

VO

channel for connecting own circuits to

PC. The PC's parallel port can be used to perform some very amusing hardware

interfacing experiments. Parallel port differs from serial ports primarily in that they use

eight pins to carry data instead of just one. When all eight pins are transmitting in

parallel, the computer can send an entire byte in the time that a serial port takes to send 1

bit. The parallel port is traditionally associated with printer connections, but in recent

years, the interface has come to be used to connect external devices.

Computers typically have one parallel port, although system BlOSs support up to

three. The parallel port or line printer terminal (LPT) port is a 25-pin D-type female

connector available at the back of a PC. A basic PC usually comes with one or two LPT

(22)

7

D7 D6 DS

D4

D3

D

2

Dl

DO

S7

S6 S5 S4 S3

[image:22.597.55.540.42.775.2]

C3 C2

Cl CO

Figure 2.1: Parallel Port Pin Layout

The original parallel port, called standard parallel port (SPP), is a bundle of three

ports (or registers), namely, data port, status port, and control port. The computer uses

the control lines to transmit operational signals to the connected device. The status lines

are indicators of the device's condition, such as when a printer runs out of paper or

experience an error. The data lines carry the actual application data from the computer to

the device. Pins 2 through 9 form the 8-bit data port. This port is purely a write-only

port. This means it can be used only to output some data through it. Pins l, 14, 16, and

17 form the control port, which is capable ofreading/writing. Pins 10 through 13 and pin

15 together form the status port. The status port is a read-only port. The details of 25-pin

(23)
[image:23.598.64.541.35.597.2]

8

Table 2.1: Parallel Port Pin Details

Parallel port Port signal Direction Hardware Register

pin no. Name inverted

1 NStrobe 1/0 Yes Control

2 DO Out Data

3 Dl Out Data

4 D2 Out Data

5 D3 Out Data

6 D4 Out Data

7 D5 Out Data

8 D6 Out Data

9 D7 Out Data

10 NACK In Status

11 Busy In Yes Status

12 Paper Out In Status

13 Select In Status

14 Nauto-Lf I/0 Yes Control

15 Nerror In Status

16 Ninitialize I/0 Control

17 Nselect 1/0 Yes Control

18-25 Ground Gnd

(24)
[image:24.598.77.540.52.571.2]

9

Table 2.2: Data Port Pin's Description

Offset I

I Name !Read/Write Bit No. Properties

Base+ 0 1 Data I I Write Bit 7 Data 7 I

Port

I

Bit 6 Data 6

I

I

I

l

Bit 5 Data 5

- I

I

I

I

---

-I

Bit 4 Data4

I

i

~--

- - - -

---1

I Bit 3 Data 3

I

I

!

Bit 2 Data 2

I

Bit I

I

Data 1

~--

r· -

-·--·-·~-

-Bit 0 DataO

I

-

- - - -

- -

-

--

-

-

-

-This Data Register is simply used for outputting data on the Parallel Port's data lines

[image:24.598.52.550.244.798.2]

(Pins 2-9). If the port is bi-directional, it can receive data on this address.

Table 2.3: Status Port Pin's Description

,....---I

-·-I

Offset Name Read/Write Bit No. Properties

-

- -

--

--

-

·-

- - - i

Base + l Status Read Only Bit 7 Busy I

Port Bit 6 Ack

j

---

- -··---

-Bit 5 Paper Out

Bit 4 Select In

Bit 3 Error

Bit 2 IRQ (Not)

Bit l R~served

Bit 0 Reserved

-

-The Status Port (base address + 1) is a read only port. Any data written to this port will

Figure

Figure 2.1: Parallel Port Pin Layout
Table 2.1: Parallel Port Pin Details
Table 2.2: Data Port Pin's Description

References

Related documents

- Using your connector cable connect the output port (Number 2 on the rear panel) to the output device (Video, TV).. - Using your connector cable connect the input port (Number 1

(Optional) If your VGA-enabled video source device includes an audio output, connect the audio source output on the device to the 3.5mm audio input port #2 on the VS221VGA2HD using

§ using header field values, lookup output port using forwarding table in input port memory (“match plus action”). § goal: complete input port

Other Routers VC Allocator Input Port VC state crossbar switch Routing Module Switch Allocator Input Port VC state Output Port Output Port crossbar switch

§ using header field values, lookup output port using forwarding table in input port memory (“match plus action”). § goal: complete input port

Connect the speaker or the MIC to the audio input port in the PC and then connect the earphone to the audio output port in the device rear panel.. Login the Web and then click

General Multiport and other options Software fixture Summary PORT 1 PORT 3 PORT 2 PORT 4 DUT C(P)-L(S)-P Capacitance(Parallel)-Inductance(Series)-Device Port L(P)-C(S)-P

The figure below shows the circuit diagram used to interface 16-bit output port.. Two latches are used to connect 16 LEDs with