I have two circuits A & B. Circuit "A" comes from a pressure sensor and
varies from 0 to 5VDC. Using a couple of resistors as a voltage divider
I can read the pressure on a cheap 200mV LCD meter. Circuit "B"
operates a 12VDC relay that draws 42mA. I am looking for a way to
switch off circuit "B" when the voltage on circuit "A" gets up to 4.5V.
The solution must be cheap (like a dollar or three) and not effect
the meter reading. Any suggestions?
---
It depends on how the relay's being switched, but basically:
+12v>----------------+-------+
| |
| |
0-5V>--+ +------+ |
| | | |
[R1] [R3] | [R4]
| | | |
| +-----|-\ | ___
| | | >-----+ +---->OUT
+---------+--|+/U1 | |
| | | | | C
| | +-----[R5]--+--[R6]---B 2N4401
| | | E
[R2] [CR1] | |
| | | |
GND>---+------+------+-------------------+
The 0-5V is the output from your pressure transducer circuitry and R1R2
is a voltage divider. CR1 is a shunt voltage reference like an
LM385-2.5V and R3 is its current limiting resistor, U1 is 1/2 of an
LM393 (the remaining 1/2 should have its inputs and output shorted to
GND), R4 is the base current source limiter for the 2N4401 and R5 is to
provide hysteresis around the comparator so its output won't chatter for
slowly varying changes in the )-5V input.
If you use an LM385-2.5V for CR1 it'll work fine with 1mA going through
it, so you'll want to drop (12V-2.5V) across R3 with 1mA going through
it, so that comes out to R3 = (12V-2.5V)/1mA = 9500 ohms, so just stick
10k in there and it'll be fine too. For 10k it'll dissipate 9.5V*0.95mA
~ 9mW, so a 5% 1/4 watter will work just fine as well.
Looking at the input divider, R1R2, what we want it to do is to generate
a voltage at the junction of R1 and R2 which, when the input voltage
gets to 4.5V is going to make the comparator switch. Since the - input
of the comparator is sitting at the reference's 2.5V, that means the
voltage at the R1R2 junction needs to be 2.5V when the output of the
transducer circuitry is 4.5V. Not knowing how much current the
circuitry can supply is a little bit of a problem, but if we assume
100µA we can figure out R1 and R2. If we can have 100µA flowing through
R1 and R2, then to make the hot end of R2 sit at 2.5V we can say R = E/I
= 2.5V/100µA = 25k ohms. Assuming that you want to get pretty close to
that 2.5V and that your reference is spot on, the closest standard 1%
resistor is 24.9k, which is only 100 ohms (+/- the tolerance of the
resistor, 250 ohms) off. Now, we can do the same for R1, and since we
want to drop 2V across it at 100µA, that works out to 20k ohms, a
standard 1% value!
Next, I'm assuming that your relay switching circuitry looks something
like this:
+12V
|
+-------+
|K |
[DIODE] [COIL]
| |
+-------+
|
C
ON>---[R]----B NPN
E
|
GND
And that by doing this:
+12V
|
+-------+
|K |
[DIODE] [COIL]
| |
+-------+
|
C
ON>---[R]--+---B NPN
| E
___ | |
OUT>-------+ GND
We can pull down the base of the transistor turning the relay on,
forcing the relay to open, no matter what.
Combining the two circuits, we'll have:
+12V
|
+-------+
|K |
[DIODE] [COIL]
| |
+-------+
|
C
ON>--------------------------------[R]--+---B NPN
| E
| |
| GND
|
|
+12v>----------------+-------+ |
| | |
| | |
0-5V>--+ +------+ | |
| | | | |
[20k] [10k] | [12k] |
| | | | |
| +-----|-\ | |
| | | >-----+ |
+---------+--|+/U1 | |
| | | | | C
| | +-----[R5]--+--[91k]--B 2N4401
| |K | E
[24.9k] [CR1] | |
| | | |
GND>---+------+------+------------------+
What we'll want to do is divert the base current of your relay driver to
GND, and to do that properly we'll need to saturate the CE juncton of
the 2N4401, which will cause about 0.3V to appear across it, which
would surely cut off the relay driver. Since the relay draws 42mA, if
we assume a forced beta of 10 for its driver, that leaves us with 4.2mA
to divert to GND. If we force the 2N4401's beta to 10 and it has to
sink 4.2ma, then that means all we have to do to turn it on is force
420µA into its base and we'll be done. But... there _is_ still R5 to
figure out. It's there for hysteresis, and it serves to keep the
comparator's output from chattering when its + input goes through the
switching point slowly. The 2N4401 will only be required to sink the
relay driver transistor's base current to turn it off, so if we set it
up to sink 1mA and force its beta to 10, it'll only need 100µA of base
current to turn on, so if we make the sum of R4 and R6 drop 1.3V with
100µA flowing through them that'll do it. We need R6 because with the
2N4401 fully turned on, its base to emitter voltage will only be about
1.3V, which would never allow the comparator's + input to get to the
2.5V switching point! So, R4+R6 needs to be (12V-1.3V)/100µA = 107k
ohms. 100k is close enough, and R4 needs to be large enough to make
sure the comparator's output transistor never comes out of saturation
when it's on. It can handle 4mA, but if we keep it down around 1mA
that'll make sure we have no problems, so R4 needs to drop 12V at 1mA,
which makes it 12k. Then, since R4+R6 needs to be 100k, R6 needs to be
88k. 91k is a standard 5% value, and it's close enough, so R6 will then
be 91k, and 1/4 watt resistors will be plenty big for both R4 and R6.
Now, the purpose of R5 is to source and sink a tiny bit of current into
and out of the junction of R1 and R2 so that when the comparator turns
off and on it forces the voltage on the + input to quickly rise and fall
past the 2.5V switching threshold, helping to avoid any noise problems
which would tend to make the comparator's output chatter. If we assume
that 10mV of hysteresis would be enough, then we have to make the
voltage across R2 rise by 10mV, and since R2 is 24.9k, that means we
have to force an extra I = E/R = (2.51V-2.5V)/24.9K = 402nA through it.
Since, when the comparator turns off, the base to emitter voltage of the
2N4401 will rise to 1.3V, R4 and R6 will form a voltage divider with one
end at 12V and the other at 1.3V, and the voltage at the junction of R4
and R6 will go to:
12V*R4
E = -------- + 1.3V = 7.95V ~ 8V
R4+R6
Which is going to cause a problem in that it will cause the hysteresis
to be asymmetrical about the switching point. Since the switching point
is at 2.5V and the comparator's output goes to 0V when it turns on,
pulling one end of R5 to 0V, we would like for that end of R5 to go to
+5V when the comparator turns off, making the input to R5 symmetrical
about 2.5V. That way, the hysteresis will also be symmetrical around
the switching point.
What we need to do to make that happen is to change the values of R4 and
R6 so that the voltage at their junction will be 5V when the comparator
is off. If, when the comparator is off, we allow 1mA of current to
flow through R4 and R6 then, to make the voltage at their junction be
5V, we need to drop 7V across R4. That means R4 needs to be 7k. The
two 5% choices available are 6.8k and 7.5k, so let's choose 6.8k and see
what happens. First off, if we want to drop 7V across 6.8k, the current
through it has to be 1.03mA, which means that current is also going to
be flowing through R6 and into the B-E junction of the 2N4401. The base
is going to be sitting at about 1.3V, so that means R6 will have to drop
5V-1.3V = 3.7V at 1.03mA, so it will need to be 3.7V/1.03mA = 2.98k. 3k
is a standard 5% so, since that 1.3V is only approximate, 6.8K for R4
and 3k for R6 should be OK.
Now, looking at R5 again, we'll need to drop about 2.5V across it at
400nA, so it'll need to be 2.5V/400nA = 6.25M. 6.2M is a standard 5%
value, so that's pretty close, and here's your final(?) circuit
+12V
|
+-------+
|K |
[DIODE] [COIL]
| |
+-------+
|
C
ON>---------------------------------[R]--+---B NPN
| E
| |
| GND
|
|
+12v>----------------+--------+ |
| | |
| | |
0-5V>--+ +------+ | |
| | | | |
[20k] [10k] | [6k8] |
| | | | |
| +-----|-\ | |
| | | >------+ |
+---------+--|+/U1 | |
| | | | | C
| | +-----[6M2]--+--[3k]---B 2N4401
| |K | E
[24.9k] [CR1] | |
| | | |
GND>---+------+------+-------------------+
Interesting how something simple can turn out not to be huh?
BTW, if your relay driver configuration is different from what I
assumed, post back and we'll make everything match up.