ENGINEERING WORKSPACE
CIRCUITS / RF
EMBEDDED / SOFTWARE
DESIGN / BUILD / DOCUMENT

Precision Comparator with Hysteresis (Schmitt Trigger)

Objective

The objective of this project is to design and simulate a non-inverting Schmitt trigger using a voltage comparator and positive feedback.

The circuit is intended to convert a slowly varying input signal into a stable digital output while preventing unwanted switching caused by noise near the switching threshold.

Design Specifications

ParameterValue
Supply voltage5 V
Reference voltage2.5 V
Upper switching threshold3 V
Lower switching threshold2 V
Hysteresis width1 V
ComparatorMCP6561-OT
Output configurationPush-pull

Working Principle

A conventional comparator changes its output state according to the voltage difference between its non-inverting and inverting inputs.

When noise is present near the switching threshold, the comparator may switch repeatedly.

A Schmitt trigger uses positive feedback to establish two different switching thresholds.

  • When the input rises above the upper threshold, the output switches HIGH.
  • When the input falls below the lower threshold, the output switches LOW.
  • Between the thresholds, the output retains its previous state.

The hysteresis width is calculated as:

VH = VTH+ − VTH−

VH = 3 − 2 = 1 V

Circuit Design

The circuit uses an MCP6561 comparator powered from a 5 V supply.

The input signal is connected to the non-inverting terminal through resistor R1. Positive feedback is provided from the comparator output to the same terminal through resistor R2.

The inverting terminal receives a nominal 2.5 V reference, generated using two equal resistors connected as a voltage divider.

Component Value Function
R110 kΩInput resistor
R250 kΩPositive feedback
R310 kΩReference divider
R410 kΩReference divider
U1MCP6561-OTComparator

Design Calculations

Assuming negligible current entering the comparator's non-inverting input, Kirchhoff's Current Law gives:

(Vin − V+) / R1 = (V+ − Vout) / R2

Rearranging:

V+ = (R2 × Vin + R1 × Vout) / (R1 + R2)

At the switching point:

V+ = Vref = 2.5 V

Upper Switching Threshold

Initially, the comparator output is LOW. Assuming an ideal LOW output voltage of 0 V, the circuit is designed to switch HIGH when the input reaches 3 V.

2.5 = (3 × R2) / (R1 + R2)

R2 / R1 = 5

Choosing R1 = 10 kΩ gives:

R2 = 50 kΩ

Lower Switching Threshold

When the output is HIGH, we assume an ideal output voltage of 5 V.

The lower switching threshold can be determined from:

2.5 = (R2 × Vin + 5 × R1) / (R1 + R2)

Substituting R1 = 10 kΩ and R2 = 50 kΩ:

2.5 = (50 × Vin + 50) / 60

Vin = 2 V

The theoretical switching thresholds are therefore 3 V and 2 V, corresponding to a 1 V hysteresis width.

KiCad Simulation

The circuit was implemented in KiCad using the MCP6561-OT comparator symbol and a manufacturer-provided SPICE subcircuit model.

A VPULSE source was used to generate a rising and falling input voltage.

ParameterValue
Initial voltage0 V
Peak voltage5 V
Rise time10 ms
Fall time10 ms
Pulse width10 ms
Period40 ms
Transient analysis duration80 ms
Time step10 µs

Simulation Observations

The transient simulation completed successfully, and the comparator output exhibited switching behaviour as the input voltage varied.

The output waveform showed distinct HIGH and LOW states. However, the switching thresholds have not yet been conclusively verified against the theoretical targets of 3 V and 2 V.

Further investigation is required to determine the actual switching voltages and to verify the operation of the positive-feedback network.

Therefore, the present simulation represents an initial functional test rather than complete validation of the hysteresis specifications.

Conclusion

A non-inverting Schmitt trigger was designed using an MCP6561 comparator and positive feedback.

Theoretical circuit analysis established a 5:1 feedback resistor ratio for the desired switching thresholds of 3 V and 2 V under ideal output-voltage assumptions.

The circuit was implemented and simulated in KiCad. Further verification of the actual switching thresholds is required before the design can be considered fully validated.

No comments: