How to latch a comparator?

C

creek

Guest
I'm working on a failsafe alarm system monitoring 12 separate normally-
closed switches. When a switch is momentarily opens I want it's
circuit to latch OPEN until I press a Reset.

I figured out how to have a normally closed switch latch a relay Open
but it has 2 problems... 1) The relays are energized all the time so
the 12 of them draw almost an Amp (they share a 'common'). 2) The
circuit goes "tripped" (open) on power-up. I had to add a 555
circtuit to do a power-up reset.

I'd rather use solid state devices but am not sure the best way to do
it. Latches, Flip-Flops, Comparators...?

I'm thinking of sending a couple mA@5V to the switches which then go
to ground. When a switch opens the 'signal' line goes high and a
comparator flips. The comparator output will throw an analog switch
to OPEN. My question is how do I latch this?? Once I get that part I
think I can figure out the Reset button.
 
On Tue, 10 Mar 2009 07:26:17 -0700, creek wrote:

I'm working on a failsafe alarm system monitoring 12 separate normally-
closed switches. When a switch is momentarily opens I want it's
circuit to latch OPEN until I press a Reset.

I figured out how to have a normally closed switch latch a relay Open
but it has 2 problems... 1) The relays are energized all the time so
the 12 of them draw almost an Amp (they share a 'common'). 2) The
circuit goes "tripped" (open) on power-up. I had to add a 555
circtuit to do a power-up reset.

I'd rather use solid state devices but am not sure the best way to do
it. Latches, Flip-Flops, Comparators...?
Ideally, use a microcontroller, e.g. a PIC. That involves a one-off
expense, namely the cost of the programmer, plus the learning curve. But
after that, just about any simple low-speed digital logic circuit is one
chip, i.e. a microcontroller.

If you want to do it using discretes, use an S/R (or J/K) flip-flop for
the latch. An S/R latch built from 2 NAND gates (for active-low signals)
or 2 NOR gates (for active-high signals) is fine.

I'm thinking of sending a couple mA@5V to the switches which then go
to ground. When a switch opens the 'signal' line goes high and a
comparator flips. The comparator output will throw an analog switch
to OPEN. My question is how do I latch this?? Once I get that part I
think I can figure out the Reset button.
You don't need comparators if your signals are 0V/5V, although you might
want an R-C low-pass filter at the digital end of the wire to filter
out any noise on the cables (a stray sub-microsecond pulse won't cause a
relay to latch, but it will cause a semiconductor flip-flop to latch).
 
On Tue, 10 Mar 2009 07:26:17 -0700, creek wrote:

I'm working on a failsafe alarm system monitoring 12 separate normally-
closed switches. When a switch is momentarily opens I want it's circuit
to latch OPEN until I press a Reset.

I figured out how to have a normally closed switch latch a relay Open
but it has 2 problems... 1) The relays are energized all the time so
the 12 of them draw almost an Amp (they share a 'common'). 2) The
circuit goes "tripped" (open) on power-up. I had to add a 555 circtuit
to do a power-up reset.

I'd rather use solid state devices but am not sure the best way to do
it. Latches, Flip-Flops, Comparators...?

I'm thinking of sending a couple mA@5V to the switches which then go to
ground. When a switch opens the 'signal' line goes high and a
comparator flips. The comparator output will throw an analog switch to
OPEN. My question is how do I latch this?? Once I get that part I think
I can figure out the Reset button.
Barring either buying a real alarm system, or doing this with a
microprocessor, you want to use something called an "RS flip-flop".
Check the literature and the web, and keep in mind that many other sorts
of flip flops (i.e. the 74xx76) have an RS flip-flop buried inside of
them -- look for "asynchronous set and reset".

Condition your signal, and use it to set the flip flop. Then use the
flip flop for an analog switch or a relay.

--
http://www.wescottdesign.com
 
On Mar 10, 10:26 am, creek <jlu...@gmail.com> wrote:
I'm working on a failsafe alarm system monitoring 12 separate normally-
closed switches.  When a switch is momentarily opens I want it's
circuit to latch OPEN until I press a Reset.

I figured out how to have a normally closed switch latch a relay Open
but it has 2 problems...  1) The relays are energized all the time so
the 12 of them draw almost an Amp (they share a 'common').  2) The
circuit goes "tripped" (open) on power-up.  I had to add a 555
circtuit to do a power-up reset.

I'd rather use solid state devices but am not sure the best way to do
it.  Latches, Flip-Flops, Comparators...?

