Shop OBEX P1 Docs P2 Docs Learn Events
DC Voltage Filter — Parallax Forums

DC Voltage Filter

ArchiverArchiver Posts: 46,084
edited 2001-12-24 19:39 in General Discussion
I have a sensor (air flow) that generates a signal from 0 to 5 volts
dc. I am looking for an op amp (or other simple) circuit that will
essentially act as a voltage follower, but which will not let the
voltage drop below a preset minumum, such as .5 volts. Ideally, the
minimum would be adjustable via a pot. In other words, I want a
circuit that produces a signal that mirrors the input, except that
the output should never fall below a set minimum even if the input
does. Any ideas?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-12-14 01:46
    >I have a sensor (air flow) that generates a signal from 0 to 5 volts
    >dc. I am looking for an op amp (or other simple) circuit that will
    >essentially act as a voltage follower, but which will not let the
    >voltage drop below a preset minumum, such as .5 volts. Ideally, the
    >minimum would be adjustable via a pot. In other words, I want a
    >circuit that produces a signal that mirrors the input, except that
    >the output should never fall below a set minimum even if the input
    >does. Any ideas?


    I've not built this circuit, but I think it should work (famous last
    words). View with monospace font.

    |\
    input-|+\ 1N4148
    | >-->|---;
    ;--|-/ |
    | |/ o
    output
    | |
    `--/\/\
    o
    100k |
    100k |
    ;--/\/\
    o
    | | 10k
    | |\ o-/\/\-common
    `--|-\ |
    | >-->|---'
    0.5V--|+/ 1N4248
    |/
    dual op-amp
    LM358 or LT1078

    This is like gating two signals with diodes to select the largest:

    input1 --->|---;
    |
    o--- output
    |
    input2 --->|---o-/\/\- common

    The output is the higher of the two input voltages, except there is a
    diode drop in series with each signal. The op-amp circuit puts the
    diodes in the feedback loops, so the output should clamp right at 0.5
    volts, that is, pick whichever input is the higher voltage.

    -- regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-14 16:36
    couldnt you use a voltage follower - (no gain opamp)- then use the dc
    offset terminals to dial in the offset.

    If the op-amp doesnt have offset terminals then make a voltage divider bias
    the input terminals ?



    richard




    Original Message
    From: "tomatlarge" <tomatlarge@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, December 13, 2001 2:16 PM
    Subject: [noparse][[/noparse]basicstamps] DC Voltage Filter


    > I have a sensor (air flow) that generates a signal from 0 to 5 volts
    > dc. I am looking for an op amp (or other simple) circuit that will
    > essentially act as a voltage follower, but which will not let the
    > voltage drop below a preset minumum, such as .5 volts. Ideally, the
    > minimum would be adjustable via a pot. In other words, I want a
    > circuit that produces a signal that mirrors the input, except that
    > the output should never fall below a set minimum even if the input
    > does. Any ideas?
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-14 18:09
    Richard,

    Thanks for your note. That all sounds good, but I'm just a hobbiest
    (with mostly digital projects under my belt) and need some serious
    hand-holding (i.e., a circuit diagram with part numbers). I'm told
    that national has an op amp data sheet with this exact circuit, but
    have not been able to find it. The circuit just replicates the input
    voltage, without letting the output drop below a preset minimum
    voltage.

    --- In basicstamps@y..., "Richard Friedrich" <rfriedrich@a...> wrote:
    > couldnt you use a voltage follower - (no gain opamp)- then use
    the dc
    > offset terminals to dial in the offset.
    >
    > If the op-amp doesnt have offset terminals then make a voltage
    divider bias
    > the input terminals ?
    >
    >
    >
    > richard
    >
    >
    >
    >
    >
    Original Message
    > From: "tomatlarge" <tomatlarge@y...>
    > To: <basicstamps@y...>
    > Sent: Thursday, December 13, 2001 2:16 PM
    > Subject: [noparse][[/noparse]basicstamps] DC Voltage Filter
    >
    >
    > > I have a sensor (air flow) that generates a signal from 0 to 5
    volts
    > > dc. I am looking for an op amp (or other simple) circuit that will
    > > essentially act as a voltage follower, but which will not let the
    > > voltage drop below a preset minumum, such as .5 volts. Ideally,
    the
    > > minimum would be adjustable via a pot. In other words, I want a
    > > circuit that produces a signal that mirrors the input, except that
    > > the output should never fall below a set minimum even if the input
    > > does. Any ideas?
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > > from the same email address that you subscribed. Text in the
    Subject and
    > Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-16 19:17
    Tracy,

    Many thanks for this. (Couldn't format it for a while, then "saw" the
    picture when I hit reply...go figure.) I will try this out and let
    you know how it works. What is the defference between the two diodes?

    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >I have a sensor (air flow) that generates a signal from 0 to 5
    volts
    > >dc. I am looking for an op amp (or other simple) circuit that will
    > >essentially act as a voltage follower, but which will not let the
    > >voltage drop below a preset minumum, such as .5 volts. Ideally, the
    > >minimum would be adjustable via a pot. In other words, I want a
    > >circuit that produces a signal that mirrors the input, except that
    > >the output should never fall below a set minimum even if the input
    > >does. Any ideas?
    >
    >
    > I've not built this circuit, but I think it should work (famous
    last
    > words). View with monospace font.
    >
    > |\
    > input-|+\ 1N4148
    > | >-->|---;
    > ;--|-/ |
    > | |/ o
    output
    > | |
    > `--/\/\
    o
    > 100k |
    > 100k |
    > ;--/\/\
    o
    > | | 10k
    > | |\ o-/\/\-common
    > `--|-\ |
    > | >-->|---'
    > 0.5V--|+/ 1N4248
    > |/
    > dual op-amp
    > LM358 or LT1078
    >
    > This is like gating two signals with diodes to select the largest:
    >
    > input1 --->|---;
    > |
    > o--- output
    > |
    > input2 --->|---o-/\/\- common
    >
    > The output is the higher of the two input voltages, except there is
    a
    > diode drop in series with each signal. The op-amp circuit puts the
    > diodes in the feedback loops, so the output should clamp right at
    0.5
    > volts, that is, pick whichever input is the higher voltage.
    >
    > -- regards
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-16 20:26
    I'm guessing that was a typo. A 1N4148 or 1N914 should be OK in both
    spots (and Tracy will correct me if I'm wrong).

    Al Williams
    AWC
    * 8 channels of PWM
    http://www.al-williams.com/awce/pak5.htm

    >
    Original Message
    > From: tomatlarge [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=CFwz0Im3G_8SCE27j8XbviT6l1uJJ14vVNXt2mDKbchAtdZfWS6ykq1mcHSaixD6OpG-CBK3PL1mCuMnxTs3]tomatlarge@y...[/url
    > Sent: Sunday, December 16, 2001 1:18 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: DC Voltage Filter
    >
    >
    > Tracy,
    >
    > Many thanks for this. (Couldn't format it for a while, then "saw" the
    > picture when I hit reply...go figure.) I will try this out and let
    > you know how it works. What is the defference between the two diodes?
    >
    > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > >I have a sensor (air flow) that generates a signal from 0 to 5
    > volts
    > > >dc. I am looking for an op amp (or other simple) circuit that will
    > > >essentially act as a voltage follower, but which will not let the
    > > >voltage drop below a preset minumum, such as .5 volts.
    > Ideally, the
    > > >minimum would be adjustable via a pot. In other words, I want a
    > > >circuit that produces a signal that mirrors the input, except that
    > > >the output should never fall below a set minimum even if the input
    > > >does. Any ideas?
    > >
    > >
    > > I've not built this circuit, but I think it should work (famous
    > last
    > > words). View with monospace font.
    > >
    > > |\
    > > input-|+\ 1N4148
    > > | >-->|---;
    > > ;--|-/ |
    > > | |/ o
    output
    > > | |
    > > `--/\/\
    o
    > > 100k |
    > > 100k |
    > > ;--/\/\
    o
    > > | | 10k
    > > | |\ o-/\/\-common
    > > `--|-\ |
    > > | >-->|---'
    > > 0.5V--|+/ 1N4248
    > > |/
    > > dual op-amp
    > > LM358 or LT1078
    > >
    > > This is like gating two signals with diodes to select the largest:
    > >
    > > input1 --->|---;
    > > |
    > > o--- output
    > > |
    > > input2 --->|---o-/\/\- common
    > >
    > > The output is the higher of the two input voltages, except there is
    > a
    > > diode drop in series with each signal. The op-amp circuit puts the
    > > diodes in the feedback loops, so the output should clamp right at
    > 0.5
    > > volts, that is, pick whichever input is the higher voltage.
    > >
    > > -- regards
    > > Tracy Allen
    > > electronically monitored ecosystems
    > > http://www.emesystems.com
    > > mailto:tracy@e...
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-17 03:03
    Ah yes, a typo. Just about any small diode will work fine there.
    You already have the LM358 op amp, so use that, and as you discovered
    in "voltage follower mystery", you get the best results when you run
    it on a 9 volt power supply (to pins 4[noparse][[/noparse]-] and 8[noparse][[/noparse]+]).



    >I'm guessing that was a typo. A 1N4148 or 1N914 should be OK in both
    >spots (and Tracy will correct me if I'm wrong).
    >
    >Al Williams
    >AWC
    >* 8 channels of PWM
    >http://www.al-williams.com/awce/pak5.htm
    >
    > >
    Original Message
    > > From: tomatlarge [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=8lDVZ7Xoz8lhsfQPKMRuri0nNvAVd47yvah8bWdSp5nYl-FzDjf4YufwaxljhvMxx1Jpf4K2IUdH59FybYA]tomatlarge@y...[/url
    > > Sent: Sunday, December 16, 2001 1:18 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] Re: DC Voltage Filter
    > >
    > >
    > > Tracy,
    > >
    > > Many thanks for this. (Couldn't format it for a while, then "saw" the
    > > picture when I hit reply...go figure.) I will try this out and let
    > > you know how it works. What is the defference between the two diodes?
    > >
    > > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > > >I have a sensor (air flow) that generates a signal from 0 to 5
    > > volts
    > > > >dc. I am looking for an op amp (or other simple) circuit that will
    > > > >essentially act as a voltage follower, but which will not let the
    > > > >voltage drop below a preset minumum, such as .5 volts.
    > > Ideally, the
    > > > >minimum would be adjustable via a pot. In other words, I want a
    > > > >circuit that produces a signal that mirrors the input, except that
    > > > >the output should never fall below a set minimum even if the input
    > > > >does. Any ideas?
    > > >
    > > >
    > > > I've not built this circuit, but I think it should work (famous
    > > last
    > > > words). View with monospace font.
    > > >
    > > > |\
    > > > input-|+\ 1N4148
    > > > | >-->|---;
    > > > ;--|-/ |
    > > > | |/ o
    output
    > > > | |
    > > > `--/\/\
    o
    > > > 100k |
    > > > 100k |
    > > > ;--/\/\
    o
    > > > | | 10k
    > > > | |\ o-/\/\-common
    > > > `--|-\ |
    > > > | >-->|---'
    > > > 0.5V--|+/ 1N4248
    > > > |/
    > > > dual op-amp
    > > > LM358 or LT1078
    > > >
    > > > This is like gating two signals with diodes to select the largest:
    > > >
    > > > input1 --->|---;
    > > > |
    > > > o--- output
    > > > |
    > > > input2 --->|---o-/\/\- common
    > > >
    > > > The output is the higher of the two input voltages, except there is
    > > a
    > > > diode drop in series with each signal. The op-amp circuit puts the
    > > > diodes in the feedback loops, so the output should clamp right at
    > > 0.5
    > > > volts, that is, pick whichever input is the higher voltage.
    > > >
    > > > -- regards
    > > > Tracy Allen
    > > > electronically monitored ecosystems
    > > > http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-20 23:32
    Tracy,

    I finally tried to breadboard this circuit yesterday and had curious
    results. It seemed to work, but only to a point. When I set the input
    voltage very low (like .08 volts, using a pot to step down 5 volts),
    this circuit would maintain a higher minimum, like .2 volts. Above
    that it seemed to track the input voltage perfectly. Should this
    circuit work even with low input voltages? If so, any guess what I'm
    doing wrong?

    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > Ah yes, a typo. Just about any small diode will work fine there.
    > You already have the LM358 op amp, so use that, and as you
    discovered
    > in "voltage follower mystery", you get the best results when you
    run
    > it on a 9 volt power supply (to pins 4[noparse][[/noparse]-] and 8[noparse][[/noparse]+]).
    >
    >
    >
    > >I'm guessing that was a typo. A 1N4148 or 1N914 should be OK in
    both
    > >spots (and Tracy will correct me if I'm wrong).
    > >
    > >Al Williams
    > >AWC
    > >* 8 channels of PWM
    > >http://www.al-williams.com/awce/pak5.htm
    > >
    > > >
    Original Message
    > > > From: tomatlarge [noparse][[/noparse]mailto:tomatlarge@y...]
    > > > Sent: Sunday, December 16, 2001 1:18 PM
    > > > To: basicstamps@y...
    > > > Subject: [noparse][[/noparse]basicstamps] Re: DC Voltage Filter
    > > >
    > > >
    > > > Tracy,
    > > >
    > > > Many thanks for this. (Couldn't format it for a while,
    then "saw" the
    > > > picture when I hit reply...go figure.) I will try this out and
    let
    > > > you know how it works. What is the defference between the two
    diodes?
    > > >
    > > > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > > > >I have a sensor (air flow) that generates a signal from 0 to
    5
    > > > volts
    > > > > >dc. I am looking for an op amp (or other simple) circuit
    that will
    > > > > >essentially act as a voltage follower, but which will not
    let the
    > > > > >voltage drop below a preset minumum, such as .5 volts.
    > > > Ideally, the
    > > > > >minimum would be adjustable via a pot. In other words, I
    want a
    > > > > >circuit that produces a signal that mirrors the input,
    except that
    > > > > >the output should never fall below a set minimum even if the
    input
    > > > > >does. Any ideas?
    > > > >
    > > > >
    > > > > I've not built this circuit, but I think it should work
    (famous
    > > > last
    > > > > words). View with monospace font.
    > > > >
    > > > > |\
    > > > > input-|+\ 1N4148
    > > > > | >-->|---;
    > > > > ;--|-/ |
    > > > > | |/ o
    output
    > > > > | |
    > > > > `--/\/\
    o
    > > > > 100k |
    > > > > 100k |
    > > > > ;--/\/\
    o
    > > > > | | 10k
    > > > > | |\ o-/\/\-common
    > > > > `--|-\ |
    > > > > | >-->|---'
    > > > > 0.5V--|+/ 1N4248
    > > > > |/
    > > > > dual op-amp
    > > > > LM358 or LT1078
    > > > >
    > > > > This is like gating two signals with diodes to select the
    largest:
    > > > >
    > > > > input1 --->|---;
    > > > > |
    > > > > o--- output
    > > > > |
    > > > > input2 --->|---o-/\/\- common
    > > > >
    > > > > The output is the higher of the two input voltages, except
    there is
    > > > a
    > > > > diode drop in series with each signal. The op-amp circuit
    puts the
    > > > > diodes in the feedback loops, so the output should clamp
    right at
    > > > 0.5
    > > > > volts, that is, pick whichever input is the higher voltage.
    > > > >
    > > > > -- regards
    > > > > Tracy Allen
    > > > > electronically monitored ecosystems
    > > > > http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-20 23:45
    For tom at large

    I'm not as ssmart as Tracy but my guess is that the device you are using
    bottoms out at .s volts. Chips will not go to 0 volts. If you need to go to
    0 for a readout, use a bucking voltage ciruit in series with a 10K pot to
    force the output to 0.

    Sid
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-21 02:00
    Hi tomate

    Be sure you have the 10k pulldown resistor to common at the output.
    I quickly built the circuit myself with pots on both inputs and an
    LM358, and it worked as advertised down to less than one millivolt on
    either input. That is, the output is equal to whichever input is
    higher. What do you have the output hooked up to?

    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...




    >Tracy,
    >
    >I finally tried to breadboard this circuit yesterday and had curious
    >results. It seemed to work, but only to a point. When I set the input
    >voltage very low (like .08 volts, using a pot to step down 5 volts),
    >this circuit would maintain a higher minimum, like .2 volts. Above
    >that it seemed to track the input voltage perfectly. Should this
    >circuit work even with low input voltages? If so, any guess what I'm
    >doing wrong?
    >
    > > > > > words). View with monospace font.
    >> > > >
    >> > > > |\
    >> > > > input-|+\ 1N4148
    >> > > > | >-->|---;
    >> > > > ;--|-/ |
    >> > > > | |/ o
    output
    >> > > > | |
    >> > > > `--/\/\
    o
    >> > > > 100k |
    >> > > > 100k |
    >> > > > ;--/\/\
    o
    >> > > > | | 10k
    >> > > > | |\ o-/\/\-common
    >> > > > `--|-\ |
    >> > > > | >-->|---'
    >> > > > 0.5V--|+/ 1N4248
    >> > > > |/
    >> > > > dual op-amp
    > > > > > LM358 or LT1078
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-21 03:07
    I had planned to use a 10k resistor before putting the circuit in
    action (it feeds a voltage to a 8051-based controller), but for
    testing purposes, I just put a volt meter on the output pin. Of
    course, I did this on my lap while watching TV, so maybe I need to
    try again?

    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > Hi tomate
    >
    > Be sure you have the 10k pulldown resistor to common at the output.
    > I quickly built the circuit myself with pots on both inputs and an
    > LM358, and it worked as advertised down to less than one millivolt
    on
    > either input. That is, the output is equal to whichever input is
    > higher. What do you have the output hooked up to?
    >
    > -- best regards
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
    >
    >
    >
    >
    > >Tracy,
    > >
    > >I finally tried to breadboard this circuit yesterday and had
    curious
    > >results. It seemed to work, but only to a point. When I set the
    input
    > >voltage very low (like .08 volts, using a pot to step down 5
    volts),
    > >this circuit would maintain a higher minimum, like .2 volts. Above
    > >that it seemed to track the input voltage perfectly. Should this
    > >circuit work even with low input voltages? If so, any guess what
    I'm
    > >doing wrong?
    > >
    > > > > > > words). View with monospace font.
    > >> > > >
    > >> > > > |\
    > >> > > > input-|+\ 1N4148
    > >> > > > | >-->|---;
    > >> > > > ;--|-/ |
    > >> > > > | |/ o
    output
    > >> > > > | |
    > >> > > > `--/\/\
    o
    > >> > > > 100k |
    > >> > > > 100k |
    > >> > > > ;--/\/\
    o
    > >> > > > | | 10k
    > >> > > > | |\ o-/\/\-common
    > >> > > > `--|-\ |
    > >> > > > | >-->|---'
    > >> > > > 0.5V--|+/ 1N4248
    > >> > > > |/
    > >> > > > dual op-amp
    > > > > > > LM358 or LT1078
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-21 05:41
    ok, It almost works almost perfectly now, except the output is
    about .2volts lower than the input. I just realized I've been using
    1megohm resistors instead of 100k (and don't have 100k handy). Would
    that explain it? Thanks again for your help.

    --- In basicstamps@y..., "tomatlarge" <tomatlarge@y...> wrote:
    > I had planned to use a 10k resistor before putting the circuit in
    > action (it feeds a voltage to a 8051-based controller), but for
    > testing purposes, I just put a volt meter on the output pin. Of
    > course, I did this on my lap while watching TV, so maybe I need to
    > try again?
    >
    > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > Hi tomate
    > >
    > > Be sure you have the 10k pulldown resistor to common at the
    output.
    > > I quickly built the circuit myself with pots on both inputs and
    an
    > > LM358, and it worked as advertised down to less than one
    millivolt
    > on
    > > either input. That is, the output is equal to whichever input is
    > > higher. What do you have the output hooked up to?
    > >
    > > -- best regards
    > > Tracy Allen
    > > electronically monitored ecosystems
    > > http://www.emesystems.com
    > > mailto:tracy@e...
    > >
    > >
    > >
    > >
    > > >Tracy,
    > > >
    > > >I finally tried to breadboard this circuit yesterday and had
    > curious
    > > >results. It seemed to work, but only to a point. When I set the
    > input
    > > >voltage very low (like .08 volts, using a pot to step down 5
    > volts),
    > > >this circuit would maintain a higher minimum, like .2 volts.
    Above
    > > >that it seemed to track the input voltage perfectly. Should this
    > > >circuit work even with low input voltages? If so, any guess what
    > I'm
    > > >doing wrong?
    > > >
    > > > > > > > words). View with monospace font.
    > > >> > > >
    > > >> > > > |\
    > > >> > > > input-|+\ 1N4148
    > > >> > > > | >-->|---;
    > > >> > > > ;--|-/ |
    > > >> > > > | |/ o
    output
    > > >> > > > | |
    > > >> > > > `--/\/\
    o
    > > >> > > > 100k |
    > > >> > > > 100k |
    > > >> > > > ;--/\/\
    o
    > > >> > > > | | 10k
    > > >> > > > | |\ o-/\/\-common
    > > >> > > > `--|-\ |
    > > >> > > > | >-->|---'
    > > >> > > > 0.5V--|+/ 1N4248
    > > >> > > > |/
    > > >> > > > dual op-amp
    > > > > > > > LM358 or LT1078
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-21 07:01
    Hi tom

    The 1M resistors might explain it, but 0.2 volt seems high even so.
    The op-amp bias current has to flow through the resistor. That is
    one reason it has to have the 10kohm pulldown resistor on the output.
    The bias current has to find a path to ground. If you have some more
    10k resistors, you could substitute those where you have the 1Mohms
    now. Come to think of it, the circuit should even work fine with zero
    ohms in that feedback path:

    Output equals highest of two inputs.
    |\
    input1 -|+\ 1N4148
    | >-->|---;
    ;--|-/ |
    | |/ o
    output
    | |
    `
    o
    |
    |
    ;
    o
    | | 10k
    | |\ o-/\/\-common
    `--|-\ |
    | >-->|---'
    input2 -|+/ 1N4148
    |/
    dual op-amp
    LM358, pin 4 to Vss, pin 8 to +9 volts.


    You should expect the input and the output to be within 1 or 2
    millivolts of one another at worst. It goes without saying, check
    the wiring. What kind of voltmeter do you have (high input
    impedance)? And where do your input voltages come from? In my
    version I am getting the two input voltages from the wipers of 10kohm
    pots connected across 5 volts.

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com


    >ok, It almost works almost perfectly now, except the output is
    >about .2volts lower than the input. I just realized I've been using
    >1megohm resistors instead of 100k (and don't have 100k handy). Would
    >that explain it? Thanks again for your help.
    >
    >--- In basicstamps@y..., "tomatlarge" <tomatlarge@y...> wrote:
    > > I had planned to use a 10k resistor before putting the circuit in
    > > action (it feeds a voltage to a 8051-based controller), but for
    > > testing purposes, I just put a volt meter on the output pin. Of
    > > course, I did this on my lap while watching TV, so maybe I need to
    > > try again?
    > >
    > > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > > Hi tomate
    > > >
    > > > Be sure you have the 10k pulldown resistor to common at the
    >output.
    > > > I quickly built the circuit myself with pots on both inputs and
    >an
    > > > LM358, and it worked as advertised down to less than one
    >millivolt
    > > on
    > > > either input. That is, the output is equal to whichever input is
    > > > higher. What do you have the output hooked up to?
    > > >
    > > > -- best regards
    > > > Tracy Allen
    > > > electronically monitored ecosystems
    > > > http://www.emesystems.com
    > > > mailto:tracy@e...
    > > >
    > > >
    > > >
    > > >
    > > > >Tracy,
    > > > >
    > > > >I finally tried to breadboard this circuit yesterday and had
    > > curious
    > > > >results. It seemed to work, but only to a point. When I set the
    > > input
    > > > >voltage very low (like .08 volts, using a pot to step down 5
    > > volts),
    > > > >this circuit would maintain a higher minimum, like .2 volts.
    >Above
    > > > >that it seemed to track the input voltage perfectly. Should this
    > > > >circuit work even with low input voltages? If so, any guess what
    > > I'm
    > > > >doing wrong?
    > > > >
    > > > > > > > > words). View with monospace font.
    > > > >> > > >
    > > > >> > > > |\
    > > > >> > > > input-|+\ 1N4148
    > > > >> > > > | >-->|---;
    > > > >> > > > ;--|-/ |
    > > > >> > > > | |/ o
    output
    > > > >> > > > | |
    > > > >> > > > `--/\/\
    o
    > > > >> > > > 100k |
    > > > >> > > > 100k |
    > > > >> > > > ;--/\/\
    o
    > > > >> > > > | | 10k
    > > > >> > > > | |\ o-/\/\-common
    > > > >> > > > `--|-\ |
    > > > >> > > > | >-->|---'
    > > > >> > > > 0.5V--|+/ 1N4148
    > > > >> > > > |/
    > > > >> > > > dual op-amp
    > > > > > > > > LM358 or LT1078

    Note, I corrected the typo on the schematic: both diodes are 1N4148.
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-21 08:44
    Tracy, you are a genius. Thank you soooo much. It works like a champ
    without the resistors. (A regulated power supply also helped!) I'll
    let you know once I get my project going to see how it works in the
    field. [noparse]:)[/noparse] Thanks again.

    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > Hi tom
    >
    > The 1M resistors might explain it, but 0.2 volt seems high even so.
    > The op-amp bias current has to flow through the resistor. That is
    > one reason it has to have the 10kohm pulldown resistor on the
    output.
    > The bias current has to find a path to ground. If you have some
    more
    > 10k resistors, you could substitute those where you have the 1Mohms
    > now. Come to think of it, the circuit should even work fine with
    zero
    > ohms in that feedback path:
    >
    > Output equals highest of two inputs.
    > |\
    > input1 -|+\ 1N4148
    > | >-->|---;
    > ;--|-/ |
    > | |/ o
    output
    > | |
    > `
    o
    > |
    > |
    > ;
    o
    > | | 10k
    > | |\ o-/\/\-common
    > `--|-\ |
    > | >-->|---'
    > input2 -|+/ 1N4148
    > |/
    > dual op-amp
    > LM358, pin 4 to Vss, pin 8 to +9 volts.
    >
    >
    > You should expect the input and the output to be within 1 or 2
    > millivolts of one another at worst. It goes without saying, check
    > the wiring. What kind of voltmeter do you have (high input
    > impedance)? And where do your input voltages come from? In my
    > version I am getting the two input voltages from the wipers of
    10kohm
    > pots connected across 5 volts.
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
    >
    >
    > >ok, It almost works almost perfectly now, except the output is
    > >about .2volts lower than the input. I just realized I've been using
    > >1megohm resistors instead of 100k (and don't have 100k handy).
    Would
    > >that explain it? Thanks again for your help.
    > >
    > >--- In basicstamps@y..., "tomatlarge" <tomatlarge@y...> wrote:
    > > > I had planned to use a 10k resistor before putting the circuit
    in
    > > > action (it feeds a voltage to a 8051-based controller), but for
    > > > testing purposes, I just put a volt meter on the output pin. Of
    > > > course, I did this on my lap while watching TV, so maybe I need
    to
    > > > try again?
    > > >
    > > > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > > > Hi tomate
    > > > >
    > > > > Be sure you have the 10k pulldown resistor to common at the
    > >output.
    > > > > I quickly built the circuit myself with pots on both inputs
    and
    > >an
    > > > > LM358, and it worked as advertised down to less than one
    > >millivolt
    > > > on
    > > > > either input. That is, the output is equal to whichever input
    is
    > > > > higher. What do you have the output hooked up to?
    > > > >
    > > > > -- best regards
    > > > > Tracy Allen
    > > > > electronically monitored ecosystems
    > > > > http://www.emesystems.com
    > > > > mailto:tracy@e...
    > > > >
    > > > >
    > > > >
    > > > >
    > > > > >Tracy,
    > > > > >
    > > > > >I finally tried to breadboard this circuit yesterday and had
    > > > curious
    > > > > >results. It seemed to work, but only to a point. When I set
    the
    > > > input
    > > > > >voltage very low (like .08 volts, using a pot to step down 5
    > > > volts),
    > > > > >this circuit would maintain a higher minimum, like .2 volts.
    > >Above
    > > > > >that it seemed to track the input voltage perfectly. Should
    this
    > > > > >circuit work even with low input voltages? If so, any guess
    what
    > > > I'm
    > > > > >doing wrong?
    > > > > >
    > > > > > > > > > words). View with monospace font.
    > > > > >> > > >
    > > > > >> > > > |\
    > > > > >> > > > input-|+\ 1N4148
    > > > > >> > > > | >-->|---;
    > > > > >> > > > ;--|-/ |
    > > > > >> > > > | |/ o
    output
    > > > > >> > > > | |
    > > > > >> > > > `--/\/\
    o
    > > > > >> > > > 100k |
    > > > > >> > > > 100k |
    > > > > >> > > > ;--/\/\
    o
    > > > > >> > > > | | 10k
    > > > > >> > > > | |\ o-/\/\-common
    > > > > >> > > > `--|-\ |
    > > > > >> > > > | >-->|---'
    > > > > >> > > > 0.5V--|+/ 1N4148
    > > > > >> > > > |/
    > > > > >> > > > dual op-amp
    > > > > > > > > > LM358 or LT1078
    >
    > Note, I corrected the typo on the schematic: both diodes are
    1N4148.
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-21 14:24
    >
    Original Message
    > From: Chris Loiacono [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=qQCN5OqT25jwlHwhrxGs7_P2nkjNUrkY6BaLjVYfgvdf_FL3HcD8dMCtN2dacvFaWqSNGQ0u9FLZlJPQZw]chris@m...[/url
    > Sent: Friday, December 21, 2001 8:41 AM
    > To: 'basicstamps@yahoogroups.com'
    > Subject: RE: [noparse][[/noparse]basicstamps] Re: DC Voltage Filter
    >
    >
    > In fact, if there were a "Stamper of the Year" award based on
    > knowledge and generosity with it, I would have to nominate
    > Tracy. Many others contribute regularly in an unselfish way
    > also and are appreciated as well, and this is one of the
    > things that makes this list so special. I am glad you all let
    > me play too. My thanks to all....
    >
    > >
    > > Tracy, you are a genius. Thank you soooo much. It works
    > like a champ
    > > without the resistors. (A regulated power supply also
    > helped!) I'll
    > > let you know once I get my project going to see how it works in the
    > > field. [noparse]:)[/noparse] Thanks again.
    > >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-22 00:29
    No good deed goes unpunished. I have another question. Now armed with
    my circuit (thanks Tracy), I wanted to take the output voltage and
    send it to an 8051 based controller. I was planning on putting a 10k
    resistor on the output of this circuit, in series, to avoid too much
    current flow. I just looked at the National datasheet for the LM358,
    however, and it shows a circuit for "driving TTL" gates. (Not sure is
    car's computer is TTL or CMOS or ?) That they show is the output
    connected to ground via a 240 ohm resistor and directly to the TTL
    gate without a resistor. Does that make sense? If I did without the
    240 resistor to ground and put a 10k in series between this circuit
    and the 8051-based controller, I'd be ok, no?

    --- In basicstamps@y..., "tomatlarge" <tomatlarge@y...> wrote:
    > Tracy, you are a genius. Thank you soooo much. It works like a
    champ
    > without the resistors. (A regulated power supply also helped!)
    I'll
    > let you know once I get my project going to see how it works in the
    > field. [noparse]:)[/noparse] Thanks again.
    >
    > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > Hi tom
    > >
    > > The 1M resistors might explain it, but 0.2 volt seems high even
    so.
    > > The op-amp bias current has to flow through the resistor. That
    is
    > > one reason it has to have the 10kohm pulldown resistor on the
    > output.
    > > The bias current has to find a path to ground. If you have some
    > more
    > > 10k resistors, you could substitute those where you have the
    1Mohms
    > > now. Come to think of it, the circuit should even work fine with
    > zero
    > > ohms in that feedback path:
    > >
    > > Output equals highest of two inputs.
    > > |\
    > > input1 -|+\ 1N4148
    > > | >-->|---;
    > > ;--|-/ |
    > > | |/ o
    output
    > > | |
    > > `
    o
    > > |
    > > |
    > > ;
    o
    > > | | 10k
    > > | |\ o-/\/\-common
    > > `--|-\ |
    > > | >-->|---'
    > > input2 -|+/ 1N4148
    > > |/
    > > dual op-amp
    > > LM358, pin 4 to Vss, pin 8 to +9 volts.
    > >
    > >
    > > You should expect the input and the output to be within 1 or 2
    > > millivolts of one another at worst. It goes without saying,
    check
    > > the wiring. What kind of voltmeter do you have (high input
    > > impedance)? And where do your input voltages come from? In my
    > > version I am getting the two input voltages from the wipers of
    > 10kohm
    > > pots connected across 5 volts.
    > >
    > > -- regards,
    > > Tracy Allen
    > > electronically monitored ecosystems
    > > mailto:tracy@e...
    > > http://www.emesystems.com
    > >
    > >
    > > >ok, It almost works almost perfectly now, except the output is
    > > >about .2volts lower than the input. I just realized I've been
    using
    > > >1megohm resistors instead of 100k (and don't have 100k handy).
    > Would
    > > >that explain it? Thanks again for your help.
    > > >
    > > >--- In basicstamps@y..., "tomatlarge" <tomatlarge@y...> wrote:
    > > > > I had planned to use a 10k resistor before putting the
    circuit
    > in
    > > > > action (it feeds a voltage to a 8051-based controller), but
    for
    > > > > testing purposes, I just put a volt meter on the output pin.
    Of
    > > > > course, I did this on my lap while watching TV, so maybe I
    need
    > to
    > > > > try again?
    > > > >
    > > > > --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > > > > Hi tomate
    > > > > >
    > > > > > Be sure you have the 10k pulldown resistor to common at the
    > > >output.
    > > > > > I quickly built the circuit myself with pots on both inputs
    > and
    > > >an
    > > > > > LM358, and it worked as advertised down to less than one
    > > >millivolt
    > > > > on
    > > > > > either input. That is, the output is equal to whichever
    input
    > is
    > > > > > higher. What do you have the output hooked up to?
    > > > > >
    > > > > > -- best regards
    > > > > > Tracy Allen
    > > > > > electronically monitored ecosystems
    > > > > > http://www.emesystems.com
    > > > > > mailto:tracy@e...
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > > > >Tracy,
    > > > > > >
    > > > > > >I finally tried to breadboard this circuit yesterday and
    had
    > > > > curious
    > > > > > >results. It seemed to work, but only to a point. When I
    set
    > the
    > > > > input
    > > > > > >voltage very low (like .08 volts, using a pot to step down
    5
    > > > > volts),
    > > > > > >this circuit would maintain a higher minimum, like .2
    volts.
    > > >Above
    > > > > > >that it seemed to track the input voltage perfectly.
    Should
    > this
    > > > > > >circuit work even with low input voltages? If so, any
    guess
    > what
    > > > > I'm
    > > > > > >doing wrong?
    > > > > > >
    > > > > > > > > > > words). View with monospace font.
    > > > > > >> > > >
    > > > > > >> > > > |\
    > > > > > >> > > > input-|+\ 1N4148
    > > > > > >> > > > | >-->|---;
    > > > > > >> > > > ;--|-/ |
    > > > > > >> > > > | |/ o
    output
    > > > > > >> > > > | |
    > > > > > >> > > > `--/\/\
    o
    > > > > > >> > > > 100k |
    > > > > > >> > > > 100k |
    > > > > > >> > > > ;--/\/\
    o
    > > > > > >> > > > | | 10k
    > > > > > >> > > > | |\ o-/\/\-common
    > > > > > >> > > > `--|-\ |
    > > > > > >> > > > | >-->|---'
    > > > > > >> > > > 0.5V--|+/ 1N4148
    > > > > > >> > > > |/
    > > > > > >> > > > dual op-amp
    > > > > > > > > > > LM358 or LT1078
    > >
    > > Note, I corrected the typo on the schematic: both diodes are
    > 1N4148.
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-22 06:45
    >No good deed goes unpunished. I have another question. Now armed with
    >my circuit (thanks Tracy), I wanted to take the output voltage and
    >send it to an 8051 based controller. I was planning on putting a 10k
    >resistor on the output of this circuit, in series, to avoid too much
    >current flow. I just looked at the National datasheet for the LM358,
    >however, and it shows a circuit for "driving TTL" gates. (Not sure is
    >car's computer is TTL or CMOS or ?) That they show is the output
    >connected to ground via a 240 ohm resistor and directly to the TTL
    >gate without a resistor. Does that make sense? If I did without the
    >240 resistor to ground and put a 10k in series between this circuit
    >and the 8051-based controller, I'd be ok, no?

    I'm not clear on the purpose. The goal of the LM358 circuit was to
    provide an analog voltage, so it makes more sense to talk about
    putting that voltage into an analog-to-digital converter (ADC).
    Maybe the controller has one?

    It does not really make sense to talk about interfacing it to TTL or
    CMOS, which are digital logic families. The interface circuit you
    saw in the LM358 data sheet is probably for a comparator, not an
    analog amplifier. And forget about the TTL interface with the 240
    ohm resistor. The original full-fledged TTL is history.

    It _is_ usually wise to put a resistor between the output of one
    circuit and the input of another when they are different modules.
    Doing so can save a lot of grief.

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-22 19:29
    Thanks and sorry to be unclear. My problem is that I am not 100% sure
    what I am connecting the voltage to. [noparse]:)[/noparse] This is for my car. It has
    an air flow meter that generates a signal from 0 to 5, which feeds
    the engine management computer (Bosch DME circa 1983, I'm told based
    on 8051 technology--i.e., a black box) to drive fuel injectors and so
    forth. The black box takes the signal and uses it to generate duty
    cycles for the fuel injectors. More air means higher voltage means
    longer duty cycles and more gas. I know that the engine computer uses
    an EPROM with maps of duty cyles for various conditions. (In addition
    to the signal from our circuit, it looks at engine temp, air
    dentsity, etc.) So, I assume the signal generated by this circuit
    goes to an A/D converter so that the cpu can process it with the
    other information and then pick just the right duty cycle off the
    EPROM maps. SO, I figured a 10k resistor would be prudent, but was a
    little confused by the TTL circuit shown by National. Was TTL dead in
    the early 80's? Either way, I think you are right when you say the
    voltage is not driving digital circuitry anyway (directly).... so it
    sounds like I should stick with the 10k resistor in series and stop
    confusing myself. [noparse]:)[/noparse]


    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >No good deed goes unpunished. I have another question. Now armed
    with
    > >my circuit (thanks Tracy), I wanted to take the output voltage and
    > >send it to an 8051 based controller. I was planning on putting a
    10k
    > >resistor on the output of this circuit, in series, to avoid too
    much
    > >current flow. I just looked at the National datasheet for the
    LM358,
    > >however, and it shows a circuit for "driving TTL" gates. (Not sure
    is
    > >car's computer is TTL or CMOS or ?) That they show is the output
    > >connected to ground via a 240 ohm resistor and directly to the TTL
    > >gate without a resistor. Does that make sense? If I did without the
    > >240 resistor to ground and put a 10k in series between this circuit
    > >and the 8051-based controller, I'd be ok, no?
    >
    > I'm not clear on the purpose. The goal of the LM358 circuit was to
    > provide an analog voltage, so it makes more sense to talk about
    > putting that voltage into an analog-to-digital converter (ADC).
    > Maybe the controller has one?
    >
    > It does not really make sense to talk about interfacing it to TTL
    or
    > CMOS, which are digital logic families. The interface circuit you
    > saw in the LM358 data sheet is probably for a comparator, not an
    > analog amplifier. And forget about the TTL interface with the 240
    > ohm resistor. The original full-fledged TTL is history.
    >
    > It _is_ usually wise to put a resistor between the output of one
    > circuit and the input of another when they are different modules.
    > Doing so can save a lot of grief.
    >
    > -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-22 20:39
    There are people on this list who know a lot about automotive
    electronics (which I don't!) so maybe they will chime in on the topic
    of engine management computers.

    If the signal feeds an ADC in the engine computer, the the ADC
    _probably_ has a high input impedance. But not necessarily. What I
    mean by that is, try it with a 1000 ohm resistor between the output
    of your LM358 circuit and the input to engine computer, and measure
    the voltage on both sides of the resistor (referenced to common). If
    they are the same, then it is okay and prudent to leave the resistor
    in place. If the voltages are different, that means that the ADC
    has a low input impedance, and you should use a lower value of
    resistor, 100 ohms or 10 ohms. When dealing with "black boxes", you
    have to probe the black box characteristics by doing experiments!

    If you were doing this with a Stamp, you would feed the signal into
    an ADC and then write your own formula or lookup table for the duty
    cycle. I recall several projects along that line have appeared here
    on the list.

    >was a little confused by the TTL circuit shown by National. Was TTL
    >dead in the early 80's?

    The circuit: TTL (transistor-transistor-logic) was a relatively
    power hungry logic family, that sat there pulling a milliamp or more
    per gate even when it was not doing anything. The inputs of true TTL
    are "current sinking". What that means is that if you leave the
    input open or tie it through resistor to +5 volts, it acts like a
    HIGH logic level, and little or no current is needed to maintain the
    high level at the input. To bring the input low, you have to short
    circuit it to ground, and in that condition a good fraction of a
    milliamp will flow out of the input pin into ground. That is current
    sinking. If you connect a resistor from the input to ground, there
    is a certain minimum resistance, or else it won't work. It is kind
    of like bringing a telephone off-hook, if you are familiar with that;
    the line has to be brought to a low impedance state. If you put a
    resistor from a true TTL input to ground, the voltage at the input is
    not zero, due to the current flowing through the resistor. If the
    voltage at the input is above about 1.4 volts, the input will be
    interpreted as HIGH instead of LOW.

    Sooooo, the point of the 240 ohm resistor in the LM358 circuit was
    this. The LM358 by itself has a relatively weak output and cannot by
    itself sink quite enough current to turn on a TTL input gate
    reliably. The 240 ohm resistor sinks the extra current needed, when
    the LM358 output is LOW. When the LM358 output is high (as a
    comparator), it pulls the TTL input high, but also wastes a lot of
    current into the 240ohm resistor. A bad compromise. But that is
    history. Although a lot of legacy systems are still out there. It
    has nothing to do with what you are doing.

    There is still an important vestige of TTL in the phrase "TTL logic
    levels". This has to do with the 1.4 volt threshold that is
    interpreted as LOW and HIGH. In modern circuitry the inputs are high
    impedance and do not draw DC currents in either the HIGH or the LOW
    states. It is CMOS circuitry faking TTL logic levels. The BASIC
    Stamp uses TTL logic levels at its inputs, but the Stamp inputs are
    definitely not true TTL. They are high impedance CMOS.

    ADCs usually have quite a high input impedance, but not necessarily.
    Older ones might have a 100kohm or even 10kohm input impedance, in
    which case you can't put a resistor in series without losing some of
    your signal!

    I hope that clears things up some.

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com


    >Thanks and sorry to be unclear. My problem is that I am not 100% sure
    >what I am connecting the voltage to. [noparse]:)[/noparse] This is for my car. It has
    >an air flow meter that generates a signal from 0 to 5, which feeds
    >the engine management computer (Bosch DME circa 1983, I'm told based
    >on 8051 technology--i.e., a black box) to drive fuel injectors and so
    >forth. The black box takes the signal and uses it to generate duty
    >cycles for the fuel injectors. More air means higher voltage means
    >longer duty cycles and more gas. I know that the engine computer uses
    >an EPROM with maps of duty cyles for various conditions. (In addition
    >to the signal from our circuit, it looks at engine temp, air
    >dentsity, etc.) So, I assume the signal generated by this circuit
    >goes to an A/D converter so that the cpu can process it with the
    >other information and then pick just the right duty cycle off the
    >EPROM maps. SO, I figured a 10k resistor would be prudent, but was a
    >little confused by the TTL circuit shown by National. Was TTL dead in
    >the early 80's? Either way, I think you are right when you say the
    >voltage is not driving digital circuitry anyway (directly).... so it
    >sounds like I should stick with the 10k resistor in series and stop
    >confusing myself. [noparse]:)[/noparse]
    >
    >
    >--- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > >No good deed goes unpunished. I have another question. Now armed
    >with
    > > >my circuit (thanks Tracy), I wanted to take the output voltage and
    > > >send it to an 8051 based controller. I was planning on putting a
    >10k
    > > >resistor on the output of this circuit, in series, to avoid too
    >much
    > > >current flow. I just looked at the National datasheet for the
    >LM358,
    > > >however, and it shows a circuit for "driving TTL" gates. (Not sure
    >is
    > > >car's computer is TTL or CMOS or ?) That they show is the output
    > > >connected to ground via a 240 ohm resistor and directly to the TTL
    > > >gate without a resistor. Does that make sense? If I did without the
    > > >240 resistor to ground and put a 10k in series between this circuit
    > > >and the 8051-based controller, I'd be ok, no?
    > >
    > > I'm not clear on the purpose. The goal of the LM358 circuit was to
    > > provide an analog voltage, so it makes more sense to talk about
    > > putting that voltage into an analog-to-digital converter (ADC).
    > > Maybe the controller has one?
    > >
    > > It does not really make sense to talk about interfacing it to TTL
    >or
    > > CMOS, which are digital logic families. The interface circuit you
    > > saw in the LM358 data sheet is probably for a comparator, not an
    > > analog amplifier. And forget about the TTL interface with the 240
    > > ohm resistor. The original full-fledged TTL is history.
    > >
    > > It _is_ usually wise to put a resistor between the output of one
    > > circuit and the input of another when they are different modules.
    > > Doing so can save a lot of grief.
    > >
    > > -- Tracy
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the
    >Subject and Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-23 07:45
    Thanks again Tracy. I guess I am confused by the high impedance
    thing. If the input on the black box is high impedance, why would I
    want a bigger resistor? Is it because a high impedance input does not
    draw much current and therefore should not be fed much current? (If
    the input is high impedance, then I would have thought it acted as
    its own current limiter, no?) If it has a lower impednace, and I use
    a smaller resistor, don't I risk sending too much current to the
    input? (I think I'm confused about the defference between resistance
    and impedance.) You are being extremely helpful to me, but if you
    are getting tired of the pestering, feel free to say so. [noparse]:)[/noparse]

    >
    > If the signal feeds an ADC in the engine computer, the the ADC
    > _probably_ has a high input impedance. But not necessarily. What
    I
    > mean by that is, try it with a 1000 ohm resistor between the output
    > of your LM358 circuit and the input to engine computer, and measure
    > the voltage on both sides of the resistor (referenced to common).
    If
    > they are the same, then it is okay and prudent to leave the
    resistor
    > in place. If the voltages are different, that means that the ADC
    > has a low input impedance, and you should use a lower value of
    > resistor, 100 ohms or 10 ohms. When dealing with "black boxes",
    you
    > have to probe the black box characteristics by doing experiments!
    >
    ....>
    > ADCs usually have quite a high input impedance, but not
    necessarily.
    > Older ones might have a 100kohm or even 10kohm input impedance, in
    > which case you can't put a resistor in series without losing some
    of
    > your signal!
    >
    > I hope that clears things up some.
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
    >
    >
    > >Thanks and sorry to be unclear. My problem is that I am not 100%
    sure
    > >what I am connecting the voltage to. [noparse]:)[/noparse] This is for my car. It has
    > >an air flow meter that generates a signal from 0 to 5, which feeds
    > >the engine management computer (Bosch DME circa 1983, I'm told
    based
    > >on 8051 technology--i.e., a black box) to drive fuel injectors and
    so
    > >forth. The black box takes the signal and uses it to generate duty
    > >cycles for the fuel injectors. More air means higher voltage means
    > >longer duty cycles and more gas. I know that the engine computer
    uses
    > >an EPROM with maps of duty cyles for various conditions. (In
    addition
    > >to the signal from our circuit, it looks at engine temp, air
    > >dentsity, etc.) So, I assume the signal generated by this circuit
    > >goes to an A/D converter so that the cpu can process it with the
    > >other information and then pick just the right duty cycle off the
    > >EPROM maps. SO, I figured a 10k resistor would be prudent, but was
    a
    > >little confused by the TTL circuit shown by National. Was TTL dead
    in
    > >the early 80's? Either way, I think you are right when you say the
    > >voltage is not driving digital circuitry anyway (directly).... so
    it
    > >sounds like I should stick with the 10k resistor in series and stop
    > >confusing myself. [noparse]:)[/noparse]
    > >
    > >
    > >--- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > > > >No good deed goes unpunished. I have another question. Now
    armed
    > >with
    > > > >my circuit (thanks Tracy), I wanted to take the output voltage
    and
    > > > >send it to an 8051 based controller. I was planning on
    putting a
    > >10k
    > > > >resistor on the output of this circuit, in series, to avoid too
    > >much
    > > > >current flow. I just looked at the National datasheet for the
    > >LM358,
    > > > >however, and it shows a circuit for "driving TTL" gates. (Not
    sure
    > >is
    > > > >car's computer is TTL or CMOS or ?) That they show is the
    output
    > > > >connected to ground via a 240 ohm resistor and directly to the
    TTL
    > > > >gate without a resistor. Does that make sense? If I did
    without the
    > > > >240 resistor to ground and put a 10k in series between this
    circuit
    > > > >and the 8051-based controller, I'd be ok, no?
    > > >
    > > > I'm not clear on the purpose. The goal of the LM358 circuit was
    to
    > > > provide an analog voltage, so it makes more sense to talk about
    > > > putting that voltage into an analog-to-digital converter (ADC).
    > > > Maybe the controller has one?
    > > >
    > > > It does not really make sense to talk about interfacing it to
    TTL
    > >or
    > > > CMOS, which are digital logic families. The interface circuit
    you
    > > > saw in the LM358 data sheet is probably for a comparator, not an
    > > > analog amplifier. And forget about the TTL interface with the
    240
    > > > ohm resistor. The original full-fledged TTL is history.
    > > >
    > > > It _is_ usually wise to put a resistor between the output of one
    > > > circuit and the input of another when they are different
    modules.
    > > > Doing so can save a lot of grief.
    > > >
    > > > -- Tracy
    > >
    > >
    > >To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > >from the same email address that you subscribed. Text in the
    > >Subject and Body of the message will be ignored.
    > >
    > >
    > >Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-23 19:33
    >Thanks again Tracy. I guess I am confused by the high impedance
    >thing. If the input on the black box is high impedance, why would I
    >want a bigger resistor? Is it because a high impedance input does not
    >draw much current and therefore should not be fed much current? (If
    >the input is high impedance, then I would have thought it acted as
    >its own current limiter, no?) If it has a lower impednace, and I use
    >a smaller resistor, don't I risk sending too much current to the
    >input? (I think I'm confused about the defference between resistance
    >and impedance.) You are being extremely helpful to me, but if you
    >are getting tired of the pestering, feel free to say so. [noparse]:)[/noparse]

    No problem!

    There are two separate issues in the problem you are facing. One
    issue is protection of the the two circuit modules from one another.
    The second issue is the impedance, get the signal intact without
    error from the amplifier to the car computer. For protection, you
    want to put a relatively high resistance between the two modules.
    That is so that if some glitch happens in the voltage in one circuit,
    it can not cause a potentially bad glitch current in the other
    module. But you cannot make the resistance too large, because of
    potential signal loss due to the impedance losses.

    The concept of input and output impedance is one of the most
    important Basics to understand in electronics. Both of the issues
    above are in a way related to the concept, but under different
    conditions that can occur in your circuit, one normal and one
    abnormal.

    It all comes down to voltage dividers. Impedance also includes
    capacitance and inductance, but you can often ignore them for the
    first approximation in a DC voltage filter and just say, input and
    output "resistance" instead of "impedance".

    ' ;
    V result
    ' |
    V input
    /\/\-o--o---/\/\---- common
    R output ' R input
    '

    The voltage source on the left is your LM358 amplifier, and the extra
    resistor "R output" is the one you put in its output. The circuit on
    the right is the car computer module with an unknown input resistance
    "R input". The voltage V result is what the car computer actually
    measures. It is given by the voltage divider equation:

    V result = V input * (Rinput/(Routput+Rinput))

    If Rinput>>Routput, then the term in parentheses equals one, and
    Vresult=Vinput, which is what you want. In practice, if Rinput=10
    megaohms, then using Routput=10000 ohms would give only
    10000/10000000 * 100% = 0.1% error. But if Rinput in the "black box"
    happens to be only 100kohms, then the error would be 10000/100000 *
    100% = 10% error. That is what it comes down to. Rinput>>Routput.

    The other issue is input protection. Take for example the case where
    you turn on your amplifier before the car module. Under that
    condition Rinput might (black box!) be much less than its normal
    value. In fact, it will likely look like this, while the car
    computer is turned off:

    ' ;
    V result
    ' |
    V input
    /\/\-o--o--->|---- common
    R output ' R input=10 ohms
    with a diode to common

    The diode is an intrinsic part of the circuit, a "substrate diode".
    The input resistance is now close to zero, because diodes can conduct
    a lot of current in the forward direction, once the input voltage is
    greater than 0.7. So now the current is limited mainly by Routput:
    I = (Vinput-0.7)/(Routput+10)

    If you have Routput=0, and Vinput is 5 volts, you could potentially
    have 5volts/10 ohms = 0.5 amp. But that will never happen, because
    the LM358 itself will limit the current to 10s of milliamps. Still,
    even 10s of milliamps could have (black box!) a bad effect and cause
    the car computer to "lock up". Unlikely, but it is always good to
    play it safe. If you can put 1000 ohms in there (without causing
    signal loss as explained in the previous paragraph) then go for it.
    But if 1000 ohms would cause too much error in normal operation, then
    100 ohms would still be a help.

    The protection issue goes the other way too. Let's say you are
    working under the hood in a cramped space and you accidently hook up
    the output of your amplifier directly to the 12 volt car battery
    terminal instead of to the car computer input. (ouch!). If you have
    that Routput=1000 ohms installed, then no worries. The current flow
    from the 12 volts back through the diodes in the output circuit of
    the LM358 will be limited to 12 ma. But without the 1000 ohms,
    SMOKE.

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-24 07:25
    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >Thanks again Tracy. I guess I am confused by the high impedance
    > >thing. If the input on the black box is high impedance, why would I
    > >want a bigger resistor? Is it because a high impedance input does
    not
    > >draw much current and therefore should not be fed much current?
    (If
    > >the input is high impedance, then I would have thought it acted as
    > >its own current limiter, no?) If it has a lower impednace, and I
    use
    > >a smaller resistor, don't I risk sending too much current to the
    > >input? (I think I'm confused about the defference between
    resistance
    > >and impedance.) You are being extremely helpful to me, but if you
    > >are getting tired of the pestering, feel free to say so. [noparse]:)[/noparse]
    >
    > No problem!
    >
    > There are two separate issues in the problem you are facing. One
    > issue is protection of the the two circuit modules from one
    another.
    > The second issue is the impedance, get the signal intact without
    > error from the amplifier to the car computer. For protection, you
    > want to put a relatively high resistance between the two modules.
    > That is so that if some glitch happens in the voltage in one
    circuit,
    > it can not cause a potentially bad glitch current in the other
    > module. But you cannot make the resistance too large, because of
    > potential signal loss due to the impedance losses.
    >
    > The concept of input and output impedance is one of the most
    > important Basics to understand in electronics. Both of the issues
    > above are in a way related to the concept, but under different
    > conditions that can occur in your circuit, one normal and one
    > abnormal.
    >
    > It all comes down to voltage dividers. Impedance also includes
    > capacitance and inductance, but you can often ignore them for the
    > first approximation in a DC voltage filter and just say, input and
    > output "resistance" instead of "impedance".
    >
    > ' ;
    V result
    > ' |
    > V input
    /\/\-o--o---/\/\---- common
    > R output ' R input
    > '
    >
    > The voltage source on the left is your LM358 amplifier, and the
    extra
    > resistor "R output" is the one you put in its output. The circuit
    on
    > the right is the car computer module with an unknown input
    resistance
    > "R input". The voltage V result is what the car computer actually
    > measures. It is given by the voltage divider equation:
    >
    > V result = V input * (Rinput/(Routput+Rinput))
    >
    > If Rinput>>Routput, then the term in parentheses equals one, and
    > Vresult=Vinput, which is what you want. In practice, if Rinput=10
    > megaohms, then using Routput=10000 ohms would give only
    > 10000/10000000 * 100% = 0.1% error. But if Rinput in the "black
    box"
    > happens to be only 100kohms, then the error would be 10000/100000 *
    > 100% = 10% error. That is what it comes down to. Rinput>>Routput.
    >
    > The other issue is input protection. Take for example the case
    where
    > you turn on your amplifier before the car module. Under that
    > condition Rinput might (black box!) be much less than its normal
    > value. In fact, it will likely look like this, while the car
    > computer is turned off:
    >
    > ' ;
    V result
    > ' |
    > V input
    /\/\-o--o--->|---- common
    > R output ' R input=10 ohms
    > with a diode to common
    >
    > The diode is an intrinsic part of the circuit, a "substrate diode".
    > The input resistance is now close to zero, because diodes can
    conduct
    > a lot of current in the forward direction, once the input voltage
    is
    > greater than 0.7. So now the current is limited mainly by Routput:
    > I = (Vinput-0.7)/(Routput+10)
    >
    > If you have Routput=0, and Vinput is 5 volts, you could potentially
    > have 5volts/10 ohms = 0.5 amp. But that will never happen, because
    > the LM358 itself will limit the current to 10s of milliamps.
    Still,
    > even 10s of milliamps could have (black box!) a bad effect and
    cause
    > the car computer to "lock up". Unlikely, but it is always good to
    > play it safe. If you can put 1000 ohms in there (without causing
    > signal loss as explained in the previous paragraph) then go for it.
    > But if 1000 ohms would cause too much error in normal operation,
    then
    > 100 ohms would still be a help.
    >
    > The protection issue goes the other way too. Let's say you are
    > working under the hood in a cramped space and you accidently hook
    up
    > the output of your amplifier directly to the 12 volt car battery
    > terminal instead of to the car computer input. (ouch!). If you
    have
    > that Routput=1000 ohms installed, then no worries. The current
    flow
    > from the 12 volts back through the diodes in the output circuit of
    > the LM358 will be limited to 12 ma. But without the 1000 ohms,
    > SMOKE.
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-24 07:32
    Thanks

    That all makes sense, I think. The good news is that I took the
    circuit live this afternoon and drove the car while running off the
    LM358 output (with a 1k resistor in series). Although the voltage
    fluxuates when the car is idling, there was no obvious or noticable
    difference in voltage on either side of the resister, so I assume the
    black box is high impendance and all is good. Now, on the other side
    of the circuit -- the sensor input into the LM358, should I use a
    resistor there too? In other words, is the LM358 high impendance
    itself? The sensor voltage is another black box really -- no idea
    how much current it might be able to flow. I tied it straight to the
    LM358 without thinking about it, and it worked fine, but I'm thinking
    I should do the same thing on that side of the circuit as well. yes?

    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >Thanks again Tracy. I guess I am confused by the high impedance
    > >thing. If the input on the black box is high impedance, why would I
    > >want a bigger resistor? Is it because a high impedance input does
    not
    > >draw much current and therefore should not be fed much current?
    (If
    > >the input is high impedance, then I would have thought it acted as
    > >its own current limiter, no?) If it has a lower impednace, and I
    use
    > >a smaller resistor, don't I risk sending too much current to the
    > >input? (I think I'm confused about the defference between
    resistance
    > >and impedance.) You are being extremely helpful to me, but if you
    > >are getting tired of the pestering, feel free to say so. [noparse]:)[/noparse]
    >
    > No problem!
    >
    > There are two separate issues in the problem you are facing. One
    > issue is protection of the the two circuit modules from one
    another.
    > The second issue is the impedance, get the signal intact without
    > error from the amplifier to the car computer. For protection, you
    > want to put a relatively high resistance between the two modules.
    > That is so that if some glitch happens in the voltage in one
    circuit,
    > it can not cause a potentially bad glitch current in the other
    > module. But you cannot make the resistance too large, because of
    > potential signal loss due to the impedance losses.
    >
    > The concept of input and output impedance is one of the most
    > important Basics to understand in electronics. Both of the issues
    > above are in a way related to the concept, but under different
    > conditions that can occur in your circuit, one normal and one
    > abnormal.
    >
    > It all comes down to voltage dividers. Impedance also includes
    > capacitance and inductance, but you can often ignore them for the
    > first approximation in a DC voltage filter and just say, input and
    > output "resistance" instead of "impedance".
    >
    > ' ;
    V result
    > ' |
    > V input
    /\/\-o--o---/\/\---- common
    > R output ' R input
    > '
    >
    > The voltage source on the left is your LM358 amplifier, and the
    extra
    > resistor "R output" is the one you put in its output. The circuit
    on
    > the right is the car computer module with an unknown input
    resistance
    > "R input". The voltage V result is what the car computer actually
    > measures. It is given by the voltage divider equation:
    >
    > V result = V input * (Rinput/(Routput+Rinput))
    >
    > If Rinput>>Routput, then the term in parentheses equals one, and
    > Vresult=Vinput, which is what you want. In practice, if Rinput=10
    > megaohms, then using Routput=10000 ohms would give only
    > 10000/10000000 * 100% = 0.1% error. But if Rinput in the "black
    box"
    > happens to be only 100kohms, then the error would be 10000/100000 *
    > 100% = 10% error. That is what it comes down to. Rinput>>Routput.
    >
    > The other issue is input protection. Take for example the case
    where
    > you turn on your amplifier before the car module. Under that
    > condition Rinput might (black box!) be much less than its normal
    > value. In fact, it will likely look like this, while the car
    > computer is turned off:
    >
    > ' ;
    V result
    > ' |
    > V input
    /\/\-o--o--->|---- common
    > R output ' R input=10 ohms
    > with a diode to common
    >
    > The diode is an intrinsic part of the circuit, a "substrate diode".
    > The input resistance is now close to zero, because diodes can
    conduct
    > a lot of current in the forward direction, once the input voltage
    is
    > greater than 0.7. So now the current is limited mainly by Routput:
    > I = (Vinput-0.7)/(Routput+10)
    >
    > If you have Routput=0, and Vinput is 5 volts, you could potentially
    > have 5volts/10 ohms = 0.5 amp. But that will never happen, because
    > the LM358 itself will limit the current to 10s of milliamps.
    Still,
    > even 10s of milliamps could have (black box!) a bad effect and
    cause
    > the car computer to "lock up". Unlikely, but it is always good to
    > play it safe. If you can put 1000 ohms in there (without causing
    > signal loss as explained in the previous paragraph) then go for it.
    > But if 1000 ohms would cause too much error in normal operation,
    then
    > 100 ohms would still be a help.
    >
    > The protection issue goes the other way too. Let's say you are
    > working under the hood in a cramped space and you accidently hook
    up
    > the output of your amplifier directly to the 12 volt car battery
    > terminal instead of to the car computer input. (ouch!). If you
    have
    > that Routput=1000 ohms installed, then no worries. The current
    flow
    > from the 12 volts back through the diodes in the output circuit of
    > the LM358 will be limited to 12 ma. But without the 1000 ohms,
    > SMOKE.
    >
    > -- regards,
    > Tracy Allen
    > electronically monitored ecosystems
    > mailto:tracy@e...
    > http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-24 09:29
    >Now, on the other side
    >of the circuit -- the sensor input into the LM358, should I use a
    >resistor there too? In other words, is the LM358 high impendance
    >itself?

    Yes, and yes.

    -- Tracy
  • ArchiverArchiver Posts: 46,084
    edited 2001-12-24 19:39
    Be careful in what we say.
    The LM358 and other op-a or comparator have is called input bias
    current.
    Granted is small but with a large resistor in the input, may create
    un undesirable offset voltage.
    --- In basicstamps@y..., Tracy Allen <tracy@e...> wrote:
    > >Now, on the other side
    > >of the circuit -- the sensor input into the LM358, should I use a
    > >resistor there too? In other words, is the LM358 high impendance
    > >itself?
    >
    > Yes, and yes.
    >
    > -- Tracy
Sign In or Register to comment.