# Op Amp Comparator hysteresis

Started by August 31, 2012
I see circuits that add hysteresis to op-amp comparators by putting a positive feedback resistor network that acts as a voltage divider to the output.

Am I right in thinking that this will only work if you have a negative rail? If your negative rail is grounded this aint gonna give you hysteresis... is there a way this would work with a single supply opamp?

thanks!
On Friday, August 31, 2012 10:17:55 AM UTC-5, panfilero wrote:
> I see circuits that add hysteresis to op-amp comparators by putting a pos=
itive feedback resistor network that acts as a voltage divider to the outpu= t.
>=20 >=20 >=20 > Am I right in thinking that this will only work if you have a negative ra=
il? If your negative rail is grounded this aint gonna give you hysteresis..= . is there a way this would work with a single supply opamp?
>=20 >=20 >=20 > thanks!
I think I have an idea.... I would have to figure out my thresholds and flo= at my opamp so that the positive feedback voltage divider gives me the thre= sholds I need... So, if I want my high threshold at 2V and low at 1V then (assuming my divid= er splits my voltage in half) I'd need my high opamp rail at 4V and my low = rail at 2V... so I'd have to make sure my opamp works off of 2V and my inpu= t signal never goes beyond my rails... ???????
panfilero wrote:
> > I see circuits that add hysteresis to op-amp comparators by putting a positive feedback resistor network that acts as a voltage divider to the output. > > Am I right in thinking that this will only work if you have a negative rail? If your negative rail is grounded this aint gonna give you hysteresis... is there a way this would work with a single supply opamp? > > thanks!
If your threshold voltage is at zero, then you're likely to have other problems as well. However, the resistor still provides hysteresis. Say you have a 10k resistor from the reference to the + input, and a 1M feedback resistor. With +5/0 outputs, the threshold will be: V_LH = (Vref*1M + 5V*10k)/1.01M = 0.99*Vref + 50 mV V_LH = (Vref*1M + 0V*10k)/1.01M = 0.99*Vref With a 5V swing and a 1% division ratio, you always get 50 mV hysteresis. If the reference voltage is halfway between the supplies, the hysteresis range is symmetrical, but not otherwise. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 845-480-2058 hobbs at electrooptical dot net http://electrooptical.net
On Fri, 31 Aug 2012 08:30:01 -0700 (PDT), panfilero
<panfilero@gmail.com> wrote:

>On Friday, August 31, 2012 10:17:55 AM UTC-5, panfilero wrote: >> I see circuits that add hysteresis to op-amp comparators by putting a positive feedback resistor network that acts as a voltage divider to the output. >> >> >> >> Am I right in thinking that this will only work if you have a negative rail? If your negative rail is grounded this aint gonna give you hysteresis... is there a way this would work with a single supply opamp? >> >> >> >> thanks! > >I think I have an idea.... I would have to figure out my thresholds and float my opamp so that the positive feedback voltage divider gives me the thresholds I need...
There you go.
> >So, if I want my high threshold at 2V and low at 1V then (assuming my divider splits my voltage in half) I'd need my high opamp rail at 4V and my low rail at 2V... so I'd have to make sure my opamp works off of 2V and my input signal never goes beyond my rails... > >???????
But why are you using an OpAmp? That only guarantees slow transitions. ...Jim Thompson -- | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
panfilero wrote:
> I see circuits that add hysteresis to op-amp comparators by putting a positive feedback resistor network that acts as a voltage divider to the output. > > Am I right in thinking that this will only work if you have a negative rail? If your negative rail is grounded this aint gonna give you hysteresis... is there a way this would work with a single supply opamp? > > thanks!
Yes, it works the same way. You need to put a virtual common node at the (+) input when operating single rail. This feed back R is calculated working with this virtual network so that you can select the hysteresis window. Jamie
On Fri, 31 Aug 2012 08:17:54 -0700, panfilero wrote:

