Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with transistor relay switch 3

Status
Not open for further replies.

MitchSF

Computer
Apr 29, 2005
17
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
 
Replies continue below

Recommended for you

I need the following data:
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
 
Hi, thanks again for the assistance.

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
 
You need two transistors e.g. MPS2222A and one diode 1N4001 from Radio shack and 3 resistors . The transistors T1 and T2 have emitter,collector and base, The diode
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
 
I forgot to mention that the horn relay is already connected to +12v, and the side that I have in the steering wheel is the other side of the coil, which gets grounded to sound the horn. I don't know if this matters. I'll try to breadboard the circuit this weekend.
Thanks again,
Mitch
 
I built the circuit today, and it works, but not the way I expected. When I ground the input, nothing happens. But when I connect it to 12v or even a lower voltage like 6v (I'm using two 6v batteries to test), the relay closes.

I need it to close when the input is grounded. Did I wire it wrong?

Thanks again for the help.

Mitch
 
oops, I did.
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
 
You can do it a lot simpler with just one transistor if you use a PNP type. Like a 2N2907.

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.
 
SK:
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
 
Thanks, guys. Skogsgurra, I tried exactly that a couple hours ago, except I used 5k in series with the base, and 33k from base to 12v. I have no idea if this is necessary.

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


 
I think I can do this now. I'll use a NOR gate, so that when the input is grounded, the output will turn on an NPN transistor.

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
 
Much less than or much more than 500 ohms.

The input impedance is close to infinite (many megohms - gigaohms) so the impedance of the controlling signal doesn't matter at all.
 
I had about the same requirment in a jet engine test stand. One engine sourced and the other sunk. I prefer the PNP method but a couple changes. Would add about 5 diodes in series with the base (or a 4.7V zener),in addition to a 20K resistor, to add a little offset voltage and some resistance from the base to emitter. I would seriously consider adding a cap also of about 1 uf because of spikes you will be getting from the horn or relay. Frankly no one is driving a horn just from a switch contact. Emitter goes to +12V, collector to relay, other side of relay to ground. It would likely destroy itself if you just put a transistor in there from a spike.
 
Since the relay is already connected to +12v somewhere in the car, I connected the other side of the relay to the emitter of the PNP transistor, and the collector to ground. I'll try a zener diode in series with a 20k resistor between the base and the wire that senses resistance from the Peripheral Electronics module, and we'll see what happens. I have a 5.1v zener here.

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
 
I tried the zener diode in series with the base, and it still doesn't work. I did make one mistake - the lowest resistance is 200 ohms, not 500, so the circuit should not respond unless it sees a ground, or something very close. Also, the circuit is triggered on power up, so the horn honks each time the ignition is turned on.

I'll order some CMOS 4000 series integrated circuits from DigiKey, this week.

Mitch
 
You should check the other input ( with the switched resistors ) if it doesn't ground then when you turn on or off the power. If it does, you need a delay.

<nbucska@pcperipherals DOT com> subj: eng-tips
read FAQ240-1032
 
I'll do that when the ic's arrive. How would I incorporate a delay?

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
 
First, the horn honking. Many vehicle key switches turn off unnecessary circuits when the engine is started. This means that the 12V you are monitoring goes to zero. Although the horn switch isn't closed, there is a ground path through the relay to the now powered off 12V circuits. You can solve this by powering your new relay by the same switched 12V.

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.
 
I can try the LM339 tomorrow, since they're available at Radio Shack. I'm a software guy, not an EE, so I'm a little slow with this stuff. Please let me know if this is correct:

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
 
The LM339 is used as a comparator. The zener is used as a 5V reference source. Ground one side, band side through a 5-47K resistor to 12V. This gives you a regerence voltage you connect to one of the inputs. When one of the inputs is only a couple milivolts higher or lower than the other, the output changes state. Want the opposite state, switch the + and - inputs. The output is open collector. If you parallel all the sections, this will give you more than enough current sinking for the relay. Just make sure you have all the + inputs connected. Get one reversed and the relay always turns on. A 47K in series with the sense input will provide enough protection from spikes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor