Electronic – I am facing a problem while designing a Schmitt trigger circuit

comparatorfilterhysteresisoperational-amplifierschmitt-trigger

I am applying a Schmitt-trigger to the waveform given in the figure below.

enter image description here.

This is a 3.5 volt signal and I want to perform thresholding so I use 1.58 volts as upper threshold and 1.17 volts as lower threshold for my Schmitt-trigger circuit. My designed Schmitt trigger is given in the image below.

enter image description here

After applying Schmitt-trigger I was expecting a square waveform and it should be. But I got a signal that was not a pure square wave it was rounded from the top. the resulting waveform is as follows:

enter image description here

My question is why it is happening? Why I am not getting a square waveform as an output?

Best Answer

The LM339 has an open-collector output stage, which makes it's high state output value dependent on many things - none of which are the LM339 itself.

When the output is supposed to be high, the voltage level is dependent on VDD5B, R6, R7, R8, R9, the input voltage OUTB and its source impedance, and whatever OUT2 is connected to, its bias point voltage, and its impedance. As long as all of those details are secret, so is the reason the waveform top is not flat.

For example, if the waveform peak value is 4.5 V, then 167 uA of current is going somewhere. It cannot be going through R7, because that would create a 50 V voltage crop across the resistor. However, if whatever OUT2 goes to is held at approx. 2.8 V with a zero ohm source impedance, that would explain the output not being the full 5.0 V.

Disconnect R9 and see what the pin 1 waveform looks like.

Note - your schematic does not show the power supply rails for U1 or any power supply decoupling. These are important for proper operation.