Author Topic: Op Amp input to ADC  (Read 1476 times)

0 Members and 1 Guest are viewing this topic.

Offline nr4psTopic starter

  • Newbie
  • Posts: 7
  • Country: us
Op Amp input to ADC
« on: September 26, 2022, 09:18:50 pm »
Hello, I have a question about the input circuit used for an analog to digital converter as shown in the attached diagram (from https://www.instructables.com/Girino-Fast-Arduino-Oscilloscope/?amp_page=true). I was wondering, what would be the consequence of omitting the second emitter-follower? The first emitter-follower is to avoid loading the circuit under test. And the non-inverting sum adds 2.5V bias because the ADC cannot read negative voltage. But I’m unclear on the need for the second emitter-follower. Can someone explain it? Thanks
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8632
  • Country: gb
Re: Op Amp input to ADC
« Reply #1 on: September 26, 2022, 09:31:27 pm »
I think they are trying to stop the capacitive input of the ADC (i.e the sampler) destabilising the first op-amp. However, it probably won't do that reliably. Op-amps really don't like driving capacitive loads. Most ADCs have enough input capacitance to result in a phase reversal in the loopback path at a frequency where the loop gain is greater than one, and you have an oscillator. A lot of people put a resistor between the op-amp and the ADC input. This does stabilise the amp, but the resulting single pole RC filter will slow down the response at the ADC.
 
The following users thanked this post: nr4ps

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5867
  • Country: de
Re: Op Amp input to ADC
« Reply #2 on: September 26, 2022, 09:57:52 pm »
First, the term is "voltage follower". Emitter follower is something else.
Second, calling an LM324 buffer circuit " high speed" is somewhat over the top. This Girino guy apparently knows very little about analog electronics.
Third: no, the second voltage follower is not really needed. I expect Girino had them in stock and decided to utilize as much as possible.
 
The following users thanked this post: nr4ps

Offline nr4psTopic starter

  • Newbie
  • Posts: 7
  • Country: us
Re: Op Amp input to ADC
« Reply #3 on: September 26, 2022, 10:45:45 pm »
Thank you both for your insights!
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16600
  • Country: us
  • DavidH
Re: Op Amp input to ADC
« Reply #4 on: September 26, 2022, 11:58:34 pm »
The summing amplifier has a gain of 2 and would drive a capacitive load better than a voltage follower, so there is no reason for the second voltage follower.
 
The following users thanked this post: nr4ps

Offline Circlotron

  • Super Contributor
  • ***
  • Posts: 3176
  • Country: au
Re: Op Amp input to ADC
« Reply #5 on: September 27, 2022, 12:27:20 am »
LM324 has four opamps in the package and the output buffer one was probably spare so he may have thought why not. But as others have said, no need for it.
 
The following users thanked this post: nr4ps

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2384
  • Country: gb
  • Recovering Electrical Engineer
Re: Op Amp input to ADC
« Reply #6 on: September 27, 2022, 05:31:43 pm »
How many bits is the ADC. The circuit needs high precision opamps and very good resistor matching to work properly. You can tune out the offset and gain errors in code, but the temeprature drift of a 324 and the resistors may kill your bits. It would not be good enough for a 10-bit system and hopeless at 12-bits.
I imagine the originator just used U1 it becase the ic is a qaud and its going spare. It could be better used to buffer the voltage from R4, R5 before its fed into R3.
Tip on drawing clear schematics. The opamps are numbered Un. U is the label for a complete ic, not its inner sections. eg U1a, U1b, U1c etc.
 
The following users thanked this post: nr4ps

Offline nr4psTopic starter

  • Newbie
  • Posts: 7
  • Country: us
Re: Op Amp input to ADC
« Reply #7 on: September 27, 2022, 06:03:17 pm »
Thanks for all the comments. The originator was only using it as an 8-bit ADC. For 10+ bits would one want to use an op amp with less offset voltage drift and replace the 10K resistors with a matched resistor network?
 

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1207
  • Country: pl
Re: Op Amp input to ADC
« Reply #8 on: September 28, 2022, 01:36:35 am »
If anywhere in this circuit, another voltage follower would make sense between the 2.5V offset divider and the summing amplifier. Currently the offset leg has a slightly higher resistance than the signal leg. Not that with an effectively 8-bit ADC and likely 5% components it will make a huge impact. But if anybody wishes to spend an extra op-amp, this is where I would consider placing it first. It would also make the positive and negative inputs see similar impedance, helping reduce biases from input currents.
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: nr4ps

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14155
  • Country: de
Re: Op Amp input to ADC
« Reply #9 on: September 28, 2022, 08:32:35 am »
The resistor accuracy an value matching only effects the offset and gain. Both are usually calibrated for the full circuit anyway. So it would not matter using resistors that are 10% off. Large drift could be a problem though. When using same batch resistors this is often not that bad.  The LM324 OP is indeed somewhat limiting, though not so much for the DC precison: with only 10 bit resolution of the AVR based Arduino this are some 5 mV/LSB for the ADC and some 10 mV/LSB for the input.  The problem could be the AC performance with the rather anoying delay when the current polarity changes - this happens for the OP-amp at the input.

Skipping the extra buffer one could as well use the equivalend dual LM358 instead of the LM324.
 
The following users thanked this post: nr4ps

Offline golden_labels

  • Super Contributor
  • ***
  • Posts: 1207
  • Country: pl
Re: Op Amp input to ADC
« Reply #10 on: September 28, 2022, 02:39:27 pm »
The resistor accuracy an value matching only effects the offset and gain. Both are usually calibrated for the full circuit anyway. So it would not matter using resistors that are 10% off.
I did not consider resistors tolerance to be a problem. I mentioned it to indicate that the imprecision on the positive input of the summing op-amp is not a problem.

Currently that op-amp sees resistances as depicted in the attachment. Can you spot what does not match the pattern? :D That leads to two issues:
  • The summed inputs are not Signal through 10kΩ and 2.5V through 10kΩ, but Signal through 10kΩ, 5V through 21kΩ and GND through 21kΩ. So instead of signal being offset by +2.5V, it is offset by a value that slightly depends on the signal itself, introducing an error of a few dozen mV.
  • The negative input sees 5kΩ, the positive input sees 5.12kΩ.

Of course that is a minuscule error, that can be ignored in a circuit consisting of 5% resistors. Either because the worsr case error from them is already larger, or because the circuit will be calibrated anyway. And this is my motivation for mentioning the tolerance.

And, to be clear, I do not say OP should put an op-amp there. I am just saying that if someone wanted to use an extra op-amp, placing it there would make more sense.

with only 10 bit resolution of the AVR based Arduino this are some 5 mV/LSB for the ADC and some 10 mV/LSB for the input.
10 bits is the width of a value used to control the internal DAC. It is returned as the measurement result. But the actual measurement accuracy is worse. Unfortunately that is not mentioned in the ADC part of the datasheet. For that one must scroll 60 pages, to the “Electric characteristics” section. For ATmega328 it’s Table 28-8 “ADC characteristics”. Total unadjusted error is up to 3.5 LSB. Without calibration one should not expect better than 8 bits. With calibration: depends, but getting full 10 bits is unlikely in ATmegas. Of course 8 bits is still better than 0.5%.
People imagine AI as T1000. What we got so far is glorified T9.
 
The following users thanked this post: nr4ps

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14155
  • Country: de
Re: Op Amp input to ADC
« Reply #11 on: September 28, 2022, 02:54:11 pm »
Much of the 3.5 LSB unadjusted error is offset and gain error - so the comparable with error one gets from resistos that are off a little. Especially the zero offset is rather easy to adjust. The gain acts togther with the accuracy of the reference, that in this case likely is the 5 V supply. While not as easy as the zero adjust an extra calibration for the gain is a good idea.
 
The following users thanked this post: nr4ps

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19477
  • Country: gb
  • 0999
Re: Op Amp input to ADC
« Reply #12 on: September 28, 2022, 04:59:06 pm »
If anywhere in this circuit, another voltage follower would make sense between the 2.5V offset divider and the summing amplifier. Currently the offset leg has a slightly higher resistance than the signal leg. Not that with an effectively 8-bit ADC and likely 5% components it will make a huge impact. But if anybody wishes to spend an extra op-amp, this is where I would consider placing it first. It would also make the positive and negative inputs see similar impedance, helping reduce biases from input currents.
If the reference is clean enough and a filter capacitor isn't required, remove R3 & C3 and change R4 & R5 to 20k.
 
The following users thanked this post: nr4ps


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf