I am trying to convert an input sine wave to a square wave. The sine wave is centered at 2.5V and has an amplitude of 200mV, with a frequency of 100kHz.

I am looking for a hysteresis of 100mV centered around 2.5V. (ie. 50mV below and 50mV above 2.5V)

I am trying to achieve something like the following , where both waves are centered about 2.5V:

enter image description here

To do so I looked through Design with Operational Amplifiers and Analog ICs, and I thought that I could work with a VTC offsetting single-supply inverting Schmitt trigger.

enter image description here

I then calculated the resistance values according to my parameters.

VTH = 2.55V
VTL = 2.45V
VCC = 5V

enter image description here

Where I get:

  • R1 = R2 = 1kΩ
  • R3 = 1kΩ
  • R4 = 50kΩ
  • R5 = 100Ω

Testing this on proteus:

enter image description here

yields undesired results:

enter image description here

I was expecting the hysteresis of 100mV and not 200mV.

On closer inspection, VTL is 2.4Vand VTH is 2.6V. This can be remedied by increasing R4 while keeping R3 constant. I would like to know why my initial calculations were incorrect.

Any suggestions on what I may be doing wrong would be appreciated.

  • \$\begingroup\$ How did you arrive at the value for R5? It seems much too high to me...like by 100X. \$\endgroup\$ – Elliot Alderson Jan 8 at 21:06
  • \$\begingroup\$ Try making R5 << R4. \$\endgroup\$ – glen_geek Jan 8 at 21:06
  • \$\begingroup\$ Thanks for pointing out. Indeed that is a big mistake. Updating question immediately \$\endgroup\$ – Rrz0 Jan 8 at 21:10
  • \$\begingroup\$ Well 100 ohms is too low. Try something around 5k\$\Omega\$. Be aware that the output low voltage for an LM339 can be as high as 400mV and is typically 130mV (at room temperature, sinking 4mA). \$\endgroup\$ – Elliot Alderson Jan 8 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.