Description: Below are three examples of controlling a relay from the PC's parallel printer port (LPT1 or LPT2). Figure A shows a solid state relay controlled by one of the parallel port data lines (D0-D7) using a 300 ohm resistor and 5 volt power source. The solid state relay will energize when a "0" is written to the data line. Figure B and C show mechanical relays controlled by two transistors. The relay in figure B is energized when a "1" is written to the data line and the relay in figure C is energized by writing a "0" to the line. In each of the three circuits, a common connection is made from the negative side of the power supply to one of the port ground pins (18-25).
There are three possible base addresses for the parallel port. You may need to try all three base addresses to determine the correct address for the port you are using but LPT1 is usually at Hex 0378. The QBasic "OUT" command can be used to send data to the port. OUT, &H0378,0 sets D0-D7 low and OUT, &H378,255 sets D0-D7 high. The parallel port also provides four control lines (C0,C1,C2,C3) that can be set high or low by writing data to the base address+2 so if the base address is Hex 0378 then the address of the control latch would be Hex 037A. Note that three of the control bits are inverted so writing a "0" to the control latch will set C0,C1,C3 high and C2 low.
To implement the described relay control circuit, the following components are required: a parallel port interface, a solid-state relay (SSR) or mechanical relays, transistors (for mechanical relays), resistors (300 ohm for SSR), and a power supply (5 volts).
In Figure A, the solid-state relay is connected to one of the data lines (D0-D7) of the parallel port. The 300-ohm resistor serves to limit the current flowing into the input of the SSR, protecting the parallel port from excessive current draw. When a logic "0" is sent to the data line, the SSR is activated, allowing current to flow through the load connected to its output.
Figures B and C illustrate the use of mechanical relays. In Figure B, a transistor is used to control the relay. When a logic "1" is sent to the data line, it turns on the transistor, which in turn energizes the relay coil, closing the relay contacts. Conversely, in Figure C, the transistor is activated by sending a logic "0" to the data line, thus energizing the relay in this configuration. This dual setup allows for flexible control of different load types depending on the logic state sent from the parallel port.
The common ground connection from the power supply to the parallel port's ground pins (18-25) is essential for ensuring that all components operate within the same reference voltage level, preventing potential floating ground issues that could lead to erratic behavior or damage to the components.
The parallel port's base address is critical for correct operation, with Hex 0378 being the most common for LPT1. The use of the QBasic "OUT" command allows for straightforward manipulation of the data lines and control lines. The control lines (C0-C3) can also be utilized to manage additional functions or to provide feedback from the relays, with the inverted logic of some control bits requiring careful programming to ensure correct operation.
This setup provides a versatile and effective means of controlling relays directly from a PC, suitable for various automation and control applications.Below are three examples of controlling a relay from the PC's parallel printer port (LPT1 or LPT2). Figure A shows a solid state relay controlled by one of the parallel port data lines (D0-D7) using a 300 ohm resistor and 5 volt power source. The solid state relay will energize when a "0" is written to the data line. Figure B and C show mechanical relays controlled by two transistors. The relay in figure B is energized when a "1" is written to the data line and the relay in figure C is energized by writing a "0" to the line.
In each of the three circuits, a common connection is made from the negative side of the power supply to one of the port ground pins (18-25).
There are three possible base addresses for the parallel port You may need to try all three base addresses to determine the correct address for the port you are using but LPT1 is usually at Hex 0378. The QBasic "OUT" command can be used to send data to the port. OUT, &H0378,0 sets D0-D7 low and OUT, &H378,255 sets D0-D7 high. The parallel port also provides four control lines (C0,C1,C2,C3) that can be set high or low by writing data to the base address+2 so if the base address is Hex 0378 then the address of the control latch would be Hex 037A.
Note that three of the control bits are inverted so writing a "0" to the control latch will set C0,C1,C3 high and C2 low.
Utilizing a relay allows for a reduction in the length of thick wires that need to be routed, particularly through the firewall and beneath the dashboard. This approach also minimizes the necessity for a larger switch. However, when integrating with...
The circuit is a bias circuit for automatic stabilizers that maintains a stable quiescent operating point with good thermal stability. It utilizes a three-pole tube with an NPN type transistor, characterized by a small Iceo. An adjustment potentiometer, RP, is...
This circuit is one of the simplest to implement but can be challenging to comprehend. It consists of a two-transistor oscillator known as an astable multivibrator, which generates a square wave output that is out of phase. Initially, it is...
This is a silicon transistor circuit showing typical voltage values. When the forward base/emitter voltage is 0.6 to 0.7 V, the transistor is silicon. Germanium transistors will have a forward base/emitter bias voltage of 0.2 to 0.3 V. This is...
This reflex radio project was inspired by Robert Bazian's design. His reflex radio is the "darndest" thing I have seen and his spectacular results inspired me to come up with my own version! These designs are similar to two-transistor circuits...
The simple zener shunt in configuration A may not handle sufficient current if the zener diode available is of low wattage. A power transistor will perform most of the work for the zener as illustrated in configuration B. Once the...
The circuit is designed to set a delay time based on the voltage Us and the resistor R. In this configuration, S1 acts as the discharge switch for capacitor C. When switch S1 is closed, the stored charge in capacitor...
Initially, there is a voltage Vc on capacitor C1 that is greater than Vbb - Vg, where Vg is the cutoff base-emitter voltage and g represents Gamma. Consequently, the transistor is in the off state, and capacitor C1 discharges exponentially...
Here is a circuit for using the printer port of a PC for control application using software and some interface hardware. The interface circuit along with the given software can be used with the printer port of any PC for...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more