Maker Pro
Maker Pro

LM324 as a comparator

bpm

Jul 18, 2013
1
Joined
Jul 18, 2013
Messages
1
Hi all,

TLDR
Can an LM324 op-amp be used as a comparator (for <2.5kHz frequencies)?
What is the simplest way of making sure an LM339 comparator is working?




I'm trying to build a circuit which needs a comparator. Since the circuit already has an op-amp chip for filtering and gain, I figured I'd use one of the spare op-amps on that chip. So first question, can an LM324 op-amp be used as a comparator (for <2.5kHz frequencies)?

I ask simply because however I try it, it does not seem to work. So I bought a dedicated comparator chip, an LM339. And this makes even less sense. I attached the 5V supply and ground, and then (just as the most direct test I could think of) put 5V on the + input and ground on the - input. This produced nothing on the output. After much time fiddling, I accidentally knocked the general ground out and at this point I got a potential difference of about 3V from the output pin to ground. This also makes no sense to me, because I though the comparator should deliver 0V or 5V. Plugging the ground back in, this disappeared. I established by trial and error that it didn't matter which pin the chip was grounded by, it always killed the output signal.

Please help, I think I am missing something very obvious, because what I am trying is really not that complex!

Thanks.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
The LM339 has an open collector output. This means you need a pull-up resistor from Vcc to the output. Without this it will flop around like a piece of wet spaghetti. (And that's what you're seeing)

I don't see why the op-amp wouldn't work, however you need to keep the input signals within the valid range for the device (and you can find that in the datasheet). As I have just reminded myself, that range is quite large.

How did the LM324 not work? What does it do that you don't expect?
 

john monks

Mar 9, 2012
693
Joined
Mar 9, 2012
Messages
693
If the LM324 is used as an amplifier and another section is used as a comparator you might get some cross-talk.
 
Top