Opamps Hysteresis: The Ultimate Guide

Posted by

What is Opamp Hysteresis?

Opamp hysteresis, also known as positive feedback or Schmitt Trigger, is a technique used in operational amplifier circuits to create a threshold voltage that must be exceeded before the output switches states. In other words, it introduces a deliberate amount of hysteresis or “dead zone” between the switching thresholds to prevent output oscillation or multiple transitions due to noise when the input is near the threshold level.

Hysteresis in an opamp circuit is achieved by applying a small amount of positive feedback from the output back to the non-inverting (+) input. This positive feedback creates two distinct switching thresholds – one for the rising input signal (V+) and one for the falling signal (V-). The difference between these two thresholds is the hysteresis voltage (Vh).

The key benefits of opamp hysteresis are:

  1. Noise immunity: Hysteresis prevents unwanted output transitions caused by noise on the input signal when it is close to the threshold.

  2. Clean switching: The output makes a clean, sharp transition between states without multiple transitions or oscillations.

  3. Adjustable thresholds: By selecting appropriate resistor values, the switching thresholds and amount of hysteresis can be easily adjusted to suit the application.

  4. Schmitt trigger operation: Opamp hysteresis circuits are often used to create schmitt triggers which convert analog inputs to clean digital outputs.

How Does Opamp Hysteresis Work?

To understand how opamp hysteresis works, let’s consider the most basic opamp comparator circuit:

[Basic opamp comparator circuit diagram]

In this circuit, the opamp compares the input voltage (Vin) to the reference voltage (Vref) connected to the inverting (-) input. When Vin exceeds Vref, the output (Vout) switches to the positive rail (+Vs). When Vin falls below Vref, Vout switches to the negative rail (-Vs) or ground.

The problem with this basic comparator is that when Vin is very close to Vref, even a small amount of noise can cause the output to switch rapidly back and forth between states. This is where hysteresis comes into play.

Now let’s look at an opamp comparator with hysteresis:

[Opamp comparator with hysteresis circuit diagram]

In this circuit, resistors R1 and R2 form a voltage divider that provides positive feedback from the output back to the non-inverting input. This feedback voltage (Vf) is a fraction of the output voltage determined by the ratio of R1 and R2:

Vf = Vout * [R1 / (R1 + R2)]

The input signal (Vin) is applied to the non-inverting input through resistor R3. The inverting input is connected to a reference voltage (Vref) that sets the nominal threshold.

Here’s how the hysteresis works:

  1. When Vin is below the lower threshold (V-), Vout is low (-Vs or ground). The feedback voltage (Vf) is also low. As Vin rises and exceeds V-, Vout remains low.

  2. When Vin exceeds the upper threshold (V+), Vout switches high (+Vs). The feedback voltage (Vf) is now a fraction of +Vs determined by R1 and R2. This effectively raises the input threshold.

  3. As Vin falls, Vout remains high until Vin drops below the lower threshold (V-). At this point, Vout switches low again and the cycle repeats.

The upper and lower thresholds can be calculated as follows:

V+ = Vref + (Vh/2)
V- = Vref – (Vh/2)

Where Vh is the hysteresis voltage given by:

Vh = Vs * [R1 / (R1 + R2)]

By selecting appropriate values for R1 and R2, the amount of hysteresis (Vh) can be adjusted to provide the desired noise immunity and clean switching behavior for the particular application.

Opamp Hysteresis Design Considerations

When designing opamp hysteresis circuits, there are several key factors to consider:

Hysteresis Voltage (Vh)

The hysteresis voltage determines the size of the “dead zone” between the upper and lower switching thresholds. A larger Vh provides greater noise immunity but also requires a larger input signal swing to switch states. A smaller Vh provides less noise immunity but allows the circuit to respond to smaller input changes.

The choice of Vh depends on the expected noise level in the system and the desired sensitivity to input changes. A good starting point is to set Vh to be at least 2-3 times the expected peak-to-peak noise voltage.

Threshold Voltages (V+ and V-)

The threshold voltages determine the points at which the output switches states. They are set by the reference voltage (Vref) and the hysteresis voltage (Vh) as described earlier.

Vref is usually set to the midpoint of the input signal range. For example, if the input varies from 0V to 5V, Vref would be set to 2.5V.

The upper and lower thresholds are then positioned symmetrically above and below Vref by Vh/2. Continuing the example, if Vh is chosen to be 1V, then:

V+ = 2.5V + (1V/2) = 3V
V- = 2.5V – (1V/2) = 2V

