Electronic – How to implement programmable Schmitt trigger

digital potentiometeroperational-amplifierschmitt-trigger

I am trying to build a Schmitt trigger that would allow adjusting High and Low threshold values with a microcontroller.

schematic

simulate this circuit – Schematic created using CircuitLab

I could replace R1-R2 with a DAC, but how do I adjust the feedback resistor R3? Is the trigger going to work properly if I replace R3 with a digital potentiometer?

Best Answer

Completely replacing R1-R2 with a DAC may give you mixed results because the circuit saves a part by relying on the voltage divider's parallel impedance R1||R2. You'll need to ensure that the DAC has the same output impedance as seen from R3.

schematic

simulate this circuit – Schematic created using CircuitLab

That will adjust the threshold while keeping the hysteresis constant. To adjust the hysteresis, you can now replace R1||R2 and R3 with a digipot.