Posted on 2004-11-09
Last Modified: 2008-03-03
I'm programming a software that will activate/deactivate the data pin on the parallel port.  

this will activate a Relay which will activate other devices.

What do I need to know about the port limitation in order for not to burn it?

(I'm not an electronics man, but the guy who's building my the electronics part is, so I need all the information so he will know what to do)

Question by:RivKin
    LVL 6

    Accepted Solution

    It's a TTL level 5 volt  2.4 ma

    This link may help

    Assisted Solution

    quick and easy interface.

    you will need
    1)  2n4124 NPN transistor
    1) 4.7k 1/4watt 10% resistor
    1) 1n4001 diode (1n4004 works too)
    1) 5v to 12v dc relay

    it wires up this way.

    parallel port data pin to one side of the 4.7k resistor the other side of the 4.7k goes to the Base of the 2n4124.  The Emitter of the 2n4124 goes to parallel port ground (the relay's power supply must also ground here) the collector of the 2n4124 goes to both the Anode side of the 1n4001 (this is the NON banded end) and one side of the relay coil. The other side of the relay coil and the banded end of the diode go to the positive side of the power supply used for the relay.  The best bet is to use a 5v relay and get power from the computer.  DO NOT LEAVE OUT THE DIODE serious damage may result.  The diode allow the magnetic field built up in the relay coil to dissipate when the transistor turns off.  Without the diode a LARGE surge of energy tries to pass through the transistor when it turns off.

    I don't know if the following diagram will survive but here goes.

                                        | --- 3
                           Band    _|_    3  relay coil
                           diode    ^      3
                                        |  ---3                            
                 4.7k         C    /
    -------/\/\/\/\/\------B-|  2n4124
                                 E   \

    I've use this all the time to allow ttl to control a relay  work fine with 5vdc to 12vdc relays, don't use a relay with very low coil resistance or you'll run too much current through the 2n4124.

    Hope that helps

    Expert Comment

    Oh, a couple of things to consider.

    When you boot up a computer the bios checks the parallel port. it toggles data bits without generating a strobe pulse so the attached printer ignores the activity but the relay will activate.  You might want to use a latch (74hct374) to latch the output data based on the strobe pulse so you know the data is valid.  If you are using windows and/or have a backup program loading that supports parallel port tape drives this will also rattle the port trying to do Plug and Play identification.
    LVL 8

    Expert Comment


    Check your manual. It should identify an IEEE standard for the port. Then look up the standard and either download (from or get a hardcopy.

    The standard will contain the exact definition of the interface, which should tell an EE exactly what the interface defintiion is, for all machines using that interface. This is important, as reverse engineering an interface from one example is an error prone practice.

    The earlier coment about the strobe line is a case in point. Looking at data lines in the absence of the strobe is an error that I have encountered more than once in my career.

    I hope that the above is helpful.

    - Bob (aka RLGSC)

    Expert Comment

    Based on the original question, all of the answers are equally correct.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Upper back Pain: My back hurt for months. Upper back, mostly my neck, spine and across my shoulder blades. I was getting headaches too, that felt like they were caused by tension in my shoulders, but now I feel fine! I'm sharing this hoping someone…
    this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now