So the output would switch high when the input exceeds 3V and switch low when it falls below 2V.

Feedback Resistors (R1 and R2)

The feedback resistors determine the fraction of the output voltage that is fed back to the non-inverting input. This in turn sets the hysteresis voltage (Vh).

A larger ratio of R1 to R2 provides a larger Vh. Conversely, a smaller R1/R2 ratio provides a smaller Vh.

The absolute values of R1 and R2 are not critical but they should be chosen to be large enough to not load down the opamp output while being small enough to not be affected by input bias currents. Typical values range from 10K to 1M ohms.

It’s also important to consider the maximum output current of the opamp when selecting R1 and R2 to ensure the opamp can drive the resistor load.

Input Resistor (R3)

Resistor R3 in series with the non-inverting input is not strictly necessary but is often included for two reasons:

  1. It provides some isolation between the input signal source and the feedback network (R1/R2). This prevents the feedback from affecting the input source.

  2. If R3 is made equal to the parallel combination of R1 and R2, it balances the impedance at the opamp inputs which improves performance, especially at high frequencies.

The value of R3 is usually chosen to be approximately equal to R1||R2. For example, if R1 = 100K and R2 = 10K, then R3 would be approximately 9.1K.

Opamp Selection

The choice of opamp depends on the requirements of the application such as input/output voltage range, speed, power consumption, and noise.

Some key opamp specs to consider for hysteresis circuits are:

  • Input offset voltage: Affects the accuracy of the threshold voltages. Opamps with low offset voltage (< 1mV) are preferred.

  • Slew rate: Determines how fast the output can switch states. Faster slew rates allow higher frequency operation.

  • Gain bandwidth product (GBP): Also affects maximum operating frequency. Higher GBP allows higher frequency operation.

  • Supply voltage range: Must be compatible with the system supply voltages and the input/output signal ranges.

  • Output drive current: Must be sufficient to drive the feedback resistor load and any other load on the output.

Some popular opamps for hysteresis circuits include:

Opamp Key Specs
LM339 Quad comparator, 2μs response time, 2mV offset
LM393 Dual comparator, 1.3μs response time, 2mV offset
MCP6541 Single comparator, 400ns response time, 1mV offset
TLV3502 Dual comparator, 280ns response time, 2mV offset

Opamp Hysteresis Applications

Opamp hysteresis circuits find use in a wide range of applications where clean switching and noise immunity are important. Some common examples include:

Schmitt Triggers

A schmitt trigger is a comparator circuit with hysteresis that converts a noisy or slowly changing input into a clean, fast-switching digital output. Schmitt triggers are commonly used to:

  • Clean up noisy digital signals
  • Convert analog signals to digital (1-bit ADC)
  • Condition signals for driving digital logic circuits
  • Debounce mechanical switch contacts

Window Comparators

A window comparator uses two comparators with hysteresis to detect when an input signal is within a certain voltage range or “window”. The circuit outputs a high level when the input is inside the window and a low level when it is outside.

Window comparators are often used for:
– Voltage level monitoring
– Over/undervoltage detection
– Signal range checking
– Analog signal processing

Oscillators and Waveform Generators

Opamp hysteresis can be used to create oscillator circuits that generate square, triangle, or sawtooth waveforms. The hysteresis provides the positive feedback needed for oscillation while also ensuring clean switching between states.

Some common opamp oscillator topologies that use hysteresis are:
– Schmitt trigger oscillator
– Triangle/square wave generator
Sawtooth Generator
– Pulse width modulator (PWM)

Voltage Regulators and Supervisory Circuits

Hysteresis is often employed in voltage monitoring and supervisory circuits to provide clean, glitch-free reset signals for microcontrollers and other digital systems.

For example, a voltage detector with hysteresis can monitor a power supply voltage and generate a reset signal if the voltage falls below a certain threshold. The hysteresis prevents chattering of the reset signal due to noise or slow voltage changes.

Hysteretic voltage regulators use opamp hysteresis to control the switching of a pass transistor or regulator IC to maintain a steady output voltage. The hysteresis provides a clean on/off control signal and prevents multiple transitions that could cause output voltage ripple or instability.

Opamp Hysteresis Design Example

Let’s walk through the design of a simple opamp schmitt trigger circuit with hysteresis. The goal is to convert a 0-5V analog input signal into a clean 0/5V digital output with a switching threshold of 2.5V and hysteresis of 0.5V.

Given:
– Vin = 0 to 5V analog input
– Vout = 0/5V digital output
– Vref = 2.5V
– Vh = 0.5V
– Vs = ±5V opamp supply voltages

