1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Schmitt Trigger Calculations

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by apl247, Apr 9, 2009.

Thread Status:
Not open for further replies.
  1. apl247

    apl247 New Member

    Joined:
    Sep 23, 2008
    Messages:
    19
    Likes:
    0
    I have been trying to figure out how to calculate the resistor values for the inverting schmitt trigger. I have looked online and in my electronics books, can not seem to find any straight forward equations. Maybe someone here can help? I have attached a schematic of the set up I am using.

    Op-amp : LM399
    low threshold: 2.5V
    high threshold: 2.84V
    Vcc: 6 V
    and I would like to output voltage to be 5V (high) and 0V (low)

    Anyone have equations to calculate the three resistor values? Links to websites?

    Thanks
     

    Attached Files:

  2. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334
    Your attachment is too fuzzy to read the values. The big question you need to ask is what is the output swing of the op-amp running on your specific supply voltage?

    The amount of hysteresis is a function of the current that comes to the non-inverting input via the feedback resistor. Just write the equations Kirchoff Current Law, sum of currents into the node connected to the non-inverting op-amp input = zero for both the case when the op-amp output is at Voh and again when at Vol.

    I just put the circuit into LTSpice and let it do the hard work:D
     
  3. ccurtis

    ccurtis Active Member

    Joined:
    Dec 22, 2008
    Messages:
    946
    Likes:
    52
    Location:
    NJ, USA
    Here you go. R123 is the parallel combination of R1, R2, and R3.
    There's a little calculator at:http://hyperphysics.phy-astr.gsu.edu/HBASE/electronic/schmitt.html#c3

    Be aware, the equations are correct, but the calculator assumes that the comparator output voltages swing rail-to-rail and are both equal in magnitude to your battery voltage (which is not true in your case because you are using a single supply, and possibly because your comparator may not swing rail-to-rail).

    Also, the 399 is not an op amp, and if you mean 339 it has an open drain output which throws a slight monkey wrench into the equations which needs to be accounted for.

    [​IMG]
     
    Last edited: Apr 9, 2009
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ccurtis

    ccurtis Active Member

    Joined:
    Dec 22, 2008
    Messages:
    946
    Likes:
    52
    Location:
    NJ, USA

    Even better, I found this calculator for open drain, or push-pull.

    http://sim.okawa-denshi.jp/en/compkeisan.htm
     
    Last edited: Apr 9, 2009
  6. Hero999

    Hero999 Banned

    Joined:
    Apr 6, 2006
    Messages:
    14,902
    Likes:
    79
    Location:
    England
    Here's a spreadsheet I made to help me with comparators. It's part of a much larger spreadsheet of design calculations and tables.

    Note:
    It isn't finished, I'll add some calculations to the bottom circuit.

    It was created using OpenOffice.org so I don't know how good the Excel version is as I don't have MS Office.
     

    Attached Files:

  7. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,044
    Likes:
    541
    Location:
    AZ 86334
    I ran the push-pull calculator (op-amp) for 12V Vref, V1=6.00, V2=6.01 (10mV hysteresis), Vout(High)=11V, Vout(Low)=0.01 (typical for LM358 powered from Vref) and it came up with ridiculously low value resistors. Multiplying the computed values by 100 or 1000 might produce a useful circuit.
     
    Last edited: Apr 10, 2009
  8. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,180
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    The other point thats not covered by the online calculator is the 'load' that the comparator output is driving into, when using an open output comp like the LM393. With say a 3K9 pullup to Vsupply.

    If for example the load is the base drive resistor of transistor, say 470R, it will hold the LM393 output voltage lower than the o/c state.

    This will effect the hysteresis in the comp off state, output high.
     
  9. apl247

    apl247 New Member

    Joined:
    Sep 23, 2008
    Messages:
    19
    Likes:
    0
  10. sranganath81

    sranganath81 New Member

    Joined:
    Oct 17, 2012
    Messages:
    1
    Likes:
    0
    Hello All,
    I am looking for the equations to calculate the resistor values for the same circuit. Please share the equations if any one has.

    Thanks and regards
    Ranganath
     
  11. newbieateverything

    newbieateverything New Member

    Joined:
    Mar 24, 2013
    Messages:
    1
    Likes:
    0
    hi could someone please tell me how to make my upper trigger point 2.8V and my lower trigger point 1V
    what resistor values do i choose to make that happen. Say the resistor connected to ground is 10K

    i realize the current schematic won't make much sense to most, but i can't feedback my trigger output to the mosfet gate just yet. at least not without a switch to vary the voltage at the trigger input.
     

    Attached Files:

  12. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,151
    Likes:
    281
    Location:
    Richmond Hill , ON Canada near Toronto
    ( wrong not an OA, schematic shows LM339, which is a Comparator ) THus you need Vcc=5V for 5V out and Rout is subtracted from R3 to get correct readings for R3 actual feedback R for setting low threshold.

    basically any Schmitt trigger is positive feedback and gain ratio defines how small the 1/2 hysteresis range is relative to the output swing and Vref is the center point of the hysteresis.

    If you dont have 5V and only 6V then use 5xR+1xR pullup and feedback from 5V out. e.g. 5k+1k pullup.
     
    Last edited: Apr 22, 2015
  13. Tony Stewart

    Tony Stewart Well-Known Member Most Helpful Member

    Joined:
    Aug 31, 2012
    Messages:
    3,151
    Likes:
    281
    Location:
    Richmond Hill , ON Canada near Toronto
    Do you really need a +12 -15V swing on your comparator?
    Do you realize the LM339 has low drive current on high side which affects Vmax drop from Vcc?
    Your feedback R is far too low a value and loads the Vmax. switch to a LM339 comparator with open collector maybe for logic levels OR JUST vGS LEVELS

    edit
    I just realized why your design wont work.
    A comparator Schmitt trigger cannot use positive feedback AND Pullup/down resistors to choose bias and hysteresis with an INVERTING input.

    Hysteresis must be independently controlled for Mean threshold and +/- peak threshold around mean and choosing pull down resistor changes hyst. AND mean threshold at the same time.

    So you can use a programmable zener to set mean voltage or use Vref on Vin(-) and use non-inverting mode of comparator. e.g. in your case. Vmean =1.9V and Peak swing is 0.9V.

    If using a single supply comparator with 0-20V swing 0.9V peak swing ( 1.8Vpp) means the feedback ratio is 20/0.9 =22.


    If you use +/-15V swing, can it drive the current for Ciss on Vgs on fast transitions?
    Do you want fast shutoff and slow turnon?

    This means you cannot use the inverting input in this case to set HYST and Vmean independently with R ratios only. The Vref must be a low impedance source.

    Although I dont know what the end result is... A hickup PWM current regulator? CC sink?
     
    Last edited: Apr 22, 2015
  14. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,157
    Likes:
    907
    Location:
    Rochdale UK
    Tony!!! This thread is too old.. Even the last poster hasn't been seen since...
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.

Share This Page