How to Control Your Own Apparatus using PC Printer Port

Preview:

DESCRIPTION

How to Control Your Own Apparatus using PC Printer Port. Viraj Vishwakantha Jayaweera. Printer. Touch pad. Scanner. Microphone. CPU. Monitor. Speaker. Mouse. Key Board. All these devices can be divided in to two categories. Output. Output. Process. Output. Input. Input. Input. - PowerPoint PPT Presentation

Citation preview

CPU

Sp

eake

r

Monitor

Printer

Touch padScanner

Key Board

Mouse

Microphone

InputIn

pu

t

Output

Input

Output

Output

Input

All these devices can be divided in to two categories

Pro

cess

Motor

?

?Light Bulbs or LEDs

Water Censer Light Censer(LDR)

Micro Switch

Temperature Censer(Thermister)

?

Parallel Port (Printer Port)

USB(Universal Serial Bus)

RS232(Serial Port)

GPIB(Genaral Purpose Interface Bus)

Speaker MicrophoneLine In

Various types of connecters (communication ports) available in rear

side of CPU

100 101 102 103

1 1000 100 10

1000 * 0 = 0

100 * 1 = 100

10 * 6 = 60

1 * 4 = 4

= 164

Decimal Binary

We use Ten Symbols

0 1 2 3 4 5 6 7 8 9

20 21 22 23

1 8 4

8 * 1 = 8

4 * 1 = 4

2 * 0 = 0

1 * 1 = 1

= 13

We use Two Symbols

0 1 or Off On or Low Hi or 0V 5V

2

1 6 4 1 1 0 1 2

OutputOutput

Data 1Data 0

Data 2

Data 4Data 5

Data 3

Data 6Data 7ACKBusy

Paper EmptySelect

Strobe

InputInput

1 14

13 25

Initialize Printer

Auto FeedError

Select Input

Pins 18 – 25 Pins 18 – 25 GroundGround

OutputOutput

InputInput

8 Data Outputs (378 H)8 Data Outputs (378 H)

4 Other Outputs (379 H)4 Other Outputs (379 H)

5 Data Inputs (37a H)5 Data Inputs (37a H)

1 14

13 25

-+

5V

VCC

470 ohm

LED

Printer Port

Example in Qbasic

Out &H378,1 (for LED off)

Out &H378,0 (for LED on)

Example in Qbasic

Out &H378,1 (for LED off)

Out &H378,0 (for LED on)

1 14

13 25

LED

470 ohm

5 V

D0D1

D7

D2

Printer Port

NumberOutput Data bit pattern

D7 D6 D5 D4 D3 D2 D1 D0

0 0 0 0 0 0 0 0 0

1 0 0 0 0 0 0 0 1

2 0 0 0 0 0 0 1 0

3 0 0 0 0 0 0 1 1

4 0 0 0 0 0 1 0 0

5 0 0 0 0 0 1 0 1

6 0 0 0 0 0 1 1 0

255 1 1 1 1 1 1 1 1

0 = 0V (Low state) 1 = 5V (High state)

IN+

IN-

Comparator

¼ LM339

R43.3kohm

12V

VCC

R2100kohm

R3

10kohm

From

Printer Port

R5

R110kohm

3.3kohm

D400

1N4007D1

X

Y

K2

RELAY52

4

230 V ACL N

230V AC Motor

1 14

13 25

Printer Port

Switch

we can use Qbasic function inp()

X = Inp( &H379)

Print X

we can use Qbasic function inp()

X = Inp( &H379)

Print X

10

25

100 k

Preset

IN+

IN-

Comparator

10kohm

12V

To Printer

Port Input

100kohm

100kohm

52

4

5.6kohm

¼ LM339

LDR

1 M

Preset

Recommended