LM324n Comparator

ericgibbs

Joined Jan 29, 2010
21,439
Hi Eric, could you tell me the function R2 R8 and R9 preform?
hi Data,
As you may know a OPA input needs a DC path to ground on its input pins in order to work, R2 provides that path.

For most Comp's some external positive feedback [hysteresis] from Vout to the NI pin is required to give a fast turn On/Off of the Comp and it reduces the possibility of Vout oscillation at the switching threshold, ie: R9.

As you are using a single supply, R8 helps improve the low level of Vout, by lightly loading the output pin, pulling it closer to 0V.

Also C4 on the input blocks the DC path of the R3, R4 voltage divider voltage from 40kHz transducer input.

E
 

Thread Starter

Data123

Joined Jan 30, 2020
35
I have attached a 10uF across my breadboard power supply and have noticed a cleaner waveform from the 555 timer, but when I attach the 100nF capacitor it actually makes the waveform worse? Any ideas? Im placing the 100nF at the power pin and connecting the other end to the ground pin. (100nF not connected in the photo)
 

Attachments

danadak

Joined Mar 10, 2018
4,057
You don't have exactly a single point ground system. Normally you would use bulk
and 100 nF right at chip, and scope ground lead as close to ground pin of part as possible.
To get rid of stray L which will degrade waveform capture on scope. Maybe a post of
screenshot would help.


Regards, Dana.
 

Thread Starter

Data123

Joined Jan 30, 2020
35
You don't have exactly a single point ground system. Normally you would use bulk
and 100 nF right at chip, and scope ground lead as close to ground pin of part as possible.
To get rid of stray L which will degrade waveform capture on scope. Maybe a post of
screenshot would help.


Regards, Dana.
Sorry Im not quite sure I understand. A screenshot of what? And Im not sure how to have a single point grounding system in on a breadboard?
hi,
That waveform looks OK, where are you connecting the 100nF.?
E
E
Hi Eric, Im connecting the 100nF from pin 8 to pin 1 (Vcc to GND)
 

danadak

Joined Mar 10, 2018
4,057
Single point ground in a breadboard best done with one buss
takes all the ground points, no "chained" busses. And layout
that keeps connections to that buss as short as possible.

Screen shot of your distorted waveform due to 100 nF. Before
and after connection.


Regards, Dana.
 
Last edited:

Thread Starter

Data123

Joined Jan 30, 2020
35
Single point ground in a breadboard best done with one buss
takes all the ground points, no "chained" busses. And layout
that keeps connections to that buss as short as possible.

Screen shot of your distorted waveform due to 100 nF. Before
and after connection.


Regards, Dana.
It seems like theres actually not much difference with the 100nF connected. I've tried to change my bread board layout for a single ground point. Could I also ask where to connect decoupling capacitors on the LM324n?
 

Attachments

Thread Starter

Data123

Joined Jan 30, 2020
35
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.
Hi Brave, Regards to the Lm311n, I'm not sure I understand the data sheet 100% correctly but will this comparator be suitable with a low threshold voltage (applied to V - ) of 800mV?
 

Papabravo

Joined Feb 24, 2006
22,082
Hi Brave, Regards to the Lm311n, I'm not sure I understand the data sheet 100% correctly but will this comparator be suitable with a low threshold voltage (applied to V - ) of 800mV?
I'm not sure what part of the datasheet you are referring to. The specs require a bipolar supply of ±15V DC. With that bipolar supply you have a typical input range the goes from -14.7 VDC to +13.8 VDC (-14.5 MIN & 13.0 Max). In short you cannot get too close to the rails. If you are using a unipolar +5VDC supply you will be skirting the boundary on the lower rail. It probably won't be as good as 0.5V. The only way to be sure is to characterize a single device. If you are going to build more than one, then you need to characterize a whole lot of parts. I think you are in way over your head without a paddle.
 

Thread Starter

Data123

Joined Jan 30, 2020
35
I'm not sure what part of the datasheet you are referring to. The specs require a bipolar supply of ±15V DC. With that bipolar supply you have a typical input range the goes from -14.7 VDC to +13.8 VDC (-14.5 MIN & 13.0 Max). In short you cannot get too close to the rails. If you are using a unipolar +5VDC supply you will be skirting the boundary on the lower rail. It probably won't be as good as 0.5V. The only way to be sure is to characterize a single device. If you are going to build more than one, then you need to characterize a whole lot of parts. I think you are in way over your head without a paddle.
Thanks for your reassuring advice..haha. The Lm311 data sheet says it can be operated off a single 5V supply which is what I'm doing. I just wanted to ask the question that if I'm powering the Lm311 with a 5V dc supply that applying 0.8V to the inverting pin as the threshold voltage is not too low? I.e will the comparator switch when the signal supplied the inverting terminal is over 0.8V
 

danadak

Joined Mar 10, 2018
4,057
The LM311 will operate down to 3.5 volts across power supply pins. But all specs are
at +/- 15 V for supply.

1584637065806.png


Regards, Dana.
 

Papabravo

Joined Feb 24, 2006
22,082
The LM311 will operate down to 3.5 volts across power supply pins. But all specs are
at +/- 15 V for supply.

View attachment 201845


Regards, Dana.
This means for a unipolar +5 VDC supply, the input range should be 0.5 VDC to 3.5 VDC, so your 800 mV reference will be close to but not below the minimum. You still need to account for the extremely high gain and extreme sensitivity to oscillation of this part.
 

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
Hi Eric, sorry to bump an old post but I'm now back at this project after some time off (the worlds current events!). For the positive hysteresis added for the feedback resistor for the comparator, how was this value chosen? I can't seem to find much information online for the calculations for this resistor.
 
Top