I'm thinking of sending a couple mA@5V to the switches which then go
to ground.  When a switch opens the 'signal' line goes high and a
comparator flips.  The comparator output will throw an analog switch
to OPEN. My question is how do I latch this??  Once I get that part I
think I can figure out the Reset button.

You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional? You really need to go into
detail. A diagram of the circuit you use now would help a lot.
 
creek wrote:
I'm working on a failsafe alarm system monitoring 12 separate normally-
closed switches. When a switch is momentarily opens I want it's
circuit to latch OPEN until I press a Reset.

I figured out how to have a normally closed switch latch a relay Open
but it has 2 problems... 1) The relays are energized all the time so
the 12 of them draw almost an Amp (they share a 'common'). 2) The
circuit goes "tripped" (open) on power-up. I had to add a 555
circtuit to do a power-up reset.

I'd rather use solid state devices but am not sure the best way to do
it. Latches, Flip-Flops, Comparators...?

I'm thinking of sending a couple mA@5V to the switches which then go
to ground. When a switch opens the 'signal' line goes high and a
comparator flips. The comparator output will throw an analog switch
to OPEN. My question is how do I latch this?? Once I get that part I
think I can figure out the Reset button.
You can use an SCR in series with each switch. You will
need to do a power on reset to turn things on.

+ --+-----------+-----}}------+
| | |
| [Circuit 1] [Circuit N]
| | |
| [Switch 1] [Switch N]
| |a |a
| _|_ _|_
| \ / Scr 1 \ / Scr N
[PB] --- ---
| g/|k g/|k
| | | | |
+---[R]-+-+ | +--}}---+ |
| | | |
+-- | --+ |
| |
Gnd ------------+-------------+

Pressing the (normally open) pushbutton will turn on all
the scrs and the associated circuits. Opening a switch will
turn off the associated scr and circuit, and it will stay
off even when the switch closes. All other scrs and circuits
will be unaffected - they will remain on, until the switch
associated with the scr and circuit transfers. The only
common action is the turn on - otherwise the thing acts
like N individual circuits. Be aware that, unlike the switch,
there is a voltage drop across the SCR.

Ed
 
"creek" <jluers@gmail.com> wrote in message
news:f1aa7806-0a65-4fbc-9df5-7933658312d3@j39g2000yqn.googlegroups.com...
I'm working on a failsafe alarm system monitoring 12 separate normally-
closed switches. When a switch is momentarily opens I want it's
circuit to latch OPEN until I press a Reset.

I figured out how to have a normally closed switch latch a relay Open
but it has 2 problems... 1) The relays are energized all the time so
the 12 of them draw almost an Amp (they share a 'common'). 2) The
circuit goes "tripped" (open) on power-up. I had to add a 555
circtuit to do a power-up reset.

I'd rather use solid state devices but am not sure the best way to do
it. Latches, Flip-Flops, Comparators...?
A 555 can be configured as a latch. It already contains two comparators and
a flip-flop with buffered output. Output can source or sink from any input.
Output can also be inverted easily.
Most relays have both NO and NC contacts in the same package.
 
You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional?  You really need to go into
detail.  A diagram of the circuit you use now would help a lot.- Hide quoted text -
My attempt at ASCII art for my comparator idea:

5V
|
4.7K < R(latch)
+-----^^^-------+
| | |
G---N/C--+--+--|+ |
|comparator--+--analog switch
2.5V---|-

More details:
The switches are remote and wired with up to 200 feet of 26AWG wire.
I think (??) the signal might be <<5V so that's my reason for trying a
comparator. My output has to act like dry contacts... a momentarily
opened switch causes the output to latch open until a reset. The 12
switches need to act independently from each other, although 1 Reset
button should reset all of them. If a power-on reset is needed it has
to be automatic.

I've done Atmel micros but really wanted to try discretes.
Yes, I will do the low-pass filter. Thanks.
Buying a real alarm system... no comment ; )
SR Flip-Flop or SR Latch: If saw these but a 1-1 input gives a race
condition. This will occur if the Reset button is pressed while a
switch is still open.
The SCR suggestion might be doable. It uses 5V as the "common", not
ground (though I'm not sure this even matters). It does need a power-
on reset but I'm getting the feeling that because my circuit is N/C
then any solution is going to need this!!

Thanks to all
 
On Tue, 10 Mar 2009 13:21:22 -0700 (PDT), creek <jluers@gmail.com>
wrote:

You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional?  You really need to go into
detail.  A diagram of the circuit you use now would help a lot.- Hide quoted text -


My attempt at ASCII art for my comparator idea:

5V
|

4.7K < R(latch)
+-----^^^-------+
| | |
G---N/C--+--+--|+ |
|comparator--+--analog switch
2.5V---|-

More details:
The switches are remote and wired with up to 200 feet of 26AWG wire.
I think (??) the signal might be <<5V so that's my reason for trying a
comparator. My output has to act like dry contacts... a momentarily
opened switch causes the output to latch open until a reset.
---
Unfortunately, that won't happen since if the switch closes after it
opens, the comparator's + input will go more negative than its - input
and its output will revert to low, without latching.

If your signal is << 5V and you really, really, need comparators, then
you need to so something like this, where VSENS is the <<5V signal:
(View in Courier)


..VCC--------------------+-----+----+------------+
.. | | | |
..VSENS>----+---+----+ | | | |
.. | | | | | [R] [R]
.. | [R] [R] | | | |
.. | | | | | | |
.. |O--[R]--|---+----|---|----|+\ | |
.. |<--S1 | | | | | >--+---A |
.. |O--+ | | +---|--+-|-/ NAND Y--+--|--->ALARM1
.. | | | | | | | +--B | |
.. | | [C] [R] | | | | | |
.. | | | | | | | | A--+ |
..GND>-+----|---+--+-+---|--|--+ +--Y NAND |
.. | | | | B-----+
.. | | | | |
.. | | | | |
.. . . . . .
.. . . . . .
.. . . . . .
.. | | | | |
.. | | | | |
.. | | +--|--+----+ |
.. | | | | | |
.. +--+ | | | | |
.. | | | | [R] |
.. [R] | | | | |
.. | | | | | |
.. |O--[R]-----+---|--------|-|+\ | |
.. |<--S12 | | | | >--+---A |
.. |O--+ | | +-|-/ NAND Y--+--|--->ALARM12
.. | [C] | | +--B | |
.. | | | | | | |
.. | | | | | A--+ |
.. +-------+---+-+---------+ +--Y NAND |
.. | B-----+---+
.. | | |
.. | | O |
.. | RESET-->| [C]
.. | | O |
.. | | |
.. +---------------------------+---+

But why not just tie VSENS to VCC?

Do you need values for the resistors and capacitors?



The 12
switches need to act independently from each other, although 1 Reset
button should reset all of them. If a power-on reset is needed it has
to be automatic.

I've done Atmel micros but really wanted to try discretes.
Yes, I will do the low-pass filter. Thanks.
Buying a real alarm system... no comment ; )
SR Flip-Flop or SR Latch: If saw these but a 1-1 input gives a race
condition. This will occur if the Reset button is pressed while a
switch is still open.
---
That's a good thing, since it'll alert you to the fact that that switch
needs to be cleared before the system is once again properly armed.
---

The SCR suggestion might be doable. It uses 5V as the "common", not
ground (though I'm not sure this even matters). It does need a power-
on reset but I'm getting the feeling that because my circuit is N/C
then any solution is going to need this!!
---
If it was N/O why would it not need a POR?
JF
 
creek wrote:
I'm working on a failsafe alarm system monitoring 12 separate normally-
closed switches. When a switch is momentarily opens I want it's
circuit to latch OPEN until I press a Reset.

I figured out how to have a normally closed switch latch a relay Open
but it has 2 problems... 1) The relays are energized all the time so
the 12 of them draw almost an Amp (they share a 'common'). 2) The
circuit goes "tripped" (open) on power-up. I had to add a 555
circtuit to do a power-up reset.

I'd rather use solid state devices but am not sure the best way to do
it. Latches, Flip-Flops, Comparators...?

I'm thinking of sending a couple mA@5V to the switches which then go
to ground. When a switch opens the 'signal' line goes high and a
comparator flips. The comparator output will throw an analog switch
to OPEN. My question is how do I latch this?? Once I get that part I
think I can figure out the Reset button.
The 555 can be used as a flip flop.

The trigger and Threshold would be like the
Set and Reset etc...



http://webpages.charter.net/jamie_5"
 
On Mar 10, 1:21 pm, creek <jlu...@gmail.com> wrote:
You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional?  You really need to go into
detail.  A diagram of the circuit you use now would help a lot.- Hide quoted text -

My attempt at ASCII art for my comparator idea:

        5V
         |
         
    4.7K <         R(latch)
         >  +-----^^^-------+
         |  |               |
G---N/C--+--+--|+           |
               |comparator--+--analog switch
        2.5V---|-

More details:
The switches are remote and wired with up to 200 feet of 26AWG wire.
I think (??) the signal might be <<5V so that's my reason for trying a
comparator.  My output has to act like dry contacts... a momentarily
opened switch causes the output to latch open until a reset. The 12
switches need to act independently from each other, although 1 Reset
button should reset all of them.  If a power-on reset is needed it has
to be automatic.

I've done Atmel micros but really wanted to try discretes.
Yes, I will do the low-pass filter.  Thanks.
Buying a real alarm system... no comment ; )
SR Flip-Flop or SR Latch:  If saw these but a 1-1 input gives a race
condition.  This will occur if the Reset button is pressed while a
switch is still open.
The SCR suggestion might be doable. It uses 5V as the "common", not
ground (though I'm not sure this even matters). It does need a power-
on reset but I'm getting the feeling that because my circuit is N/C
then any solution is going to need this!!

Thanks to all
Here's what I came up with just now. Kind of in a hurry, so if I made
any mistakes the mob will chase me with pitchforks (just kidding).
You will need a comparator for every switch in this scheme, and wire
all the comparator outputs together.


5v
|
,----+-+-------,
| | |
R1 | R2
100k | 10k
| reset |
| switch |
| | R3 |
| +---47k---+
| | |
| | |\ |
| +--|+\ |
| | | \ |
| | | >--+---out
| | | /
+----|--|-/
| | |/
R4 R5
100k 100k
| |
alarm |
switch |
N/C |
| |
'--+-'
|
gnd

Under normal conditions, -in is at 1/2 Vcc, +in is at 2/3 Vcc, and the
comparator output is high.
An alarm (switch opens) causes -in to go high, pulling the output low;
this also pulls +in low, latching the condition.
Before hitting the reset switch, you have to find the open alarm
switch and close it. Then hitting the reset switch will return the
circuit to the normal condition.
 
On Mar 10, 5:31 pm, gearhead <nos...@billburg.com> wrote:
On Mar 10, 1:21 pm, creek <jlu...@gmail.com> wrote:





You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional?  You really need to go into
detail.  A diagram of the circuit you use now would help a lot.- Hide quoted text -

My attempt at ASCII art for my comparator idea:

        5V
         |
         
    4.7K <         R(latch)
         >  +-----^^^-------+
         |  |               |
G---N/C--+--+--|+           |
               |comparator--+--analog switch
        2.5V---|-

More details:
The switches are remote and wired with up to 200 feet of 26AWG wire.
I think (??) the signal might be <<5V so that's my reason for trying a
comparator.  My output has to act like dry contacts... a momentarily
opened switch causes the output to latch open until a reset. The 12
switches need to act independently from each other, although 1 Reset
button should reset all of them.  If a power-on reset is needed it has
to be automatic.

I've done Atmel micros but really wanted to try discretes.
Yes, I will do the low-pass filter.  Thanks.
Buying a real alarm system... no comment ; )
SR Flip-Flop or SR Latch:  If saw these but a 1-1 input gives a race
condition.  This will occur if the Reset button is pressed while a
switch is still open.
The SCR suggestion might be doable. It uses 5V as the "common", not
ground (though I'm not sure this even matters). It does need a power-
on reset but I'm getting the feeling that because my circuit is N/C
then any solution is going to need this!!

Thanks to all

Here's what I came up with just now.  Kind of in a hurry, so if I made
any mistakes the mob will chase me with pitchforks (just kidding).
You will need a comparator for every switch in this scheme, and wire
all the comparator outputs together.

          5v
          |
   ,----+-+-------,
   |    |         |
   R1   |         R2
  100k  |        10k
   |  reset       |
   |  switch      |
   |    |   R3    |
   |    +---47k---+
   |    |         |
   |    |  |\     |
   |    +--|+\    |
   |    |  |  \   |
   |    |  |   >--+---out
   |    |  |  /
   +----|--|-/
   |    |  |/
   R4   R5
 100k  100k
   |    |
 alarm  |
switch  |
  N/C   |
   |    |
   '--+-'
      |
     gnd

Under normal conditions, -in is at 1/2 Vcc, +in is at 2/3 Vcc, and the
comparator output is high.
An alarm (switch opens) causes -in to go high, pulling the output low;
this also pulls +in low, latching the condition.
Before hitting the reset switch, you have to find the open alarm
switch and close it.  Then hitting the reset switch will return the
circuit to the normal condition.- Hide quoted text -

- Show quoted text -
Okay, it's late. The circuit I drew requires a reset switch for each
N/C alarm switch.
Instead of putting it where I drew it in the circuit above, just put a
switch from the comparator outputs, which are all tied together, to
Vcc. That's your reset switch, just one instead of a dozen.
Still need a dozen comparators, though (three quads). You might want
to go with something simpler. There might be some scheme that puts
each N/C switch in series with a resistor and then ties the resistors
together, and when one of the switches opens you have a circuit that
detects the attendant (slight) change in voltage. Probably could do
it with a comparator, but it'll have to wait for tomorrow.
 
On Mar 10, 5:56 pm, gearhead <nos...@billburg.com> wrote:
On Mar 10, 5:31 pm, gearhead <nos...@billburg.com> wrote:





On Mar 10, 1:21 pm, creek <jlu...@gmail.com> wrote:

You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional?  You really need to go into
detail.  A diagram of the circuit you use now would help a lot.- Hide quoted text -

My attempt at ASCII art for my comparator idea:

        5V
         |
         
    4.7K <         R(latch)
         >  +-----^^^-------+
         |  |               |
G---N/C--+--+--|+           |
               |comparator--+--analog switch
        2.5V---|-

More details:
The switches are remote and wired with up to 200 feet of 26AWG wire.
I think (??) the signal might be <<5V so that's my reason for trying a
comparator.  My output has to act like dry contacts... a momentarily
opened switch causes the output to latch open until a reset. The 12
switches need to act independently from each other, although 1 Reset
button should reset all of them.  If a power-on reset is needed it has
to be automatic.

I've done Atmel micros but really wanted to try discretes.
Yes, I will do the low-pass filter.  Thanks.
Buying a real alarm system... no comment ; )
SR Flip-Flop or SR Latch:  If saw these but a 1-1 input gives a race
condition.  This will occur if the Reset button is pressed while a
switch is still open.
The SCR suggestion might be doable. It uses 5V as the "common", not
ground (though I'm not sure this even matters). It does need a power-
on reset but I'm getting the feeling that because my circuit is N/C
then any solution is going to need this!!

Thanks to all

Here's what I came up with just now.  Kind of in a hurry, so if I made
any mistakes the mob will chase me with pitchforks (just kidding).
You will need a comparator for every switch in this scheme, and wire
all the comparator outputs together.

          5v
          |
   ,----+-+-------,
   |    |         |
   R1   |         R2
  100k  |        10k
   |  reset       |
   |  switch      |
   |    |   R3    |
   |    +---47k---+
   |    |         |
   |    |  |\     |
   |    +--|+\    |
   |    |  |  \   |
   |    |  |   >--+---out
   |    |  |  /
   +----|--|-/
   |    |  |/
   R4   R5
 100k  100k
   |    |
 alarm  |
switch  |
  N/C   |
   |    |
   '--+-'
      |
     gnd

Under normal conditions, -in is at 1/2 Vcc, +in is at 2/3 Vcc, and the
comparator output is high.
An alarm (switch opens) causes -in to go high, pulling the output low;
this also pulls +in low, latching the condition.
Before hitting the reset switch, you have to find the open alarm
switch and close it.  Then hitting the reset switch will return the
circuit to the normal condition.- Hide quoted text -

- Show quoted text -

Okay, it's late.  The circuit I drew requires a reset switch for each
N/C alarm switch.
Instead of putting it where I drew it in the circuit above, just put a
switch from the comparator outputs, which are all tied together, to
Vcc.  That's your reset switch, just one instead of a dozen.
Still need a dozen comparators, though (three quads).  You might want
to go with something simpler.  There might be some scheme that puts
each N/C switch in series with a resistor and then ties the resistors
together, and when one of the switches opens you have a circuit that
detects the attendant (slight) change in voltage.  Probably could do
it with a comparator, but it'll have to wait for tomorrow.- Hide quoted text -

- Show quoted text -
Ahem, not such a good idea to short the comparator output to Vcc. The
reset switch needs a resistor in series with it.
Like I said, new try tomorrow.
 
On Mar 10, 5:31 pm, gearhead <nos...@billburg.com> wrote:
On Mar 10, 1:21 pm, creek <jlu...@gmail.com> wrote:





You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional?  You really need to go into
detail.  A diagram of the circuit you use now would help a lot.- Hide quoted text -

My attempt at ASCII art for my comparator idea:

        5V
         |
         
    4.7K <         R(latch)
         >  +-----^^^-------+
         |  |               |
G---N/C--+--+--|+           |
               |comparator--+--analog switch
        2.5V---|-

More details:
The switches are remote and wired with up to 200 feet of 26AWG wire.
I think (??) the signal might be <<5V so that's my reason for trying a
comparator.  My output has to act like dry contacts... a momentarily
opened switch causes the output to latch open until a reset. The 12
switches need to act independently from each other, although 1 Reset
button should reset all of them.  If a power-on reset is needed it has
to be automatic.

I've done Atmel micros but really wanted to try discretes.
Yes, I will do the low-pass filter.  Thanks.
Buying a real alarm system... no comment ; )
SR Flip-Flop or SR Latch:  If saw these but a 1-1 input gives a race
condition.  This will occur if the Reset button is pressed while a
switch is still open.
The SCR suggestion might be doable. It uses 5V as the "common", not
ground (though I'm not sure this even matters). It does need a power-
on reset but I'm getting the feeling that because my circuit is N/C
then any solution is going to need this!!

Thanks to all

Here's what I came up with just now.  Kind of in a hurry, so if I made
any mistakes the mob will chase me with pitchforks (just kidding).
You will need a comparator for every switch in this scheme, and wire
all the comparator outputs together.

          5v
          |
   ,----+-+-------,
   |    |         |
   R1   |         R2
  100k  |        10k
   |  reset       |
   |  switch      |
   |    |   R3    |
   |    +---47k---+
   |    |         |
   |    |  |\     |
   |    +--|+\    |
   |    |  |  \   |
   |    |  |   >--+---out
   |    |  |  /
   +----|--|-/
   |    |  |/
   R4   R5
 100k  100k
   |    |
 alarm  |
switch  |
  N/C   |
   |    |
   '--+-'
      |
     gnd

Under normal conditions, -in is at 1/2 Vcc, +in is at 2/3 Vcc, and the
comparator output is high.
An alarm (switch opens) causes -in to go high, pulling the output low;
this also pulls +in low, latching the condition.
Before hitting the reset switch, you have to find the open alarm
switch and close it.  Then hitting the reset switch will return the
circuit to the normal condition.- Hide quoted text -

- Show quoted text -
This circuit will work with just a single comparator:


5v
|
,----+-+-------,
| | |
R1 | R2
10k | 1k
| reset |
| switch |
| | R3 |
| +---8k6---+
| | |
| | |\ |
| +--|+\ |
| | | \ |
| | | >--+---out
| | | /
+----|--|-/
| | |/
| R5
| 10k
| |
---120k--+ gnd
|
.
X12 .
.
|
---120k--'

The gang of 12 120k resistors goes to the nc switches, obviously.
Use 1 or 2 percent resistors, or be prepared to bung a couple of extra
hundred ohms in one of the voltage dividers to bring you into the
operating window. You get a voltage change of about 9 percent on the
inverting input when one of the nc switches opens.
On the output, you can use a bjt or a small mosfet like a 2N7000 to
drive a relay. You don't want to load down the output, however,
because you need it set accurately and it has a high impedance, so I
suggest using a mosfet. If you use a common-emitter bjt, you will
drag the comparator's output toward one of the rails. Emitter
follower might work -- but a mosfet is foolproof.
Other guys have suggested using flip-flops and other solutions, which
may be more in line with conventional practice. But in your original
post you asked about comparators.
Or... you could just put all the nc switches in series, with a relay,
and not use any silicon!
 
Oops...
Comparator input polarities were reversed and there's no need for series
resistors from the NC switches to the inverting inputs of the
comparators.

Should be:


..VCC--------------------+-----+----+------------+
.. | | | |
..VSENS>----+---+----+ | | | |
.. | | | | | [R] [R]
.. | [R] [R] | | | |
.. | | | | | | |
.. |O-------|---+----|---|----|-\ | |
.. |<--S1 | | | | | >--+---A |
.. |O--+ | | +---|--+-|+/ NAND Y--+--|--->ALARM1
.. | | | | | | | +--B | |
.. | | [C] [R] | | | | | |
.. | | | | | | | | A--+ |
..GND>-+----|---+--+-+---|--|--+ +--Y NAND |
.. | | | | B-----+
.. | | | | |
.. | | | | |
.. . . . . .
.. . . . . .
.. . . . . .
.. | | | | |
.. | | | | |
.. | | +--|--+----+ |
.. | | | | | |
.. +--+ | | | | |
.. | | | | [R] |
.. [R] | | | | |
.. | | | | | |
.. |O----------+---|--------|-|-\ | |
.. |<--S12 | | | | >--+---A |
.. |O--+ | | +-|+/ NAND Y--+--|--->ALARM12
.. | [C] | | +--B | |
.. | | | | | | |
.. | | | | | A--+ |
.. +-------+---+-+---------+ +--Y NAND |
.. | B-----+---+
.. | | |
.. | | O |
.. | RESET-->| [C]
.. | | O |
.. | | |
.. +---------------------------+---+

JF
 
On Mar 11, 5:53 am, gearhead <nos...@billburg.com> wrote:
On Mar 10, 5:31 pm, gearhead <nos...@billburg.com> wrote:





On Mar 10, 1:21 pm, creek <jlu...@gmail.com> wrote:

You can use positive feedback (a resistor from the output to the
noninverting input) to make a comparator latch.
The exact configuration and the resistor values depend on whether you
have your 12 alarm switches connected at the positive rail or at
ground (..and are they in series? you didn't say), and whether you
want your output switch to control your load from the high side or the
low side... or maybe it's optional?  You really need to go into
detail.  A diagram of the circuit you use now would help a lot.- Hide quoted text -

My attempt at ASCII art for my comparator idea:

        5V
         |
         
    4.7K <         R(latch)
         >  +-----^^^-------+
         |  |               |
G---N/C--+--+--|+           |
               |comparator--+--analog switch
        2.5V---|-

More details:
The switches are remote and wired with up to 200 feet of 26AWG wire.
I think (??) the signal might be <<5V so that's my reason for trying a
comparator.  My output has to act like dry contacts... a momentarily
opened switch causes the output to latch open until a reset. The 12
switches need to act independently from each other, although 1 Reset
button should reset all of them.  If a power-on reset is needed it has
to be automatic.

I've done Atmel micros but really wanted to try discretes.
Yes, I will do the low-pass filter.  Thanks.
Buying a real alarm system... no comment ; )
SR Flip-Flop or SR Latch:  If saw these but a 1-1 input gives a race
condition.  This will occur if the Reset button is pressed while a
switch is still open.
The SCR suggestion might be doable. It uses 5V as the "common", not
ground (though I'm not sure this even matters). It does need a power-
on reset but I'm getting the feeling that because my circuit is N/C
then any solution is going to need this!!

Thanks to all

Here's what I came up with just now.  Kind of in a hurry, so if I made
any mistakes the mob will chase me with pitchforks (just kidding).
You will need a comparator for every switch in this scheme, and wire
all the comparator outputs together.

          5v
          |
   ,----+-+-------,
   |    |         |
   R1   |         R2
  100k  |        10k
   |  reset       |
   |  switch      |
   |    |   R3    |
   |    +---47k---+
   |    |         |
   |    |  |\     |
   |    +--|+\    |
   |    |  |  \   |
   |    |  |   >--+---out
   |    |  |  /
   +----|--|-/
   |    |  |/
   R4   R5
 100k  100k
   |    |
 alarm  |
switch  |
  N/C   |
   |    |
   '--+-'
      |
     gnd

Under normal conditions, -in is at 1/2 Vcc, +in is at 2/3 Vcc, and the
comparator output is high.
An alarm (switch opens) causes -in to go high, pulling the output low;
this also pulls +in low, latching the condition.
Before hitting the reset switch, you have to find the open alarm
switch and close it.  Then hitting the reset switch will return the
circuit to the normal condition.- Hide quoted text -

- Show quoted text -

This circuit will work with just a single comparator:

                  5v
                  |
           ,----+-+-------,
           |    |         |
           R1   |         R2
          10k   |        1k
           |  reset       |
           |  switch      |
           |    |   R3    |
           |    +---8k6---+
           |    |         |
           |    |  |\     |
           |    +--|+\    |
           |    |  |  \   |
           |    |  |   >--+---out
           |    |  |  /
           +----|--|-/
           |    |  |/
           |    R5
           |   10k
           |    |
  ---120k--+   gnd
           |
           .
    X12    .
           .
           |
  ---120k--'

The gang of 12 120k resistors goes to the nc switches, obviously.
Use 1 or 2 percent resistors, or be prepared to bung a couple of extra
hundred ohms in one of the voltage dividers to bring you into the
operating window.  You get a voltage change of about 9 percent on the
inverting input when one of the nc switches opens.
On the output, you can use a bjt or a small mosfet like a 2N7000 to
drive a relay.  You don't want to load down the output, however,
because you need it set accurately and it has a high impedance, so I
suggest using a mosfet.  If you use a common-emitter bjt, you will
drag the comparator's output toward one of the rails.  Emitter
follower might work -- but a mosfet is foolproof.
Other guys have suggested using flip-flops and other solutions, which
may be more in line with conventional practice.  But in your original
post you asked about comparators.
Or... you could just put all the nc switches in series, with a relay,
and not use any silicon!- Hide quoted text -

- Show quoted text -
5V
|
4.7K < R(latch)
+-----^^^-------+
| | |
G---N/C--+--+--|+ |
|comparator--+--analog switch
2.5V---|-


John Fields...
Thanks. I like the latching the NANDs rather than the comparator. My
Vsens is connected to Vcc with the 4.7K (to give me 1mA to the
switches). With the long thin leads I thought (?) the Vsens might be
<<5V.

Re. SR Flip Flops and race condition. Your reply: That's a good
thing, since it'll alert you to the fact that that switch needs to be
cleared before the system is once again properly armed.
So, if the operator presses the Rest button while a switch is still
open the corrosponding flip-flop will race but when he releases the
button everyting will go back to "normal", i.e. still tripped and not
left in some random state. Is this correct?

gearhead...
Thanks, I'll try expirement with it.
 
On Wed, 11 Mar 2009 10:19:12 -0700 (PDT), creek <jluers@gmail.com>
wrote:


John Fields...
Thanks. I like the latching the NANDs rather than the comparator. My
Vsens is connected to Vcc with the 4.7K (to give me 1mA to the
switches). With the long thin leads I thought (?) the Vsens might be
5V.
---
200' of 26AWG copper wire has a resistance of about 82 ohms at 25C, so
worst case, the circuit would look like this:


..VCC-----------+----+---------+----+------------+
.. | | | | |
.. | | | | |
.. [4k7][4k7] | [R] [R]
.. | | | | |
.. | | | | |
.. |O-----[82R]-+----|--------|-\ | |
.. |<--S1 | | | >--+---A |
.. |O--+ | +--------|+/ NAND Y--+--|--->ALARM1
.. | | | | +--B | |
.. | [C] [4k7] | | | |
.. | | | | | A--+ |
..GND>-+--------+--+-+---------+ +--Y NAND |
.. B-----+

With the switch closed, the circuit would look like this:


Vcc E1
|
[4k7] R1
|
+--->E2
|
[82R] R2
|
GND

and the voltage on the - input of the comparator would be:

E1 * R2 5V * 82R
E2 = --------- = ------------- = 0.085V
R1 + R2 4700R + 82R

When the switch opens, however, R2 will no longer be in the circuit, so
the voltage to the - input will rise to Vcc.

You could then use two equal-valued resistors to get the reference for
the + input, and your switching point would be at Vcc/2, which I think
is about optimum.

BTW, I made a couple of mistakes in my first post, so if you want to
play with the circuit, here's the corrected version:


..VCC-------+---+----|---+-----+----+------------+
.. | | | | | | |
.. | [R] [R] | | [R] [R]
.. | | | | | | |
.. |O-------|---+----|---|----|-\ | |
.. |<--S1 | | | | | >--+---A |
.. |O--+ | | +---|--+-|+/ NAND Y--+--|--->ALARM1
.. | | | | | | | +--B | |
.. | | [C] [R] | | | | | |
.. | | | | | | | | A--+ |
..GND>-+----|---+--+-+---|--|--+ +--Y NAND |
.. | | | | B-----+
.. | | | | |
.. | | | | |
.. . . . . .
.. . . . . .
.. . . . . .
.. | | | | |
.. | | | | |
.. | | +--|--+----+ |
.. | | | | | |
.. +--+ | | | | |
.. | | | | [R] |
.. [R] | | | | |
.. | | | | | |
.. |O----------+---|--------|-|-\ | |
.. |<--S12 | | | | >--+---A |
.. |O--+ | | +-|+/ NAND Y--+--|--->ALARM12
.. | [C] | | +--B | |
.. | | | | | | |
.. | | | | | A--+ |
.. +-------+---+-+---------+ +--Y NAND |
.. | B-----+---+
.. | | |
.. | | O |
.. | RESET-->| [C]
.. | | O |
.. | | |
.. +---------------------------+---+

---

Re. SR Flip Flops and race condition. Your reply: That's a good
thing, since it'll alert you to the fact that that switch needs to be
cleared before the system is once again properly armed.
So, if the operator presses the Rest button while a switch is still
open the corrosponding flip-flop will race but when he releases the
button everyting will go back to "normal", i.e. still tripped and not
left in some random state. Is this correct?
---
That's not really a "race" condition, and what'll happen will depend on
which output of the latch you use.

If you use the SET output, as shown above, then what'll happen is
whether or not the RESET switch is made, the output of the latch will
stay set as long as the input switch stays open. The only way to clear
the latch is to close the input switch and then to hit the RESET button.
___
If you use the other output (SET) and the input switch is open, then
when you hit RESET that output will go high as long as the RESET switch
stays made, and will go low again when the RESET switch is released.

However, if the input switch is closed and then RESET hit, that output
will go high and stay high until the input switch opens.

JF
 

Welcome to EDABoard.com

Sponsor

Back
Top