Help with transistor relay switch
Help with transistor relay switch
(OP)
I need a circuit for a simple transistor switch for an automotive hobby application, designed so that when the base of a switching transistor is grounded, a relay that is connected to +12v on one side, and the collector of the transistor (I guess), on the other side, will be closed. The emitter will be connected to ground.
One catch is that the base will be connected to a wire that sends varying resistances, from about 500 ohms, to 2k ohms, and I don't want that functionality interfered with, so I guess the input to the transistor switch (base) should have a high impedance, maybe 50k ohms or so.
Any help, including other ideas, will be greatly appreciated.
Thanks in advance,
Mitch
One catch is that the base will be connected to a wire that sends varying resistances, from about 500 ohms, to 2k ohms, and I don't want that functionality interfered with, so I guess the input to the transistor switch (base) should have a high impedance, maybe 50k ohms or so.
Any help, including other ideas, will be greatly appreciated.
Thanks in advance,
Mitch





RE: Help with transistor relay switch
1.) The input will be voltage sensitive. Input impedance
more than 100kOhm. If the input voltage higher than
1/2 of battery VTG, the relay is open if lower, then closed . If the relay is open, it will use less than 1 mA. Is this OK?
2.) Do you need a few pieces or for production?
3.) What is the relay supposed to switch ? (Ac,Dc, V,A ?)
<nbucska@pcperipherals DOT com> subj: eng-tips
read FAQ240-1032
RE: Help with transistor relay switch
1) The wire that will be grounded sits at about 10v, and when closed to ground through different resistor values, only sinks between 1 and 2 ma. I guess I'll just have to test it to see if an addition of 1 ma of current will affect the operation of the circuit. When closed, the relay uses about 120 ma.
2) I'm only making one.
3) The relay operates a horn.
Maybe I should explain - I'm adding switch controls to a steering wheel. There is only one wire available to carry the signals through what BMW calls a slip ring. When pressed, each switch connects a different resistor value to ground. I have to share the horn wire to do this. The horn wire will be completely shorted to ground, when it's honked. Obviously you can't use the switches and horn at the same time.
The switched resistances connect to a module by Peripheral Electronics, that interprets them based on the switch pressed, then generates an IR signal to control a radio. It's a really neat module, basically a programmable universal remote, for the car.
Obviously, my knowledge of electronics is very basic.
Thanks again,
Mitch
RE: Help with transistor relay switch
anode and cathode ( marked with a black band )and the resistors have two wires I mark 1 and 2 arbitrarily.
The resistors are around 2K,5K and 10K (+/- 20% is ok.
i.e. 8K-12K etc.)
Input --- 5K.1
5K.2 --- T1.b
+2V---T1.c---Relay.1---D.c
T1.e --- 2K.1
2K.2 --- 10K.1 ---T2.b
10K.2 --- GND
T2.e---GND
T2.c---D.a --- relay.2
<nbucska@pcperipherals DOT com> subj: eng-tips
read FAQ240-1032
RE: Help with transistor relay switch
Thanks again,
Mitch
RE: Help with transistor relay switch
I need it to close when the input is grounded. Did I wire it wrong?
Thanks again for the help.
Mitch
RE: Help with transistor relay switch
In the 3rd line of the netlist +2 V should be +12V
but looks like you corrected it.
It is ok. that one side of the relay is at +12,(relay.1)
the other is switched to GND (relay.2). The circuit
is connected in addition -- parallel -- to the switch
so either can turn on the horn.
You will need one more transistor : T3.
Replace the 2K with 20K
Disconnect T2.c from the D.a ---relay.2 ;; Free T2's coll.
New connections:
+12 -- 2K.1
2K.2 --T2.c -- T3.b
T3.e --GND
T3.c -- D.a -- relay.2
Sorry for the inconvenience.
<nbucska@pcperipherals DOT com> subj: eng-tips
read FAQ240-1032
RE: Help with transistor relay switch
Connect emitter of transistor to relay coil (the one that isn't connected to +12 V).
Connect collector of transistor to GND.
Connect your input signal to base of transistor. No series resistor needed (or wanted).
Add a free-wheeling diode across the relay coil (if you don't have one there already.
The transistor works as an impedance reducer (aka emitter follower) so that your 500 - 2000 ohms internal resistance is reduced by the current gain of transistor. It will be in the 100 - 200 range. This means that the relay coil will see a resistor in the ten ohms range connected between free coil and GND when your switch is closed.
The input resistance of this "circuit" is relay coil resistance times transistor current gain. It will probably be about ten kohms, which I hope is sufficiently high and doesn't influence the way the rest of the circuit works.
If the relay needs full voltage to pull in or if it consumes a lot of current (more than a few hundred mA), you may need an intermediate stage. But I do not think that it will be necessary.
Another way of doing it would be to use a simple CMOS gate from the 4000 family. It has a very high input impedance and it will probably need some transient protection on inputs as well as supply lines. Put a transistor after the gate and get the logic right. It can work directly off the 12 V rail - but beware of quite large voltage fluktuations. You will probably need a dropping resistor and a zener to be more safe than sorry.
RE: Help with transistor relay switch
Guilty in not getting the logic right.
CMOS gate with the caveats is OK.
One PNP won't do it: the relay's coil is i00 ohm and
the input can't tolerate beta*100 ohm load.
10K is not enough.
PNP with beta>>500 is not so common, Darlington's
Vsat may be too much. ( I don't know the relay)
The base resistor is to reduce the effect of power glitches like the transient protection You recommend.
" There are many ways to skin the cat..."
<nbucska@pcperipherals DOT com> subj: eng-tips
read FAQ240-1032
RE: Help with transistor relay switch
It worked on the table, but not in the car. I think what you mentioned about reducing the resistance by the gain of the transistor, is what made the Peripheral Electronics module, fail. The car battery died, so I can't test it for a while.
Also, the horn would honk briefly when I turned the ignition on, and when I turned it off. Maybe I need some kind of delay. This is getting a little more complicated than I thought it would.
I'll look into the CMOS gate. If there are any similar circuits around, please point me in the right direction.
Thanks,
Mitch
RE: Help with transistor relay switch
I haven't been able to find out what resistance to ground a CMOS gate's input needs, in order to trigger. Hopefully it's much less than 500 ohms, or this won't work. Can someone confirm this?
So far, this has been an interesting education.
Thanks,
Mitch
RE: Help with transistor relay switch
The input impedance is close to infinite (many megohms - gigaohms) so the impedance of the controlling signal doesn't matter at all.
RE: Help with transistor relay switch
RE: Help with transistor relay switch
I'll try this tomorrow. Since Radio doesn't sell 4000 series CMOS, I'll mail order them if this doesn't work.
Does the cap go across the relay? Also, the horn honking briefly when the ignition is turned on and off, is still a concern. Maybe the zener will help. Is the 33k resistor between +12v and the base, still necessary?
Thanks,
Mitch
RE: Help with transistor relay switch
I'll order some CMOS 4000 series integrated circuits from DigiKey, this week.
Mitch
RE: Help with transistor relay switch
<nbucska@pcperipherals DOT com> subj: eng-tips
read FAQ240-1032
RE: Help with transistor relay switch
If this circuit doesn't work, I know I can use a Basic Stamp to accomplish this. The input will go to one I/O pin and I can use the RCTIME function to read the resistance (indirectly, but it will work), and six I/O's for output - one for the horn, and several for the Peripheral Electronics module, each grounding a different resistor value. This certaily is overkill, but it does offer the advantage of being able to make one button accomplish multiple functions by pressing twice quickly, holding it in, etc. I'm at home with software!
Thanks,
Mitch
RE: Help with transistor relay switch
Second, back to fundimentals. When E of a PNP is connected to the relay, basically the same voltage at the base appears at the E. There is at least a 0.7V drop and you need to have enough current gain. In that case I wouldn't have a resistor any larger than 1K and NO zeners. Most 12V relays will operate on 9V and that may be all you can get with this circuit.
Third, I wouldn't be at all surprised that the transistor may have allready been damaged by a spike and you are not getting the results you suspect.
Another solution is to use an LM339, tie all the sections together in paralell, reference one of the inputs to that 5V zener and the other to the monitoring line through a 47K resistor, and use the output to pull the relay to ground.
RE: Help with transistor relay switch
LM339 inputs are + and -. I guess you connect the + to 12v through the zener, and - to the switches that ground resistors from 200 to 2800 ohms, through the 47k resistor.
The output will ground the relay, and I'll use a 1N4001 across the coil, for protection.
What I'm not sure I understand, is how the input works. I need it to ignore any resistor shorted to ground on the input line, and only ground the relay line on the output, if the input is shorted directly to ground. The input must have a high impedance so as not to affect the resistances on the input. Does this make sense, and if so, is that how the circuit will work?
Thanks,
Mitch
RE: Help with transistor relay switch
RE: Help with transistor relay switch
The sense input goes through a 47k resistor. I still don't see why the relay won't close if this sense input is grounded through a 200 ohm resistor, because that will provide a voltage differential. I only want it to close on a direct ground of the sense input. But I'll try. Sorry for the beginner questions, and thanks for the help.
Mitch
RE: Help with transistor relay switch
The 5 V may be too much. You need a reference voltage significantly less than what you get with any other switch.
This circuit doesn't eliminate the horn turning on at
power on/off.
<nbucska@pcperipherals DOT com> subj: eng-tips
read FAQ240-1032
RE: Help with transistor relay switch
RE: Help with transistor relay switch
220 ohms
600
1300
1600
2800
direct ground (horn)
I can change the 220 and 600 ohm resistors to some higher value. The Peripheral Electronics module trains itself to associate resistor values that it reads with infrared commands, so the values are not critical.
If you don't think this will work, I'll just do it with the Basic Stamp, but I'd rather not have to do all that work.
Thanks,
Mitch
RE: Help with transistor relay switch
RE: Help with transistor relay switch
There is a very small current on the input to the Peripheral Electronics module, a few milliamps, at around 10 volts, so I don't have to supply the voltage. The switch assembly simply switches each resistor to ground, and the horn switch grounds the wire completely.
Will the pot go between the zener and the input, or will I replace the 47k resistor from the input to 12v, with a pot? Remember, I'm not an EE like you guys, so please keep it simple.
Also, should I change the 220 and 600 ohm resistors to higher values?
Thanks,
Mitch
RE: Help with transistor relay switch
RE: Help with transistor relay switch
Thanks again,
Mitch
RE: Help with transistor relay switch
Now the last problem - the horn honks when the ignition is started, and also when it's turned off, because the switch does ground the + ignition line at a point when the key is rotated. After playing around for a little while, I also found that if the circuit's + is not connected at all, the horn is on constantly when the car is started. So I think I need a switch that will not allow the relay to close if there is no +12v.
I'm considering using an NPN transistor with the emitter connected to ground, and the collector to the relay (the side that will be grounded to close the relay). The base will go to the output of the gates through a resistor (not sure what value, but probably not critical). If it's done this way, I assume that only one of the gates is necessary because the transistor will handle the current, but since they're all already connected, I'll leave the circuit the way it is.
Is there a better way, like using one of the gates to do this on the input, instead of a transistor on the output? If so, please let me know how.
Thanks,
Mitch
RE: Help with transistor relay switch
Mitch
RE: Help with transistor relay switch
RE: Help with transistor relay switch
Thanks again,
Mitch