Electronic – Sine wave to square wave – Schmitt trigger

sinesquaretrigger

I need to transform a bipolar sine wave (varies from -5 V to 5 V, 1 kHz) to a square wave for further digital processing (0 to 3.3 V), as in this image:

Sine wave to 3.3 V square wave

The important thing is that this sine wave can't be distorted, so there can't be any limiting diodes at the input.

I have got only 3.3 V and 5 V voltage supplies. An obvious way to go is an op-amp working as a Schmitt trigger, but I'm not sure it can handle -5 V at the input with a single positive 3.3 V supply.

Should I reduce the amplitude on the input by using a resistor divider? And perhaps add some offset voltage for the signal to fit the input voltage range of the op-amp?

Best Answer

I would like to suggest that the comparator circuit shown by @hwengmgr could use some small improvements over what was posted.

Improvements include:

  1. Bigger capacitor value to reduce filter effect of the capacitor at frequency.
  2. Larger value resistors in dividers to reduce current load on source supply.
  3. Added hysteresis at the comparator to make the circuit less sensitive to noise that may be on the input waveform.
  4. Changed pullup resistor on output of comparator to a more sane value for 1mA load instead of 33mA.

enter image description here

enter image description here

This was simulated with LT-Spice. I used a model for a comparator that was built into the package library. You can substitute a comparator of choice as long as it is specified for operation at a Vdd of 3.3V.

The addition of the hysteresis feature necessitated the swapping of the '+' and '-' inputs of the comparator which causes an inversion of the output waveform. If this is a problem it can be easily flipped with a logic element. If you select a dual comparator the other half of the package could be used to invert the signal.

Related Topic