• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Analog IC Tips

Analog IC Design, Products, Tools Layout

  • Products
    • Amplifiers
    • Clocks & Timing
    • Data Converters
    • EMI/RFI
    • Interface & Isolation
    • MEMS & Sensors
  • Applications
    • Audio
    • Automotive/Transportation
    • Industrial
    • IoT
    • Medical
    • Telecommunications
    • Wireless
  • Learn
    • eBooks / Tech Tips
    • FAQs
    • EE Learning Center
    • EE Training Days
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Design Guide Library
    • Digital Issues
    • Engineering Diversity & Inclusion
    • LEAP Awards
    • Podcasts
    • White Papers
  • Video
    • EE Videos
    • Teardown Videos
  • EE Forums
    • EDABoard.com
    • Electro-Tech-Online.com
  • Engineering Training Days
  • Advertise
  • Subscribe

Analog comparators and hysteresis

July 31, 2017 By Bill Schweber Leave a Comment

A standard system requirement is to use the result of a simple “A vs. B” comparison as a basis for decision-making. For example, if the temperature is above a setpoint, turn the heat source off; and if the temperature is below that setpoint, turn the heat source on. Or perhaps there’s an alarm to sound if some critical parameter goes beyond a threshold, such as excessive speed.

Q: How is the comparator function implemented in analog circuitry?

The comparator circuit element which does this is conceptually simple. It has two inputs, one of which is the setpoint or desired reference (threshold) voltage and may be a fixed value, or user-adjustable, depending on the design, Figure 1. The unknown input-signal voltage, such as a temperature reading, is continually compared to the setpoint; if this input is greater than the setpoint, the output goes high; if the input is less than the input, the output goes low.

Fig 1: A comparator implements a simple and very nonlinear transfer function: when one input is greater than the other, the output is high; when that input is less than the other one, the output goes low. (Image source: Analog Devices, Inc.)

Q: To what is the output of the comparator connected?

It depends, of course, on the application and the system architecture. In some mostly-analog designs, or ones where there is a need to minimize issues with software interaction and associated risk, the comparator out may be directly connected to the function it controls, such as a heater element control. In most designs, however, the output is either scanned(checked) periodically by the processor (of a programmable logic controller or microcontroller system) or it is used to generate an interrupt to the processor. Once the processor-based system sees the comparator output state change, it initiates the action which it is programmed to do.

Q: What’s the difference between a conventional op amp and a comparator?

A comparator is a specialized operational amplifier (op amp) optimized for high gain, differential inputs, and a very nonlinear output state of either high or low. The desirable attributes of an op amps such as low bias current, low offset, and high linearity are not needed for a comparator, which instead needs fast response and stable performance when the two input signals are very close to each other in value. This, while there are general similarities, a comparator is better suited for the role, although in some cases a standard op amp can be used (see FAQ: Should I use an op amp as a comparator?).

Q: What else does a practical, useful comparator function require?

In a word: hysteresis. This is because a “perfect” comparator function actually has some negative aspects. Consider this scenario: the unknown signal is very close to the setpoint threshold. As it moves up and down a tiny bit, the comparator output goes from high to low and back continually. The result in constant “flickering” or “chattering” of the output, when the unknown signal is around the setpoint. Not only is this annoying (as in the case of a home-heating system or air conditioner) but it causes noise, premature wear-out of valves, mechanical fatigue, and other undesired consequences.

Further, even if this chattering was not considered to be a problem (a rare occurrence), a perfect comparator would be a problem because there is always electrical noise on the signal, and this noise would cause random high/low action on the comparator output.

Q: What does hysteresis do?

Hysteresis establishes a buffer zone around the trip-point threshold during which the output does not change from its previous value, depending on the direction of signal change. It works like this, Figure 2: assume the input is below the setpoint, so the output of the comparator is low. As the input signal increases, the comparator output does not change and go high until the input is “a little” above the setpoint. Now look at the reverse case, when the input is above the setpoint and the comparator output is high. As the input decreases, the output of the comparator does not change state until the input is a little below the setpoint.

Fig 2: Hysteresis adds a “dead band” around the crossover threshold to prevent output chatter, with the output state dependent on the direction of travel of the input signal as it makes the transition. (Image source: Analog Devices, Inc.)

Q: How is hysteresis implemented using analog circuitry?

It’s relatively simple and is done with some fixed resistors placed around the comparator, Figure 3. In cases where the amount of hysteresis needs to be changed, variable resistors (either adjusted manually set or digitally settable ones) can be used.

Fig 3: It’s very easy to incorporate hysteresis in an analog circuit by adding a pair of resistors. (Image source: Analog Devices, Inc.)

Q: What’s the “right” amount of hysteresis?

As in most engineering situations, the answer is: “it depends”. A smaller hysteresis zone means more tighter and more-accurate control, but also more on/off chattering due to minute signal changes and electrical noise. A wider zone means the on/off chatter is reduced, and noise immunity is increased, but at a cost in output accuracy. For example, a home gas oven with standard hysteresis can easily have a temperature swing of ±20°F around the user-defined setpoint; a laboratory oven would be designed with a much-smaller hysteresis band, such as ±1°F, but would have more on/off cycling of the heating element.

Q: Are the comparator function and hysteresis always implemented via analog components?

No. In cases where the input is changing very slowly, the system processor may instead read the digitized version of the input signal, compare it in software to the setpoint, and decide if the output action should represent the high or low state. The amount of hysteresis can then set entirely in the software, which adds to flexibility. Using a digital approach and software-based comparison and hysteresis is practical for slowly-changing signals and low sampling rates. But becomes difficult and a system-resource burden as the signal of interest reaches into the hundreds-of-kHz range and higher, and is very difficult to implement for signals in the MHz range. In contrast, an all analog comparator can easily be designed for tens of MHz and higher using standard components.

Reference

Analog Devices MT-083 Tutorial, “Comparators”

You may also like:


  • Selecting an op amp

  • Should I use an op amp as a comparator?

Filed Under: Analog ICs, FAQ, Featured Tagged With: analogdevicesinc, basics, FAQ

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Featured Contributions

Design a circuit for ultra-low power sensor applications

Active baluns bridge the microwave and digital worlds

Managing design complexity and global collaboration with IP-centric design

PCB design best practices for ECAD/MCAD collaboration

Open RAN networks pass the time

More Featured Contributions

EE TECH TOOLBOX

“ee
Tech Toolbox: Connectivity
AI and high-performance computing demand interconnects that can handle massive data throughput without bottlenecks. This Tech Toolbox explores the connector technologies enabling ML systems, from high-speed board-to-board and PCIe interfaces to in-package optical interconnects and twin-axial assemblies.

EE LEARNING CENTER

EE Learning Center
“analog
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

EE ENGINEERING TRAINING DAYS

engineering

RSS Current EDABoard.com discussions

  • Charge Pump Design for a 'DC' type Output
  • problem with Stb simulation for an integrator
  • Why spread inductor turns across the bobbin?
  • tv crt glass
  • 9V~36V 200W output isolated DCDC converter from PFC 400V, which topology will you choose?

RSS Current Electro-Tech-Online.com Discussions

  • Steering angle sensor question
  • Sine wave distortion
  • Variable audio oscillator
  • potenciometer attachment / screwdriver
  • flexible copper cable
“bills

Footer

Analog IC Tips

EE WORLD ONLINE NETWORK

  • 5G Technology World
  • EE World Online
  • Engineers Garage
  • Battery Power Tips
  • Connector Tips
  • EDA Board Forums
  • Electro Tech Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips

ANALOG IC TIPS

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us

Copyright © 2026 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy