LM324n Comparator

Thread Starter

Data123

Joined Jan 30, 2020
35
Hi there,

I'm trying to use a LM324n as a comparator but can't see to get it to work to my understanding. Im using two non-inverting op-amps to amply a signal from a ultrasonic receiver. There's some slight crosstalk between the Tx and Rx so in order to clean up the Rx signal I'm using a comparator. On my I'm applying 0.8V at the inverting terminal of the comparator and the amplified Rx signal to the non-inverting terminal. On my understanding every time the Rx signal is over 0.8V the comparator should output a signal close to the supplied voltage of 5V and ground when under 0.8 V? I have attached two oscilloscope traces, one from when there is no object in front of the Tx and Rx and one when there is an object placed.
 

Attachments

bertus

Joined Apr 5, 2008
22,270
Hello,

The LM324 will not be good as comparator.
I assume the the ultrasonic signal is about 40 kHz.
With a gain product of about 1 MHz, the 40 kHz might be amplified by 25 times at max.

Bertus
 

Papabravo

Joined Feb 24, 2006
21,159
I have access to a LM311n comparator, would this do?
It will do if you can keep it stable. It has a very high gain. Read the datasheet very, very, carefully.
PS LM386 is NOT an opamp. It is an audio amplifier. It might be tempting to conflate the two devices, but they are not at all similar.
 

Thread Starter

Data123

Joined Jan 30, 2020
35
Yes, but use some hysteresis, and bypass supply pins carefully, a polymer tant in parallel with a .1 uF
ceramic disk should do. If that still not enough add a .01 uF also to the bypassing.

Look at datasheet recommendations, additional info there -

http://www.ti.com/lit/ds/symlink/lm311-n.pdf



Regards, Dana.
Perfect thank you very much. I have another question which is not really related but hope someone could help answer. Regards to bypass capacitors for the LM324n and a 555 timer, what values do I use and where exactly do I place the capacitors?
 

crutschow

Joined Mar 14, 2008
34,284
what values do I use and where exactly do I place the capacitors?
Commonly 100nF ceramic caps are connected directly from the each supply pin to the ground pin, with one larger electrolytic per board (value not critical, but 10μF or so is often used) from the power rail to ground.
 

Thread Starter

Data123

Joined Jan 30, 2020
35
h Data,
This is your basic circuit, couple of changes, as pointed out the LM324 is a poor choice for a 40kHz comp.

E
Im taken back at how helpful this form really is, thank you all. Eric I'm away to build the circuit on my breadboard I will upload my oscilloscope traces after.
 

Thread Starter

Data123

Joined Jan 30, 2020
35
Commonly 100nF ceramic caps are connected directly from the each supply pin to the ground pin, with one larger electrolytic per board (value not critical, but 10μF or so is often used) from the power rail to ground.
So using this 555 pin out as an example, I would connect one end of the 100nF from pin 1 and the other end from pin 8? And then the electrolytic capacitor from the power supply to the IC? Thank you for your help
 

Attachments

Papabravo

Joined Feb 24, 2006
21,159
You have two goals:
  1. Supply required current when outputs switch
  2. Bypass HF noise to GND
Goal #1 is usually met by say a 10uF for the board near the powers supply pints an a 1uF by the chip (LM324, 555 etc.)
Goal #2 is usually met by a .1 or .01uF ceramic near each chip

Goals #1, and #2 are met by a parallel combination of two or more devices. A single device cannot accomplish both goals simultaneously.
 

danadak

Joined Mar 10, 2018
4,057
Not all caps are equal, for a given C, in their ability to bypass, eg. low ESR.

Always look at datasheet of cap to see what it can deliver.

1584561959282.png


Regards, Dana.
 
Top