LM339N Question

I am having trouble with the circuit attached.

The circuit works fine with my scope is hooked up to TPA and TPB (two channel scope). However, when I take the scope off TPA, I no longer get my square wave at TPB.

What am I doing wrong?

Thanks!
Chris

Try adding a pull-up resistor at TPA.

If I'm understanding your diode correctly, the LM339's input is pulled low by the negative half of the AC waveform, but when the AC goes positive the input "floats" to an unknown/undefined state.

Try:

Thanks for the quick response. I added a 10k pullup, that didn't help, it just fixed the output.

The diode is to clip the negative voltage. The OpAmp will go low anytime the voltage goes below approximately 1V (the reference voltage at the + terminal).

Thanks!
Chris

Looks like I need to brush up on diodes, I reconfigured the diode and the circuit works.

Thanks!
Chris

The impedance of your AC source must be high enough so the source is not damaged when the diode conducts.

.

What would you say if I told you that the symbol you have for the diode is not a recognized schematic symbol for anything (that I am aware of). I don't know how you came up with it but it is nothing recognized by anyone familiar with electronics. the triangle is facing the wrong way.
The point of the triangle (or arrow) should be touching the vertical line.
SEE SCHEMATIC SYMBOLS/DIODE

DIODE SCHEMATIC SYMBOL

A signal diode with the cathode connected to a signal and the anode connected to ground , is a common reverse polarity limiting component which limits the negative transition to one diode drop. A diode in series with the AC , however, is a half wave rectifier.
Half-wave rectifier

It would be nice if you mentioned the pk to pk voltage of the AC signal.

Sorry, as I said, I need to brush up on my diodes. Did the drawing in Paint.Net, would love something simpler.

The max peak to peak voltage is about 5V when the AC generator is rotating about 100 Hz (and varies depending on generator speed) nd the 1.0V reference voltage holds off anything under 40 Hz.

Note:
Your cct. has no feedback (hysteresis), so there is a slim chance you may experience transition glitches.

ExpressPCB.com is a free schematic capture program you can download

FYI, by " feedback " Mark is referring to a resistor ( ussually 100 k to 1 Megohm) from the -V input to the output pin.

raschemmel:
FYI, by " feedback " Mark is referring to a resistor ( usually 100 k to 1 Megohm) from the -V input to the output pin.

With a comparator, you actually use positive feedback to increase the switching speed, so the resistor goes from the output to the + input.

See the circuit diagram in answer #2 from LarryD, for details.

Hi,
The reason you had output with the oscilloscope probe and not when it was removed was because the LM339 has an OPEN COLLECTOR output, it needs a collector resistor to give you an output.

Check and read the attached data sheet.

Tom… :slight_smile:

LM2901.pdf (120 KB)

I added a 10k pullup, that didn't help, it just fixed the output.

What does "it just fixed the output." mean (in view of the "that didn't help" comment ?

The two statements seem contradictory.

Your circuit already had a 10k pullup on TPB.

I reconfigured the diode and the circuit works.

Presumably "reconfigured" means you reversed the diode . So is the banded end connected to the -V input of the LM339 now ? (and not the other way around)

wyngnut:
Sorry, as I said, I need to brush up on my diodes. Did the drawing in Paint.Net, would love something simpler.

The max peak to peak voltage is about 5V when the AC generator is rotating about 100 Hz (and varies depending on generator speed) nd the 1.0V reference voltage holds off anything under 40 Hz.

All your schematics and reasoning doesn’t make a lot of sense to me.

Study the diagram in post#2.
Try to understand the TWO voltage dividers. 100k-10k and 100k-10.2k (2x 5k1).
(assume Vin at ground potential without input signal)
And why the slight 0.2K offset.
And the very high feedback resistor.
And why the diode is not important for the function of the circuit.

This circuit switches at very low voltages, so you have to solve your “40herz” problem in software.
Leo…

The max peak to peak voltage is about 5V when the AC generator is rotating about 100 Hz (and varies depending on generator speed) and the 1.0V reference voltage holds off anything under 40 Hz.

and the 1.0V reference voltage holds off anything under 40 Hz

How do you figure that ?

Even a 10 hz AC signal still has to cross zero so it will be less that 0.877 V (the ref voltage with the given resistor values) as it approaches the zero crossing point and will be greater than the ref voltage before and after so what do you mean by "holds off anything under 40 hz " ?

What am I missing ?

I think that the "generator" OP is talking about outputs less voltage below a certain speed??
Then the voltage dips below the 1volt threshold, and nothing is detected anymore.
??
Leo..

Do you agree it was a fair question ?
(that the OP neglected to explain how that works)

The circuit in post#2 has a threshold of 8.25mV on a 5volt supply, not counting the 20Meg hysteresis resistor or the 1% tolerance of the parts.
That circuit is perfect when driven from a low impedance source.

But we don’t know what the source is, so this circuit might not work at all.
Leo…

I calculated 1.36 V

Vo = Vi * R2/(R1+R2)= 15V*(10k/(10k+100k)
15V * 0.090 = 1.36V

Where do you get 8.25 mV ?

(show your work)

Two voltage dividers are at work.

100k_10k on the +input, and 100k_10.2k on the -input (2x 5k1 = 10k2).

Assuming there is no input signal, and Vin is driven by a very low impedance source (ground).

When the whole circuit is supplied by 5volt....

The +input is 10/110 * 5volt = 0.45454...volt.
And the -input is 10.2/110.2 * 5volt = 0.46279....volt.
The difference between the + and - input is ~8.25mV.
I will leave it over to you to add the 20Meg resistor to the equation.
It will either be in parallel with the 10k resistor or the 100k resistor, depending on the state of the output.
Leo..