Step 1: Choose the hysteresis resistors R1 and R2.

To get a hysteresis voltage of 0.5V with Vs = 5V, we can use the formula:

Vh = Vs * [R1 / (R1 + R2)]

Rearranging to solve for the resistor ratio:

R1 / R2 = Vh / (Vs – Vh) = 0.5V / (5V – 0.5V) = 1/9

So we can choose standard values like R1 = 10K and R2 = 90K.

Step 2: Calculate the upper and lower threshold voltages.

V+ = Vref + (Vh/2) = 2.5V + (0.5V/2) = 2.75V
V- = Vref – (Vh/2) = 2.5V – (0.5V/2) = 2.25V

Step 3: Choose the input resistor R3.

For good performance, we want R3 to approximately equal the parallel combination of R1 and R2.

R1||R2 = (R1 * R2) / (R1 + R2) = (10K * 90K) / (10K + 90K) = 9K

So we can choose R3 = 9.1K (standard value).

Step 4: Select an appropriate opamp.

For this design, we need an opamp with:
– Supply voltage range includes ±5V
– Low input offset voltage for accurate switching thresholds
– Sufficient output current to drive the feedback network
– Adequate speed for the input signal frequency

The LM393 dual comparator is a good choice. It has a maximum offset voltage of 2mV, can operate on supplies up to ±18V, and a typical output current of 20mA.

Putting it all together, our final schmitt trigger circuit looks like:

[Complete schmitt trigger circuit diagram]

And here are the key specs:

Parameter Value
Vin range 0 to 5V
Vout levels 0V, 5V
Upper threshold V+ 2.75V
Lower threshold V- 2.25V
Hysteresis Vh 0.5V
Supply voltages ±5V

This circuit will cleanly switch its output high when the input rises above 2.75V and switch low when the input falls below 2.25V. The 0.5V hysteresis provides noise immunity and prevents output oscillation when the input is slowly changing around the 2.5V threshold point.

Opamp Hysteresis FAQs

Q: What is the purpose of hysteresis in opamp comparator circuits?

A: Hysteresis in opamp comparators serves two main purposes:

  1. It prevents output oscillation or multiple transitions due to noise when the input signal is close to the threshold voltage.

  2. It provides clean, sharp output transitions between the low and high states.

Q: How do you calculate the hysteresis voltage in an opamp circuit?

A: The hysteresis voltage (Vh) in an opamp comparator is determined by the supply voltage (Vs) and the ratio of the feedback resistors (R1 and R2) as follows:

Vh = Vs * [R1 / (R1 + R2)]

By selecting appropriate values for R1 and R2, you can set the desired amount of hysteresis voltage.

Q: What is the difference between the upper and lower threshold voltages?

A: In an opamp comparator with hysteresis, there are two threshold voltages:

  • The upper threshold voltage (V+) is the input level above which the output switches to the high state.
  • The lower threshold voltage (V-) is the input level below which the output switches to the low state.

The difference between V+ and V- is the hysteresis voltage (Vh). The thresholds are positioned symmetrically above and below the reference voltage (Vref) by ±Vh/2.

V+ = Vref + (Vh/2)
V- = Vref – (Vh/2)

Q: How do you choose the feedback resistor values for a desired hysteresis voltage?

A: To set the hysteresis voltage to a desired value (Vh), you can choose the feedback resistors R1 and R2 based on the formula:

Vh = Vs * [R1 / (R1 + R2)]

First select a standard resistor value for R1, typically in the range of 10K to 1M. Then calculate the required value for R2 as:

R2 = R1 * [(Vs / Vh) – 1]

Finally, choose the closest standard value for R2.

For example, to get Vh = 0.6V with Vs = 5V and R1 = 10K, the calculated R2 value is:

R2 = 10K * [(5V / 0.6V) – 1] = 73.3K

So you could use R2 = 75K as the nearest standard value.

Q: What are some common applications for opamp hysteresis circuits?

A: Opamp hysteresis circuits are widely used in many applications, such as:

  • Schmitt triggers for converting noisy analog signals to clean digital outputs
  • Window comparators for detecting when a signal is within a certain range
  • Oscillators and waveform generators
  • Voltage monitors and supervisory circuits
  • Debouncing switches and mechanical contacts
  • Analog signal conditioning and processing

Basically any application that requires clean, glitch-free switching or improved noise immunity can benefit from opamp hysteresis.

Leave a Reply

Your email address will not be published. Required fields are marked *