> I see circuits that add hysteresis to op-amp comparators by putting a > positive feedback resistor network that acts as a voltage divider to the > output. > > Am I right in thinking that this will only work if you have a negative > rail? If your negative rail is grounded this aint gonna give you > hysteresis... is there a way this would work with a single supply opamp?
You don't need a negative rail. Just having an output that swings from one rail to another is enough to provide hysteresis with one of those networks. Do the math, it'll jump out at you. Note that using an op-amp for a comparator can lead to all sorts of subtle or not-so-subtle misbehaviors. In general, op-amps don't like operating in regimes where they aren't working in the linear region. Some op-amps show this with such mild misbehaviors as taking extra-long for the output to come off the rail, or not approaching the power rails in an easily predictable manner. Other's get nasty in various ways (I don't know the whole catalog, but oscillation, high input currents, and (I think) phase shift are all on the list). Using a comparator for a comparator is often better. -- My liberal friends think I'm a conservative kook. My conservative friends think I'm a liberal kook. Why am I not happy that they have found common ground? Tim Wescott, Communications, Control, Circuits & Software http://www.wescottdesign.com
On Friday, August 31, 2012 12:48:54 PM UTC-5, Tim Wescott wrote:
> On Fri, 31 Aug 2012 08:17:54 -0700, panfilero wrote: >=20 >=20 >=20 > > I see circuits that add hysteresis to op-amp comparators by putting a >=20 > > positive feedback resistor network that acts as a voltage divider to th=
e
>=20 > > output. >=20 > >=20 >=20 > > Am I right in thinking that this will only work if you have a negative >=20 > > rail? If your negative rail is grounded this aint gonna give you >=20 > > hysteresis... is there a way this would work with a single supply opamp=
?
>=20 >=20 >=20 > You don't need a negative rail. Just having an output that swings from=
=20
>=20 > one rail to another is enough to provide hysteresis with one of those=20 >=20 > networks. Do the math, it'll jump out at you. >=20 >=20 >=20 > Note that using an op-amp for a comparator can lead to all sorts of=20 >=20 > subtle or not-so-subtle misbehaviors. In general, op-amps don't like=20 >=20 > operating in regimes where they aren't working in the linear region. =20 >=20 > Some op-amps show this with such mild misbehaviors as taking extra-long=
=20
>=20 > for the output to come off the rail, or not approaching the power rails=
=20
>=20 > in an easily predictable manner. Other's get nasty in various ways (I=20 >=20 > don't know the whole catalog, but oscillation, high input currents, and=
=20
>=20 > (I think) phase shift are all on the list). >=20 >=20 >=20 > Using a comparator for a comparator is often better. >=20 >=20 >=20 > --=20 >=20 > My liberal friends think I'm a conservative kook. >=20 > My conservative friends think I'm a liberal kook. >=20 > Why am I not happy that they have found common ground? >=20 >=20 >=20 > Tim Wescott, Communications, Control, Circuits & Software >=20 > http://www.wescottdesign.com
I went with an OpAmp out of convenience, and because what I'm looking at is= a really slow signal which, basically DC, it would rise and fall real slow= ly... I'm not sure if using a comparator buys anything when your not concer= ned about speed... maybe it does, I don't know, I'm all ears though, and I'= m gonna dig into it some more...
On Aug 31, 3:08=A0pm, panfilero <panfil...@gmail.com> wrote:
> On Friday, August 31, 2012 12:48:54 PM UTC-5, Tim Wescott wrote: > > On Fri, 31 Aug 2012 08:17:54 -0700, panfilero wrote: > > > > I see circuits that add hysteresis to op-amp comparators by putting a > > > > positive feedback resistor network that acts as a voltage divider to =
the
> > > > output. > > > > Am I right in thinking that this will only work if you have a negativ=
e
> > > > rail? If your negative rail is grounded this aint gonna give you > > > > hysteresis... is there a way this would work with a single supply opa=
mp?
> > > You don't need a negative rail. =A0Just having an output that swings fr=
om
> > > one rail to another is enough to provide hysteresis with one of those > > > networks. =A0Do the math, it'll jump out at you. > > > Note that using an op-amp for a comparator can lead to all sorts of > > > subtle or not-so-subtle misbehaviors. =A0In general, op-amps don't like > > > operating in regimes where they aren't working in the linear region. > > > Some op-amps show this with such mild misbehaviors as taking extra-long > > > for the output to come off the rail, or not approaching the power rails > > > in an easily predictable manner. =A0Other's get nasty in various ways (=
I
> > > don't know the whole catalog, but oscillation, high input currents, and > > > (I think) phase shift are all on the list). > > > Using a comparator for a comparator is often better. > > > -- > > > My liberal friends think I'm a conservative kook. > > > My conservative friends think I'm a liberal kook. > > > Why am I not happy that they have found common ground? > > > Tim Wescott, Communications, Control, Circuits & Software > > >http://www.wescottdesign.com > > I went with an OpAmp out of convenience, and because what I'm looking at =
is a really slow signal which, basically DC, it would rise and fall real sl= owly... I'm not sure if using a comparator buys anything when your not conc= erned about speed... maybe it does, I don't know, I'm all ears though, and = I'm gonna dig into it some more...- Hide quoted text -
> > - Show quoted text -
Everyone should have a few LM393's in their parts box. I sometimes find a comparator to be too fast, but you can hang a capacitor on the output to slow it down.... nice linear ramps from one rail to the other. George H. (for a fast 'twichy' comparator I like the LT1016)
On Fri, 31 Aug 2012 12:26:40 -0700 (PDT), George Herold
<gherold@teachspin.com> wrote:

>On Aug 31, 3:08&#2013266080;pm, panfilero <panfil...@gmail.com> wrote: >> On Friday, August 31, 2012 12:48:54 PM UTC-5, Tim Wescott wrote: >> > On Fri, 31 Aug 2012 08:17:54 -0700, panfilero wrote: >> >> > > I see circuits that add hysteresis to op-amp comparators by putting a >> >> > > positive feedback resistor network that acts as a voltage divider to the >> >> > > output. >> >> > > Am I right in thinking that this will only work if you have a negative >> >> > > rail? If your negative rail is grounded this aint gonna give you >> >> > > hysteresis... is there a way this would work with a single supply opamp? >> >> > You don't need a negative rail. &#2013266080;Just having an output that swings from >> >> > one rail to another is enough to provide hysteresis with one of those >> >> > networks. &#2013266080;Do the math, it'll jump out at you. >> >> > Note that using an op-amp for a comparator can lead to all sorts of >> >> > subtle or not-so-subtle misbehaviors. &#2013266080;In general, op-amps don't like >> >> > operating in regimes where they aren't working in the linear region. >> >> > Some op-amps show this with such mild misbehaviors as taking extra-long >> >> > for the output to come off the rail, or not approaching the power rails >> >> > in an easily predictable manner. &#2013266080;Other's get nasty in various ways (I >> >> > don't know the whole catalog, but oscillation, high input currents, and >> >> > (I think) phase shift are all on the list). >> >> > Using a comparator for a comparator is often better. >> >> > -- >> >> > My liberal friends think I'm a conservative kook. >> >> > My conservative friends think I'm a liberal kook. >> >> > Why am I not happy that they have found common ground? >> >> > Tim Wescott, Communications, Control, Circuits & Software >> >> >http://www.wescottdesign.com >> >> I went with an OpAmp out of convenience, and because what I'm looking at is a really slow signal which, basically DC, it would rise and fall real slowly... I'm not sure if using a comparator buys anything when your not concerned about speed... maybe it does, I don't know, I'm all ears though, and I'm gonna dig into it some more...- Hide quoted text - >>
Comparitors have outputs that are designed more like gates than linear devices. Opamps may not be well behaved when their outputs are driven hard into the rails. They're also not designed to have a differential voltage on the input. Using opamps as comparators can be done but it's not recommended.
>Everyone should have a few LM393's in their parts box. I sometimes >find a comparator to be too fast, but you can hang a capacitor on the >output to slow it down.... nice linear ramps from one rail to the >other.
If you drive a capacitor, watch the output current.
>George H. > >(for a fast 'twichy' comparator I like the LT1016)
Your boss must be filthy rich. ..or perhaps dirt poor, after buying LT stuff. ;-)
On Aug 31, 5:46=A0pm, "k...@att.bizzzzzzzzzzzz"
<k...@att.bizzzzzzzzzzzz> wrote:
> On Fri, 31 Aug 2012 12:26:40 -0700 (PDT), George Herold > > > > > > <gher...@teachspin.com> wrote: > >On Aug 31, 3:08=A0pm, panfilero <panfil...@gmail.com> wrote: > >> On Friday, August 31, 2012 12:48:54 PM UTC-5, Tim Wescott wrote: > >> > On Fri, 31 Aug 2012 08:17:54 -0700, panfilero wrote: > > >> > > I see circuits that add hysteresis to op-amp comparators by puttin=
g a
> > >> > > positive feedback resistor network that acts as a voltage divider =
to the
> > >> > > output. > > >> > > Am I right in thinking that this will only work if you have a nega=
tive
> > >> > > rail? If your negative rail is grounded this aint gonna give you > > >> > > hysteresis... is there a way this would work with a single supply =
opamp?
> > >> > You don't need a negative rail. =A0Just having an output that swings=
from
> > >> > one rail to another is enough to provide hysteresis with one of thos=
e
> > >> > networks. =A0Do the math, it'll jump out at you. > > >> > Note that using an op-amp for a comparator can lead to all sorts of > > >> > subtle or not-so-subtle misbehaviors. =A0In general, op-amps don't l=
ike
> > >> > operating in regimes where they aren't working in the linear region. > > >> > Some op-amps show this with such mild misbehaviors as taking extra-l=
ong
> > >> > for the output to come off the rail, or not approaching the power ra=
ils
> > >> > in an easily predictable manner. =A0Other's get nasty in various way=
s (I
> > >> > don't know the whole catalog, but oscillation, high input currents, =
and
> > >> > (I think) phase shift are all on the list). > > >> > Using a comparator for a comparator is often better. > > >> > -- > > >> > My liberal friends think I'm a conservative kook. > > >> > My conservative friends think I'm a liberal kook. > > >> > Why am I not happy that they have found common ground? > > >> > Tim Wescott, Communications, Control, Circuits & Software > > >> >http://www.wescottdesign.com > > >> I went with an OpAmp out of convenience, and because what I'm looking =
at is a really slow signal which, basically DC, it would rise and fall real= slowly... I'm not sure if using a comparator buys anything when your not c= oncerned about speed... maybe it does, I don't know, I'm all ears though, a= nd I'm gonna dig into it some more...- Hide quoted text -
> > Comparitors have outputs that are designed more like gates than linear > devices. =A0Opamps may not be well behaved when their outputs are driven =
hard
> into the rails. =A0They're also not designed to have a differential volta=
ge on
> the input. =A0Using opamps as comparators can be done but it's not recomm=
ended.
> > >Everyone should have a few LM393's in their parts box. =A0I sometimes > >find a comparator to be too fast, but you can hang a capacitor on the > >output to slow it down.... nice linear ramps from one rail to the > >other. > > If you drive a capacitor, watch the output current. > > >George H. > > >(for a fast 'twichy' comparator I like the LT1016) > > Your boss must be filthy rich. =A0 ..or perhaps dirt poor, after buying L=
T
> stuff. =A0;-)- Hide quoted text -
Nah, not much quantity so saving a few bucks is not worth my time. (the \$3 comparator with a \$3 opamp replaced a ~\$100 (?) Amp-tek part. so my boss is happy.) George H.
> > - Show quoted text -