dig ckt

  • Upload
    vaibhav

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

  • 8/8/2019 dig ckt

    1/19

    1

    1.INTRODUCTION TO DEVICE CONTROLLING USING PARALLEL PORTOur project aim is to control turning on and off any device or machinery using pc. The

    device is electrically isolated from the PC using optocouplers. So, any variation in the load

    circuit does not affect the controlling circuit. Hence, it is a safe way to control the output. As ther

    are 8 bits, 8 devices can be controlled easily however with decoding 128 devices can be

    controlled.

    Parallel port communication is used to control the devices. A parallel port is a type of

    interface found on computers (personal and otherwise) for connecting various peripherals. In

    computing, a parallel port is a parallel communication physical interface. It is also known as a

    printer port or Centronics port. The IEEE 1284 standard defines the bi-directional version of the

    port, which allows the transmission and reception of data bits at the same time. Generally

    parallel port is used for Printers. The same protocol is used here to send command from the PC.

    An easy to use VB6 (Visual BASIC 6) program with a GUI (Graphical User Interface) is

    provided for controlling the devices. BASIC stands for Beginners All purpose Symbolic

    Instruction Code. A DLL (Dynamic Linked Library) is used for accessing the parallel port from

    the software.

    To control the device relays are used. The relays in our project have a rating of 250V AC

    and 5 Amps current. So the devices connected must not exceed these rating.

  • 8/8/2019 dig ckt

    2/19

    2

    2. INTRODUCTION TO PARALLEL PORT LPT1The parallel port or line printer terminal (LPT) port is a 25-pin D-type female connector available at

    the back of your PC. A basic IBM PC usually comes with one or two LPT ports. 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. 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 I, 14, 16, and 17 form the control port,

    which is capable of reading/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 parallel port are given in following table.

    The base address of the first parallel port (LPT1) is 0378 in hexadecimal (hex) notation (or 888 in decimal

    notation). The base address of the second parallel port (LPT2) is 0278 in hex. In this project, weve used

    only LPT1.

  • 8/8/2019 dig ckt

    3/19

    3

    The pin outs of LPT1 connector is shown below:-

    The lines of DB25 connector are divided into three groups:-

    1) Data Lines (Data bus)

    2) Status Lines

    3) Control Lines

    As the name refers, data is transferred over data lines, Control lines are used to control the

    peripheral and the peripheral returns status signals back to the computer through Status lines.

  • 8/8/2019 dig ckt

    4/19

    4

    3. BLOCK DIAGRAM OF SYSTEM

    The block diagram shown below shows the main components of the system for switching

    multiple devices using a personal computer. The control command to switch the devices

    on/off is given through the keyboard. The software program which can be developed in any

    programming language such as VB6, C, C++, VB.net etc. scans the input and, as per the

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

  • 8/8/2019 dig ckt

    5/19

    5

    4. CIRCUIT DESCRIPTION:

    The basic circuit comprises of a Relay, an Opto-coupler IC numbered MCT2E, .

    The commands for hardware functioning are given through the keyboard. The commands

    after being scanned by the software program result into an appropriate voltage generation for

    hardware. In the hardware there are 2 stages mutually connected to each other through the Opto-

    coupler. The other end of the Opto-coupler is the output end, which is connected to

    ULN2803. This ULN2803 drives relay to control applications.

  • 8/8/2019 dig ckt

    6/19

    6

    5. COMPONENTS

    The components used in the hardware circuit are as follows:-

    5.1) Opto-Coupler

    The Opto-Coupler is an Integrated Circuit. The number of the IC used is MCT2E.

    Basically an optocoupler is a combination of a light source and a photosensitive detector. In the

    optocoupler, or photon coupled pair, the coupling is achieved by light being generated on

    one side of a transparent insulating gap and being detected on the other side of the gap without

    an electrical connection between the two sides (except for a minor amount of coupling

    capacitance).

    The particular MCT2E Opto-Coupler IC is used in this circuit is a 6 pin IC. The ICconsists of a diode at the input side by the pin no. 1 as the anode and the pin no. as the cathode

    of the diode. The pin no. 3 is not used and represents no internal interconnection. The other 3

    pins of the IC represent the output side of the IC which is a transistor. The pin nos. 4, 5, and 6

    represent the emitter, collector, and the base respectively of the transistor. Diagrammatically, the

    IC can be viewed as :-

  • 8/8/2019 dig ckt

    7/19

    7

    The Pin-numbering and the corresponding

    functions are as follows:

    1As an Anode of the diode.

    2As a Cathode of the diode.

    3No internal connection (not used).

    4As an Emitter of the phototransistor.

    5As a Collector of the phototransistor.

    6As a Base of the phototransistor

    Characteristics:

  • 8/8/2019 dig ckt

    8/19

    8

  • 8/8/2019 dig ckt

    9/19

    9

    5.2) Octal High Voltage, High Current Darlington Transistor Arrays

    The eight NPN Darlington connected transistors in this family of arrays are ideally suited for

    interfacing between low logic level digital circuitry (such as TTL, CMOS or PMOS/NMOS) and

    the higher current/voltage requirements of lamps, relays, printer hammers or other similar loads

    for a broad range of computer, industrial, and consumer applications. All devices feature open

    collector outputs and freewheeling clamp diodes for transient

    Suppression.

    The ULN2803 is designed to be compatible with standard TTL families while the ULN2804 is

    optimized for 6 to 15 volt high level CMOS or PMOS

    These Darlington arrays are furnished in 18-pin dual in-line plastic

    packages (suffix A) or 18-lead small-outline plastic packages (suffix

    LW). All devices are pinned with outputs opposite inputs to

    facilitate ease of circuit board layout. Prefix ULN devices are rated

    for operation over the temperature range of -20C to +85C; prefixULQ devices are rated for operation to -40C.

  • 8/8/2019 dig ckt

    10/19

    10

  • 8/8/2019 dig ckt

    11/19

    11

    5.3) Relay:

    Relay is a circuit used for tripping and switching purposes. Here we have used two types

    of relays, which are as follows:-

    1-relay (6v, 100ohm, and 1c/o):-Used for signal tripping.

    2-relay (6v, 100ohm, and 2c/o):-used for double tripping.

    The detection of a fault and disconnection of a fully section or apparatus can be achieved by

    using fuses or relays in conjunction with circuit breakers. A fuse performs both detection

    and interruption functions automatically but its use is limited for the protection of low voltage

    circuits only, for high voltage circuits (say above 3.3kv), relays and circuit breakers are

    employed to serve the desired function of the automatic protective gear.

    Relay Classification:

    Relays have the same subsystem and principles of operation regardless of whether they

    are electromechanical or electronic, or designed to switch signal or high power loads.

    These principle functions are as follows:

    Conversion of an electrical input signal on primary side to an intermediate and non electric

    physical signal.

    Reconversion of this non electric physical signal to operate a switching element

    (secondary side) such as contacts which switch and conduct electrical current (output,

    load current).

    The use of the non electric signal between primary and secondary side provides the

    necessary galvanic separation between input and output circuits.

  • 8/8/2019 dig ckt

    12/19

    12

    6. PCB LAYOUT

  • 8/8/2019 dig ckt

    13/19

    13

    7. SOFTWARE

    Before beginning the work on software, there are various points that should be considered. These

    points are discussed as follow-

    Methodology:To understand the concept of software development, the predefined phases of

    the Software Engineering are to be followed. The phases included are as follows:

    1). Requirements Analysis

    2). Design

    3). Coding

    4). Testing

    To develop software each of the phases of software development model is to be

    implemented properly. The work done in various steps are :-

    7.1) Requirements Analysis:In this phase the, the focus is basically on the requirements of the project. To

    understand the nature of the programs to be built, the software engineer must understand

    the information required for the software as well as the required function, behavior,

    performance and interface. Firstly the information regarding the project is gathered such as why

    the software is needed, how the software will be better than the previous existing one, what

    technologies are needs for developing the software etc. The focus is specifically on the

    software.

    The requirements analysis also suggest that there should also exist some good

    facilities for developing an attractive Graphical User Interface (GUI).Besides these things it is

    also required that the functionality or the way to use the system should be simple so that a

    layman having elementary knowledge can also use it.

    For the project under consideration, it is obvious that the internal low-level

    interaction with the hardware should be abstracted from the user so as to facilitate the user to

    easily handle the system. The best programming language for achieving the hardware

    interaction is TURBO C. On the contrary one of the marked languages for developing a good

    user interface is the Visual Basic.

  • 8/8/2019 dig ckt

    14/19

    14

    DFD (Data Flow Diagrams)

    The data Flow Diagrams

    depict the Process Model of the

    system. DFD are also known as

    "Bubble Chart". They have the

    purpose of clarifying system

    requirements and identifying major

    transformations that will become

    programs in system Design.

    Following Data Flow Diagrams for

    controlling applications using pc:

    7.2) Design:

    Software design is actually a multi step process in itself. The design process translates

    the requirements into a representation of the software that can be assessed for quality before

    coding. In simple words the design phase aims at producing a model or representation of an

    entity that will later be built.

    For the system under consideration the physical specification obtained afteranalyzing the requirements indicate that there is a requirement of a program so as to deal with

    the printer port and another program to interact with the user.

    7.3) Coding:

    The design must be translated into a machine-readable form. The code generation step

    performs this task. This phase is the heart of the software development process.

    For this project the code that interacts with the hardware that is the back end has been

    designed using the programming language VB6.

  • 8/8/2019 dig ckt

    15/19

    15

    7.4) Testing:

    This phase is the most important phase as it removes errors and bugs from the software

    code. In this phase the tester tests the code listings for errors in order to make the

    software error-free. This makes the software more maintainable. Testing is also done to check

    whether the software fulfills the user requirements or not. This phase is also essential as

    all possible extreme boundary conditions are checked and verified. That is tests are conducted

    to uncover errors and ensure that defined input will produce actual results that agree with

    required results.

    The software to control the devices

    from PC has been written in Visual

    BASIC 6 (VB6). However, VB6 doesnot allow direct access t o the parallel

    port. So, an external software library

    which interacts with the parallel port

    is used. This is called DLL as it has

    already been compiled (i.e. the source

    code is not available) and will be

    loaded at runtime. It does not comes

    with the program written in VB6 but

    rather as a separate file. This file

    should be present for the program to

    run otherwise it will result in a runtime error.

  • 8/8/2019 dig ckt

    16/19

    16

    8. SYSTEM REQUIREMENTS

    System Requirements defines the ideal resources required for the efficient working of the application. The system

    requirement for this application can be broadly categorized under two headings namely, Hardware Requirements and

    Software requirements.

    Hardware Requirements:

    Processor: Pentium 1/ Pentium II / Pentium III / Pentium IV/and above

    Memory : 32 MB Ram (Minimum)

    Resolution: 800 x 600 pixels and above

    Software Requirements:

    Platform : windows 95, 98, NT, Vista, 7

    Version above windows 98 doesnt allow direct part access with the parallel port. So we have to

    use third party drives, which opens the specific port.One such software is Userport. For software made in VB require inout32.dll file.

    Language: VB, C or C++ or VC++.

  • 8/8/2019 dig ckt

    17/19

    17

    9. CONCLUSION

    This project allows us to control the devices from PC. We use parallel port for this (also called

    LPT1 which is the printer port).. In industries, there is a need for a secure way of controlling a

    machine; this project achieves that by providing a PC based device control. In this system,

    multiple devices can be controlled from a PC. The device can be anything and is isolated from

    the PC and relays by Optocoupler.

  • 8/8/2019 dig ckt

    18/19

    18

    10. FUTURE DEVELOPMENT

    The circuit can be extended to control 128 devices. By using micro-controller circuit can be used to control devices by using serial port. Feedback can be taken from the device and displayed. It can be used for industrial automation purpose.

  • 8/8/2019 dig ckt

    19/19

    19

    11. REFERENCES:

    Books

    Embedded SystemsRaj Kamal8051 Microcontroller and Embedded SystemMazidiMicrocontrollerKenneth Aayla

    Websiteswww.8051projects.info

    www.electro-tech-online.com