element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Test & Tools
  • Technologies
  • More
Test & Tools
Blog OpAmp as Schmitt-trigger
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Test & Tools to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 25 Jan 2025 6:29 PM Date Created
  • Views 4444 views
  • Likes 16 likes
  • Comments 23 comments
  • art of electronics
  • opamp
  • schmitt-trigger
Related
Recommended

OpAmp as Schmitt-trigger

Jan Cumps
Jan Cumps
25 Jan 2025

A Schmitt-trigger is a circuit that turns a non-perfect digital signal into a clean one. It has 2 main functions:

  • recreate a good fast ramp for signals that have lost their oomph (or never had clean fast edges). 
  • provide a bit of hysteresis, so that signals with significant noise can be restored to proper high and low

There was a recent design of shabaz that uses Schmitt-triggers:  Brush and Large-Area Multi-Meter Probes for PCB Reverse-Engineering: A DIY Approach! . The Art of Electronics (AOE) happens to explain that very circuit. A good excuse to check it out.

image
image source: The Art of Electronics 3rd edition p. 237 - fair use

Schmitt-triggers have a set level where they consider a signal high or low. The main difference with a comparator circuit, is that they also introduce hysteresis. Output will switch when the input reaches a particular level, but it will not switch again until the input has dropped below a different, lower, input level. An engineer will define the two levels so, that the noise on the input will never cause a state flip.

image

image source: TI Application Brief Understanding Schmitt Triggers - fair use

For this post, I'm recreating the AOE design based on an OpAmp (identical to Shabaz', just with different levels and operating voltage), The only change I made is the desired voltage level. I brought that down from  5 V to approx. 3.3 V, because that's in the range of my signal generator. I use the very common UA741 in this design, because I have a through-hole one. In a real design, you'd probably use a more modern one that can work on lower voltages, and can drive its output to the rails. And is faster (see jc2048 ' comment).

This is an inverting design. The output drives low when the input is high.

The circuit

It's virtually the same as the AOE design. But R1 is 20K instead of 10K, OpAmp voltage 10 V. 

image


image
images: the actual circuit that I set up on a breadboard.

Results

Test with an input that is noisy, and migrates to both upper and lower levels multiple times:

image
image source: the design successfully cleans up a noisy test signal from my waveform generator

The yellow trace is the input. I have chosen a signal that is noisy on both low and high level. I've set it so that it has glitches on both sides of the hysteresis range. The magenta trace is the output. It's a nice "digital" signal, with fast edges and little noise. Because I used the imperfect UA741, signal does not reach ground or VCC. The Blue trace is the set point. You can clearly see that the output level influences the comparison point.

Operation: this is an OpAmp with positive feedback. R3 feeds the output back to the + input. That "escalates" the OpAmp. When the input crosses the set point, it immediately goes to the rail voltage (or as close as it can get to it).

R3 also has another effect: It influences the set point, because it is either connected to the positive or ground rail. When output is low, R3 will pull the set point down a little. When output is high, it will pull it up somewhat. That's what generates the hysteresis. Set point and hysteresis width are function of the 3 resistors values (and by how close the OpAmps can drive to the rails).

  • Sign in to reply
Parents
  • jc2048
    jc2048 7 months ago

    I've never owned a copy of tAoE. Perhaps e14 could offer one or two as a prize in a P14 competition.

    Good blog, but...

    "it immediately goes to the rail voltage"

    not with a 741 it doesn't. The slew rate is less than a volt per microsecond, and that's slower than the recommended input transition rate even for a slow logic like HCT. In practice it would probably happily work anyway (for a personal project), but there's a danger the input might oscillate during the transition.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps 7 months ago in reply to jc2048

    Yes, it's too slow for real world applications:

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps 7 months ago in reply to shabaz

    > Custom or the AWG contains it by default?

    It is one of the 20 custom waveforms of the (no longer made) multicomp pro MP750065 .

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps 7 months ago in reply to jc2048

    > Do Horowitz and Hill cover all this (the pros and cons of using op amps as comparators) in their book?

    image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 7 months ago in reply to shabaz

    "Very useful. I would not have been able to predict the output that you got for point 4, but now it makes sense. How did you generate that chopped input signal like that? Custom or the AWG contains it by default?"

    That one confused me too initially, until I realised that Jan was showing us that the compensation in the 741 is effectively an integrator.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jc2048
    jc2048 7 months ago in reply to Jan Cumps

    "... is this the recovery you are referring to?"

    Yes. Worse than just the delay, which may not matter too much given how pedestrian the 741 output is, is that it's unbalanced - it behaves differently coming away from the +ve rail to the other one. That will be common with bipolar op amps because of the way the output stages were designed. As you've already discovered, that then messes up (wrt the mark/space ratio) slicing a fast waveform.

    If you look at the datasheet for an old, bipolar, commodity comparator like a LM393, the outputs move after about 250ns (depends on the amount of overdrive at the input), balanced either way, and the transition is much faster, even though the level translation to the logic is o/c and a pull-up.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps 7 months ago in reply to Jan Cumps

    message for young players: you may learn more practical knowledge about OpAmps by using an imperfect one, like the 741.
    They 'll show the pitfalls at low frequencies and away from the rails.

    Maybe, when learning about practical OpAmp use, it's good to have a few examples that misbehave on offset, near the rails and at lower frequencies.
    If you mix that with a few mediocre choppers that show 0 V crossover artifacts, you 'd have an interesting behaviour testbench.

    That said, don't use the 741 in new designs Slight smile.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Jan Cumps
    Jan Cumps 7 months ago in reply to Jan Cumps

    message for young players: you may learn more practical knowledge about OpAmps by using an imperfect one, like the 741.
    They 'll show the pitfalls at low frequencies and away from the rails.

    Maybe, when learning about practical OpAmp use, it's good to have a few examples that misbehave on offset, near the rails and at lower frequencies.
    If you mix that with a few mediocre choppers that show 0 V crossover artifacts, you 'd have an interesting behaviour testbench.

    That said, don't use the 741 in new designs Slight smile.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube