Comparing Voltages

Discussion in 'Electronic Basics' started by Gareth, Jul 21, 2004.

1. GarethGuest

Yes, there is a chip called a comparator. It has two inputs: inverting
input (usually marked "-") and non-inverting input (usually marked "+").
If the inverting input is higher the output will be low, and if the
non-inverting input is higher the output will be high.

Maxim, and others, make these have a look at:

http://para.maxim-ic.com/ss.asp?Fam=Comp&Tree=Comparators&HP=AmpComp.cfm&ln=

--

2. KevinRGuest

Use a pair of comparators,
connect the inputs of one the other way around from the other
i.e.
comparator A + input on voltage 1 and - input on voltage 2
comparator B + input on voltage 2 and - input on voltage 1
Stick the outputs in to a two input OR gate

Re-reading you post, I am thinking maybe you mean higher
amplitude rather than higher voltage level, in which case, this won't
be of any use at all. I guess you could rectify and smooth the signals
and then do the above, but the response time would suffer

3. andyGuest

I've just built a circuit to do this with 2 transistors - comments from
others on the group welcome, as i'm not sure if this is a good way to do
it.

12V ----------+------+-------------------
| | |
[] [] #/
500k [] [] 22k +-#
[] [] | #\
| | 1M | |
+------|--------[===]--+ |
| | |
+---|------|----[====]--------+
| | | 3M +------ Vout
Vin 1M | #/ [] |
--[===]--+--# [] []
#\ [] 100k [] 100k
----->[] []
[] []
[] []
| |
0V ------------------+------------------+

When Vin is more than the voltage on the 100k pot plus 0.6v, Vout goes
from 0 to 12V. The 3M resistor gives positive feedback to make some
hysteresis - i.e. when the signal switches high, you have to go back down
a short way before it will switch low again. Increasing the value makes
the gap between switch points smaller - if you omit it, it's just a
straight comparator.

4. John FieldsGuest

---

Sounds like you could do it with a couple of fast comparators, but...

1. If signal A = signal B anywhere in the range between 0V an 5V, you
want the output to be low, otherwise you want the output to be high,
right?

2. How narrow a slice do you want to see? That is, if signals A and B
are both perfect 12MHz sinusoids 180° out of phase, how wide, in
degrees, would you expect the output to be high around the zero
crossing?

3. How narrow would you like the slice to be at other than the zero
crossing?

5. w_tomGuest

The chip is almost as famous as the 555 timer chips. If I
remember the number, it is the 339 Comparitor. Virtually
every serious linear IC manufacturer sell a 339 Comparitor.

6. DaveGuest

Hello,

I want to compare 2 signals. If one signal is higher than the other then I
want to output a logic zero, otherwise output a logic one. The signals will
be at no more than 12MHz with a maximum voltage of 5V. Do any chips exist
that will do this for me? If not, how else could I do it?

Thanks for any help,

7. w_tomGuest

You have many questions about the 339. Most of those
questions, you don't even know you have yet. Your first step
is to get and read (many times) the 339 datasheet. For
example, go to www.ti.com to find the datasheet for LMV339.
Or go to www.nationalsemiconductor.com to find datasheet for
LM339.

Your current question says you have not yet done basic and
necessary research. And again, if you did not read that
datasheet multiple times, then you have not yet done your
research.

8. DaveGuest

Thanks for all of the replies.

The 339 comparator looks like it might be what I want. Could I power it
from a standard 5V power supply?

Thanks again,

9. Bob MastaGuest

The 339 is designed to be a single supply part, and 5V should be fine.
However, it's not a very fast comparator. Response time is listed
as 1.3 usec, or 300 nsec with large signal overdrive. I don't think
this is going to work at 12 MHz!

Bob Masta