Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Lm339 comparator erratic output / oscillations

Status
Not open for further replies.

danjel

Member
I am using an LM339 (and also LM393) in a circuit where I am powering them with a single positive voltage rail (+12V and GND). This was done so the comparator only swings between positive and gnd (I have a pullup resistor on the output).

They have been set up as comparators with the (-) pin connected to a Voltage divider set to about 2V and the input signal being fed to the (+).

Most of the time the comparator is functioning as expected but some input sources (usually square clock signals 10Vpp) are causing adjacent comparators to fire as well and generally behave erratically.

The power rails of each LM339 have a 0.1u bypass cap to filter noise.

I am wondering if the issue is caused by feeding a negative voltage to the inputs? i.e. Should I be using a diode in series to the (+) inputs to block negative DC?
 
I am using an LM339 (and also LM393) in a circuit where I am powering them with a single positive voltage rail (+12V and GND). This was done so the comparator only swings between positive and gnd (I have a pullup resistor on the output).

They have been set up as comparators with the (-) pin connected to a Voltage divider set to about 2V and the input signal being fed to the (+).

Most of the time the comparator is functioning as expected but some input sources (usually square clock signals 10Vpp) are causing adjacent comparators to fire as well and generally behave erratically.

The power rails of each LM339 have a 0.1u bypass cap to filter noise.

I am wondering if the issue is caused by feeding a negative voltage to the inputs? i.e. Should I be using a diode in series to the (+) inputs to block negative DC?

hi,
You require some positive feedback from the output to the non inverting input, its called hysteresis, try a 1megohm initially, lower if required
 
So I don't need to block the input from negative voltages?

The spec sheet says the input must be greater than -0.3V Vdc
 
So I don't need to block the input from negative voltages?

The spec sheet says the input must be greater than -0.3V Vdc

If you have more than one LM339 non inverting input connected to the source signal, you should have at least a 10K resistor in series with each LM339 input.
OK.?
EDIT: the 10k's will also protect the LM339 from a negative swing.
 

Attachments

  • AAesp08.gif
    AAesp08.gif
    8.4 KB · Views: 1,448
Last edited:
My circuit is almost exactly like circuit B here: **broken link removed**
Where Rv is actually two fixed resistors actiing as a voltage divider (10k and 100k) and the reference voltage setting resistors are R1 = 100k and 10k

Since power is +12V and GND the Comparator can never swing negative. It can only swing between positive and negative.

I was hoping not to add hysterisis but I will try adding a feedback resistor to see if this helps the problem.

Also there is only one input to the (+) input but it would be connected to a jack. The 100k resistor to gnd at this point acts as a pull down for the input if nothing is connected to the jack (although I could use the Jacks switch to normal to gnd).
 
hi Dan,
The oscillation that you describe is a very common problem with comparators.
They usually occur at close to the Vref point.
Some users add small value capacitors across the inv/non invert pins, say 1n0 or 2n2
 
Last edited:
Do you mean a single capacitor between (-) and (+) pins?

Or from (+) to GND and from (-) to GND?

A single cap between pins + and - inputs.

What are the LM339 outputs driving.?
 
Most of the time the comparator is functioning as expected but some input sources (usually square clock signals 10Vpp) are causing adjacent comparators to fire as well and generally behave erratically.

I am wondering if the issue is caused by feeding a negative voltage to the inputs? i.e. Should I be using a diode in series to the (+) inputs to block negative DC?
The erratic behavior may be from the negative input current when the input goes below ground (see Note 3 in the data sheet). Thus you need a diode, or sufficient resistance in the input circuit, as Eric noted, to minimize this negative current.
 
I am using an LM339 (and also LM393) in a circuit where I am powering them with a single positive voltage rail (+12V and GND). This was done so the comparator only swings between positive and gnd (I have a pullup resistor on the output).

They have been set up as comparators with the (-) pin connected to a Voltage divider set to about 2V and the input signal being fed to the (+).

Most of the time the comparator is functioning as expected but some input sources (usually square clock signals 10Vpp) are causing adjacent comparators to fire as well and generally behave erratically.

The power rails of each LM339 have a 0.1u bypass cap to filter noise.

I am wondering if the issue is caused by feeding a negative voltage to the inputs? i.e. Should I be using a diode in series to the (+) inputs to block negative DC?

It would be helpful if you were to post a schematic of the circuit as constructed and the method of construction (PCB, perfboard, breadboard, etc.). A lack of sufficient hysteresis and an excess of noise will cause the problem you have described.
 
They have a 100k pullup to +12V (maybe this pullup is too big?) and then driving a CMOS flipflop 4027

Hi dan.
A typical value for the output resistor is in the order of 3k9 thru 10k.
Try to have at least 1mA to 2mA flowing thru the resistor when the output is low.
I would also add a 47uF thru 100uF across the +V supply and 0V, in parallel with the existing100nF
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top