Home Parallel Port Serial Port USB Webboard API I/O Today Project Directory .NET VB VC++



4 input /4 output board for PC Interface hardware project

This pc interface hardware project is circuit for 4 input / output with printer port interfacing
This project is a simple and inexpensive 4-way input/output interface for the Centronics printer port.

Output Section


Understanding in circuit diagram and process.

For output section is controlled by an eight line "Darlington Driver" integrated circuit (IC) or called a ULN2803 that using in thaiio's project. The digital state of each of the eight lines from the printer port is used to control the IC's internal "drivers" which in turn control the Relays and LEDs. Power for the relays and LEDs is provided using by the 12 volt regulator (LM 7812) via a plug pack power supply of at least 15 volts and capable of supplying at least 1 amp. In this interface, each of the eight output lines at the printer port is connected via a 560ohm to a LED. Four of the output lines also have relays attached.

   โครงงานนี้ งเราจะนำไปใช้ได้ทั้งควบคุมอุปกรณ์ภายนอก เช่น สเต็ปมอเตอร์,เปิดปิดหลอดไฟ เป็นต้น และ มีในส่วนของการรับสัญญาณภายนอก เช่น สวิท์ช,เซ็นเซอร์ เป็นต้น
จริงแล้วพวกเราอาจจะรู้แล้วเพราะเป็นวงจรพื้นฐานทั่วไป ผมจะไม่ขอเอธิบายเป็นภาษาไทยมากนัก เพราะงไม่มีอะไรมาก ดูตามลำดับของเนื้อหาภาษาอังกฤษ แบบคราวๆก็คือ
  • ดูวงจรการต่อของ IC ULN2803 ซึ่งทำหน้าที่เป็น Driver ในการขับกระแสไฟฟ้าไปที่อุปกรณ์เช่น LED ,Relay
  • ทำ PCB ดังรูปด้านล่าง
  • จัดหาอุปกรณ์ ตามรายการด้านล่าง
  • จัดวางอุปกรณ์และทำการบัดกรี ดังรูปด้านล่าง
  • เขียนโปรแกรม ถ้าใครยังไม่รู้ก็ เข้ามาศึกษานี้ได้ครับ
    งการเขียนโปรแกรมติดต่อ Printer Port

How to Coding for Control and Access Printer Port:

This code in control output thus below:

[Out : command][Address Port : ie. &378 ][Output Value : Hex]

where

[output code] = 1, 2, 4, 8, 16, 32, 64, or 128 and

[address port] if we use decemal may be 888, or 631 depending upon your hardware. if LPT 1 (888) doesn't work, try 631 which is LPT 2.

Examples:

' This "4" is exemple value send to port.

C and C++ --| outp(0x378, 4);

Pascal ---|    Port[888] := 4;

BASIC ---|      OUT 888,4

Visual Basic 6 ---|
Click Here to Get the Dllport.dll I/O Parallel Port for Windows 95,98,NT,Me,Windown XP,2000

      Private Declare Sub Out Lib "DllPort.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
     Out(&H378, 4)

Input Section

Regrading Input signal receive for each of the four input lines can detect the open/closed state of a switch. For each line is buffered using the 74LS244 IC. The IC provides a degree of protection for the computer, but it is VERY important that no current is connected to the inputs. Only switches may be used on the input lines!!

How to Input Coding for read value at the printer port :

[in : command][Address Port]

Where:

[Address Port] is one higher than the corresponding output address for the printer port. Such as LPT1 is Hex "379", or LPT2 is Hex "279",if the decemal value is 889 and 632

Examples:

C and C++ --| Inp(0x379);

Pascal - InValue := Port[889];

Visual Basic version 6

Private Declare Function Inp Lib "DllPort.dll" Alias "Inp32" (ByVal PortAddress As Integer) As Integer
    Inp(&H379)

or
    Inp(888)

PCB Assemply


PCB

Parts Component List

Item Description QTY
1 IC ULN 2803 8-way line driver 1
2 IC 74LS244 octal buffer 1
3 LM7805 regulator IC 1
4 10kohm 1/4 watt resistor 1
5 1000uF electrolytic capacitor 1
6 LM7812 regulator IC 1
7 0.01uF greencaps (approx) 2
8 3mm red LEDs 8
9 560ohm 1/4 watt resistors 8
10 1 amp diode bridge 1
11 100kohm 1/4 watt resistors 4
12 25 pin DB PCB mount female socket < 1
13 2.1mm power socket 1
14 15 volt AC/DC 1 amp (minimum) plugpack power supply (2.1mm plug) 1
15 2-way PCB connectors 4
16 12 volt SPDT relays 4
17 mini pushbuttons 4
18 3-way PCB connectors 4
19 1.5m hookup wire 4
20 PCB 1

Final Recomment :

About once the value at the port has been read, you should be use "ANDing" to determine which individual line is either HIGH, or LOW.

The "PCB mounted DB25 Socket" connects via a 'serial' cable to the printer port.

Item 1: The cable must be a male-male (plug-plug) type with 'straight through' connections. ie 1 to 1, 2 to 2, 3 to 3, etc. This type of cable is commonly used with printer switch boxes. (A "null modem" cable has lines 2 and 3 crossed and is not suitable - unless you make allowances in your programming.)

Item 2: This power supply for the interface can be either AC or DC as long as it can deliver at least 1 amp. The diode bridge makes connection fool proof. The power supply can be connected either way around.


Referrent from : http://www.southwest.com.au/~jfuller/robotic.html

Copyright (c) 2000 thaiio.com all rights reserved. Contact webmaster :webmaster@thaiio.com