Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Activate a relay using laptop's parallel port

Status
Not open for further replies.

get free

New Member
Hi, guys. I'm new here. Forgive me if this is too newbie.

I have a relay that I want to switch on using one of the output pins on the parallel port.

This is what I've got:
**broken link removed**

The relay is powered by a 5V DC adapter and the transistor should act as a switch.
But i dont know where to connect the parallel port's ground pin.

If I just connect the 5V pin to the transistor's base (like the diagram shows), it doesn't work.
 

MikeMl

Well-Known Member
Most Helpful Member
Right, you need to complete the circuit by connecting the PC ground to the external power supply's negative pin. You also need a base resistor, try 100Ω to 470Ω between the port pin and the base of the transistor.

How much current does it take to pull in the relay? The port pin will only source a couple of mA, which may not be enough to reliably drive the transistor hard enough to pull-in the relay. If this is a problem, write back, and I'll suggest something.
 
Last edited:

get free

New Member
Right, you need to complete the circuit by connecting the PC ground to the external power supply's negative pin.
Wouldn't that burn my port if I for instance need to use a larger relay which needs to be powered by say a 12V supply?

You also need a base resistor, try 100Ω to 470Ω between the port pin and the base of the transistor.
Why a resitor there? I believe those pins supply very few current since they are handled by TTL circuitry
 

MikeMl

Well-Known Member
Most Helpful Member
As a general rule, it is best not to connect the PC ground to power circuits which have their own ground. Two ways to accomplish this: one, use opto-isolation, or two, use a small relay powered from a floating supply, and rely on the isolation provided by the relay. Note that the relay supply must be a "floating" supply, with both output terminals not connected to the case or third prong on its line cord.

The base-to-emitter junction of the switching transistor effectively "shorts" the TTL output to ground, which is considered bad practice. If you put a base resistor there, then when the port pin is high, the current is limited so as to prevent heating in the TTL driver.
 
Last edited:

Reloadron

Well-Known Member
Most Helpful Member
This document PDF has a good example of a parallel port nterface schematic using a 12 volt coil relay. Personally I like the use of opto couplers for things like this.

Additionally Eric Gibbs has several pretty good parallel port poograms posted in these forums.

Anyway, the link should help. Unfortunately here at work I can't view your drawing.

Ron
 
Last edited:
Status
Not open for further replies.
Top