Asking for advice from the pros here. I need to use a hysteresis comparator to convert this weak triangular wave into a rectangular wave, and then invert it too!
Hey OP, a hysteresis comparator can totally handle this requirement, and you can get the inverting effect directly from the comparator itself without adding extra circuitry~
First, let me walk you through the core idea: your triangular wave signal is pretty weak (Channel B is only 500 μV/Div), and if it goes straight into the comparator, noise can easily cause false triggers. I’d recommend a stage of small-signal amplification first, then into the hysteresis comparator. The hysteresis comparator itself can produce an inverting output just by how you wire the op-amp inputs:
- Feed your amplified triangular wave into the op-amp’s inverting input, connect the reference voltage (or your divided threshold) to the non-inverting input, and add a positive-feedback hysteresis resistor. The output rectangular wave will then be inverted relative to the input!
- The upper and lower hysteresis thresholds are set by the voltage-divider and positive-feedback resistors. As long as the triangular wave’s peak-to-peak swing crosses both thresholds, it’ll toggle cleanly without any chatter.
- Choose a comparator or op-amp with high open-loop gain and fast response. For weak signals, you might also look into dedicated comparators with built-in hysteresis—they have better noise immunity.
If you don’t want to rewire the comparator, you could do a non-inverting hysteresis comparator followed by an inverting amplifier/inverter stage, but every extra stage adds noise. It’s much cleaner to just handle the inversion inside the comparator~
To convert and invert at the same time, you just need an Inverting Schmitt Trigger circuit.
- The Logic: When the triangle wave goes up and hits the high threshold, the output goes low. When it goes down and hits the low threshold, the output goes high. Boom—inverted square wave.
- The Catch: Looking at your screenshot, that signal is tiny. If you try to do this with a single stage, noise is going to be your worst enemy. I’d highly recommend a two-stage approach: Gain stage \rightarrow Inverting Comparator.
