basic transistor switch with input from parallell por( i know it's been discussed) but i need help

Hi im near the point of giving up of trying to learn electronics... My problem is that i cant switch a relay with my parallell port trough a transistor.

The design is basic and calculum too..and i wander whats wrong. Please tell me what am i doing wrong so i can get back on track :D

Transistor 2N2222a : Vbe = 0.7V Vce sat = 0.3V hfe = 10 Icmax = 500mA Vcemax=100V

Relay: Rr = 426ohm Vturn on= 12V

Parallell port: Vcc= 3.4V

I_bsat= 50e-3 / 10 = 5mA Rb = (Ve- VbeSat) / I_bsat = (3.40 - 0.3) / 5e-3 = 3.1 / 5e-3 = 620 ohm +12V | relay | c

+3.40V -----Rb----b 2n2222a | e | | ---- ----- -- -- Please if you think the answer is to obvious bother to reply
Reply to
aiwarrior
Loading thread data ...

The obvious first thing you need is a diode (a 1N400x would be good) across the relay coil - Anode to the collector, cathode to +12V. Without that, the first time the relay operates, you'll fry the transistor.

Second, you say the relay has V(turn on) = 12V. If it really does need

12V to turn on, then given manufacturing spread it might not ever turn on in this circuit. Get one rated at 5V (min). It won't hurt it to run at 12V (but check the data sheet), and it'll have lower current requirements into the bargain.

The base resistor should be sized as [V(o) - Vbe(sat)] / Ib(sat). Without knowing the parameters of the parallel port, (in particular it's Vout vs. Iout characteristics) it's hard to size properly, but I'll assume 3V @ 5mA (easily sufficient for this application) as Ic will be about 30mA

->

(3V - 0.8V) / 5E-3 -> 440. I would use a 470 ohm resistor here - standard value. Note the Vbe(sat) term - it'll be about 0.7 - 0.8V (temperature dependent at -2.1mV/degree C). It could be lower as the device heats up, although in this case I wouldn't worry about it (about 5-6mW being dissipated by the transistor in the ON condition).

I don't see much else.

Cheers

PeteS

Reply to
PeteS

So required coil current is 12/426= 28mA

At what current? For some parallel ports, this can be a very low value.

Given the coil current of 28 mA, I think this is generous.

You are applying the value of VceSat as VbeSat. VbeSat would be more like .7V.

Even with your small errors, I am surprised this circuit does not drive your relay. Have you a volt meter to check what voltage the parallel port is producing while loaded with this circuit? Are you confident you have the transistor leads correctly identified? Posting the voltages at all the nodes for both the intended on and off state would be helpful.

By the way, the relay coil will produce a large voltage pulse when the transistor switches off (same principle as an ignition coil), so you might suppress this by adding a small diode in parallel with the coil, cathode to the +12 supply end.

Reply to
John Popelish

Compare your setup to the schematic in the below PDF file. Also test your setup using a couple of batterys instead of the parallel port pins to see if it works that way.

formatting link

Reply to
Si Ballenger

PeteS wrote: (snip)

(snip)

I have to argue with both these points. A typical 5 volt relay coil will badly overheat when driven with 12 volts ( (12/5)^2 = 5.7 times its normal temperature rise). And relays of similar size typically have an approximately constant coil power requirement, over a wide range of coil voltages. So a 5 volt coil may need 15/5 times as much current.

Reply to
John Popelish

That's why I said 'check the datasheet'. Some relays will be ok, some won't. Some have built-in diodes, some don't.

FWIW, I have a list of relays that are fine with up to 24V, and operate at about 5V. There's also a difference between a '5V' relay (that may operate at about 3V) and one that has an operational switching point of

5V. Another point to keep in mind is that relays typically have significant hysteresis which has to be accounted for. Most '5V' relays will switch properly on a 5V supply, but it's always wise to check the datasheet.

So our disagreement (if such it is) is perhaps because I didn't spell out complete answers - but then, I like the OPs to do a little digging and read *all* the words :)

Cheers

PeteS

Reply to
PeteS

--
I disagree.

General-purpose relays are usually designed for "must pick up" at
 Click to see the full signature
Reply to
John Fields

Your circuit is fine, except that you need a diode across the relay coil, with the banded end connected to the + side. (That is not the reason it doesn't work, but you definitely want that diode in there.) John Fields pointed out that the base resistor could be a higher value. A good idea, but again not mandatory to get your circuit to work.

I think John Popelish mentioned this: you may have the leads of the transistor connected to the wrong place. That would prevent it from working. One other point - the ground of the computer and the ground of the 12 volt supply

*must* be connected together. If they are not connected, it won't work.

Ed

Reply to
ehsjr

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.