0
\$\begingroup\$

I was tasked with taking a signal that could be of ±2.5 and converting it to 0-5v so it could be read by an ADC. I managed that with a non-inverting summing amp like so: non-inverting summing

It worked pretty well but I ran into the issue that if the input is disconnected, it obviously doubles the remaining input. I tried instead an inverting summing amp and it works. This would require me to add a negative rail and re-invert the output for the ADC. I feel like I'm missing something basic or perhaps a solution I'm not aware of. Any guidance will be immensely appreciated.

inverting summing

EDIT Sorry for clarification purposes, the ideal scenario would be: if the input gets disconnected, the summing amp would still produce a value of 2.5, the same as if the input were connected to 0v/GND.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ You might explain in the question what you want to happen when the input is disconnected. Knowing the source impedance might give some options as well. Hit the edit link ... \$\endgroup\$
    – Transistor
    Commented Aug 27, 2021 at 20:25
  • \$\begingroup\$ Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. \$\endgroup\$
    – Community Bot
    Commented Aug 27, 2021 at 20:27
  • \$\begingroup\$ And the source impedance? \$\endgroup\$
    – Transistor
    Commented Aug 27, 2021 at 20:37
  • \$\begingroup\$ It's variable, but sub 1ohm. Sorry if the information is parse or incomplete. I'm a computer major still learning electronics. \$\endgroup\$ Commented Aug 27, 2021 at 20:58

3 Answers 3

4
\$\begingroup\$

Generally single supply circuits that have to deal with bipolar inputs have some unpleasant characteristics such as the one you mention for open inputs, and outputting voltage from what is suppose to be an input.

Most would likely say an ideal input circuit has a known input impedance (or extremely high input impedance), and does not output any voltage (positive or negative).

Since your gain is <= 1 that also means that it's impossible to get all those characteristics with a single op-amp. So the "nicest" input circuit would be something like this (requires bipolar rails, of course):

schematic

simulate this circuit – Schematic created using CircuitLab

With appropriate op-amps and supply voltages you can get exactly (or very close to) 0~5V out for -2.5~2.5V in, the input is high-Z and presents negligible voltage at the input terminal.

In general though, there's another issue with attempting to produce an ADC input that is the full supply voltage range- if your circuit can do that accurately then it can generally go beyond the supply voltage range (which can be a problem for the ADC). If it is clamped at the supply voltage then it won't be accurate at the extremes. How to deal with that is outside the scope of this answer, but one approach is to use something like 0.5~4.5 of the 0-5V range of the ADC, losing 10% of the resolution at each end (retaining 80%) but allowing a RR output op-amp powered from 0V/5V to work properly.

\$\endgroup\$
1
\$\begingroup\$

See what you think of this:

schematic

simulate this circuit – Schematic created using CircuitLab

It's inverting, but that's easily fixed by bitwise-inverting the ADC reading (yes, that works!), possibly by using an instruction just for that instead of the normal load instruction or whatever your MCU uses. So no performance penalty at all if you can convince your compiler to do it that way.

Having made the inversion problem irrelevant, we can look at how it actually works. It's essentially an inverting amp, but with the reference chosen explicitly. Grounding that reference is only a special case; it could be anything within the opamp's acceptable range, and forms a sort-of "pivot" around that voltage. When the input is equal to that, so is the output, and the inversion happens relative to that point.

So:

  • You want a gain of magnitude 1, so R3 = R4.
  • Now, with that gain fixed, what does V_ref need to be to give you the right output range? Pick an operating point that's easy to calculate, and then check it for a few other points if you like. When you're satisfied, figure out what R1 and R2 need to be to make that reference voltage.

The opamp never sees the raw input voltage that is beyond its own rails. It only sees the reference, x2 because it's actively maintaining the other one, and its own output.


The catch though, is that it doesn't produce the reading you want when the input is disconnected. It produces the reference instead. I can't think of a good way to accomplish the desired default behavior without adding a negative rail.

If that's all it's doing though, and it's really that important, then it might be worth adding a charge pump or low-power DC-DC converter of some kind to produce that negative rail. Then there are several easy ways to accomplish your goal.


However, if you only want to "detect a disconnection" and do something special in that case, then you could simply add a resistor to pull VIN up to V+, and perhaps fudge the gain and reference a bit so that a "normal" signal never causes 0V to the ADC, while the uncontested pull-up does. Then write a special check for that into your software.

\$\endgroup\$
1
  • \$\begingroup\$ This might work with some tweaking in software, but that last edit might be a great fallback. Thank you, this has given me direction. \$\endgroup\$ Commented Aug 27, 2021 at 21:24
1
\$\begingroup\$

What about this?

schematic

simulate this circuit – Schematic created using CircuitLab

$$V_{out}=-V_{in}\cdot G + (1+G)\cdot V_+$$

$$V_{out}=-V_{in} + 2\cdot V_+$$

Note: If you supply the opamp with 12V, then you can get the output as high as 12V.

EDIT:

schematic

simulate this circuit

$$ADC_{count}= \dfrac{V_{adc}}{V_{ref}}(2^N-1)=\dfrac{-V_{in} + 2\cdot V_+}{V_{ref}}(2^N-1)$$

$$ADC_{count}= \left[2^N-1\right] \left[\dfrac{-V_{in}}{V_{ref}}+\dfrac{2\cdot V_{ref}\dfrac{R_3}{R_3+R_4}}{V_{ref}}\right]$$

$$ADC_{count}= \left[2^N-1\right] \left[\dfrac{-V_{in}}{V_{ref}}+{2\cdot \dfrac{R_3}{R_3+R_4}}\right]$$

With the use of the same reference voltage of the ADC and voltage divider, you get a ratiometric ADC count. If Vref is fluctuating you get always the same value for the midpoint.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.