RC Lowpass Filter between Amplifier and ADC input

Thread Starter

Henry603

Joined Nov 19, 2018
69
Hi,

I have sensors (pyranometers that consist of thermopiles and measure sun irradiation) that ouput a low voltage signal so I need to amplify them using an instrumentation amplifier. I have chosen the AD8237 for this task: Datasheet

Im using a gain of 100 to amplify the initial low voltage signal (ranging 0-20mV) to 0-2V range.

Im then feeding the amplified signal to the ADC (MCP3422): Datasheet

My sensor values change very slowly and I will read out the digitized ADC values only once every second, so speed is not important in my case.

Now after some research I found that a filter between the INA-output and the ADC input is needed. Often a passive RC lowpass filter is suggested between the INA and the ADC.
As I intend to use the delta sigma ADC above, would I care about aliasing effects and do I need to watch out for that? As I'm only interested in the DC signal...
I hope you can point me into the right direction here as im a bit confused right now.
Could I just use smth. like this:??


This is the filter response:



Or what kind of problems do you see with this approach?
Thank you in advance.
 

crutschow

Joined Mar 14, 2008
23,486
That anti-alias filter should work.
You only need to worry abou aliasing for input signals above 1/2 the A/D input sample frequency.
Below is the input filter frequency response of the A/D.
As long as the total filtered noise is well below the intrinsic A/D output noise level, you should be okay.

upload_2019-1-21_13-30-3.png

Below is the simulated response I got.
Yours doesn't look right. :confused:

upload_2019-1-21_13-39-18.png

Here's the filter transient response to a step function.
It has a rise-time of about 26.8ms, so will be settled to well within 18-bit resolution 1 second after the step change.
You could increase the filter time-constant by a least a factor of three and still get adequate settling time.

upload_2019-1-21_13-59-30.png
 

danadak

Joined Mar 10, 2018
3,607
Is the ADC input buffered ? Or is it connected to a S/H structure at the
input to ADC ?

If latter you can generate offsets as its typical the S/H presents a RC load
at its input.

Regards, Dana.
 

Thread Starter

Henry603

Joined Nov 19, 2018
69
That anti-alias filter should work.
You only need to worry abou aliasing for input signals above 1/2 the A/D input sample frequency.
Below is the input filter frequency response of the A/D.
As long as the total filtered noise is well below the intrinsic A/D output noise level, you should be okay.

Here's the filter transient response to a step function.
It has a rise-time of about 26.8ms, so will be settled to well within 18-bit resolution 1 second after the step change.
You could increase the filter time-constant by a least a factor of three and still get adequate settling time.
View attachment 168386
@crutschow :
Thank you for the great answer! :)

So using the filter when the ADC is doing 3.75 samples per second (and im reading it once per second, going for the 18Bit resolution) should be ok with the proposed filter?
Could I go higher with the values of the resistors (e.g. to 1k) as well as with the values of the caps (to e.g. 47µF)?
Or might there problems arise with higher values for R (e.g. regarding input impedance of the ADC) or higher capacitances? Any voltage drop or other negative effects on my signal possible here?
Like this:




As the ADC will run with 3.75 SPS. I thought that this gives me a sample frequency of 3.75 Hz.
Therefore, I figured I needed to attenuate all the signals that have a frequency >= 3.75/2 Hz to prevent aliasing.
But obviously that is wrong?

It has a rise-time of about 26.8ms, so will be settled to well within 18-bit resolution 1 second after the step change.
You could increase the filter time-constant by a least a factor of three and still get adequate settling time.
Can you please tell me how you can make this conclusion? (how do you get the time constant here and how do you know what time constant I need max.?)
Would be very happy If you could make that clearer to me :).

Thank you, I really appreciate your help, Henry.
 
Last edited:

crutschow

Joined Mar 14, 2008
23,486
Can you please tell me how you can make this conclusion? (how do you get the time constant here and how do you know what time constant I need max.?)
Since I'm lazy, I just got the value from my simulation, rather than try to calculate it.
The maximum time constant allowed is that need to settle to 18 bits in one second (about 12 time-constants).

If you are just interested in 1 SPS data change then the filter only needs to be compatible with that, not the 3.75 SPS of the A/D.
For further filtering you could do a running digital average of the 3.75 SPS data in your processor.
That would give you a theoretical √3 further reduction in noise.
 

MrChips

Joined Oct 2, 2009
19,379
The sampling theorem says that you need to sample at a rate that is at least twice the highest frequency in the signal.

Hence if the sampling frequency is fs, the highest frequency you can analyze is fs/2. This is known as the Nyquist limit.

The corollary of the sampling theorem says that your signal must not contain frequencies above the Nyquist limit. If you violate the sampling theorem you can end up with aliasing. For example, if your sampling rate is 100sps, the Nyquist limit is 50Hz. If you try to digitize an 80Hz signal, it will fold back as 20Hz.

This is where the anti-aliasing filter comes in. You need a low-pass filter to remove all signals above the Nyquist limit.

I am sure you already know this from what you have described.

What you have said is that your signal from the sensor is changing very slowly. Your sampling rate is 1sps. The Nyquist limit is 0.5Hz. Do you need an anti-aliasing filter with a cut-off frequency of 0.5Hz? You would if you were doing frequency analysis.

What is the maximum frequency in your signal? If your sensor is changing very slowly there is no need for an anti-aliasing filter. If you are only interested in the DC value, you would do better to take a running average of your samples in software.
 

Thread Starter

Henry603

Joined Nov 19, 2018
69
Since I'm lazy, I just got the value from my simulation, rather than try to calculate it.
The maximum time constant allowed is that need to settle to 18 bits in one second (about 12 time-constants).
@crutschow : Thank you very much! Ok got it but what time value did you look at in the ADC datasheet to be able to make this conclusion? Can you please name the page and value that is giving me this info?

What you have said is that your signal from the sensor is changing very slowly. Your sampling rate is 1sps. The Nyquist limit is 0.5Hz. Do you need an anti-aliasing filter with a cut-off frequency of 0.5Hz? You would if you were doing frequency analysis.

What is the maximum frequency in your signal? If your sensor is changing very slowly there is no need for an anti-aliasing filter. If you are only interested in the DC value, you would do better to take a running average of your samples in software.
@MrChips : Thank you for your input! Im not doing frequency analysis. But there is noise from my instrumentation amplifier to be expected:
AD8237: Datasheet
I guess it could not hurt to throw in a lowpass filter so the in-amp switching noise will be removed. Simulations indicate that not filtering the switching noise can lower my ENOB (SNR from about 78db ~12.7 ENOB down to only 57db ~9.3 ENOB). So I want to keep out the switching noise of the INA, I do not expect any excessive noise from my sensors there.

Unless there's signal noise above the 1/2 the sample frequency that you need to suppress.
I guess this applies in case my INA introduces noise?

Or what do you guys think?
Am I overthinking?
So you do not see any potential isses with the proposed filter I posted above? (filter response is also posted above):


No problems regarding speed, impedance or anything obvious here?
No voltage drop due to the resistors on my amplified signal here that will distort my signal and produce false digitized values?
I want to make sure I will not get any nasty surprises once I power this :).

Thank you, I really appreciate your help.
 

MrChips

Joined Oct 2, 2009
19,379
I do not understand why the in-amp would be outputting switching noise. I think adding all those resistors and capacitors is asking for more trouble than they would solve. Capacitors are notorious for microphonics.

If you have noise in the ADC readings I would choose to filter that by taking moving averages in software.
 

Thread Starter

Henry603

Joined Nov 19, 2018
69
I do not understand why the in-amp would be outputting switching noise. I think adding all those resistors and capacitors is asking for more trouble than they would solve. Capacitors are notorious for microphonics.

If you have noise in the ADC readings I would choose to filter that by taking moving averages in software.
@MrChips : Ok thank you. I will add the footprints in case I need this filter but first I will test the configuration by applying the amplified signal by the INA to the ADC input direclty.

Do you see other potential issues with the proposed filter? Like impedance issues or shorting etc.?
I guess this filter could be worth a try, right?
 

MrChips

Joined Oct 2, 2009
19,379
Resistors and capacitors introduce their own noise.
Anti-aliasing filter is to remove signals above the Nyquist limit. You do not need an anti-aliasing filter.
Connect the output of the in-amp directly to the ADC and do signal averaging in software.
 

crutschow

Joined Mar 14, 2008
23,486
what time value did you look at in the ADC datasheet to be able to make this conclusion?
The required settling time of the filter is determined by the frequency of the sample rate and the resolution of the ADC.
18 bits gives a resolution of 1/262,140, so the exponential decay of the filter to a step (1-e^t/τ), where τ is the filter time-constant, must reach that value between samples.
That requires about 12 time-constants for a full-scale step.
In your case, for small changes in signal between samples, you could use a smaller factor, (less than 12).
I guess this applies in case my INA introduces noise?
Yes, if the INA introduces significant noise at above 1/2 the sample frequency.
 

Thread Starter

Henry603

Joined Nov 19, 2018
69
@MrChips :
Ok, thank you. I will add the filter footprints to the PCB in case I need it but will try without it first.
To make sure I undertood correctly, you propose that I:
- (in case i configured the ADC for 3.75SPS) take at least 3 samples per second (maximum of valid samples per second I can get)
- average the digital values I get out of the ADC -> (Sample1 + Sample2 + Sample3)/3 = the averaged digital value.
Did I get it right?

@crutschow :
Thats valuable info thank you.

Do you guys see a risk of overloading the instrumentation amplifier by using the proposed filter?
(because the primary contributor to low resistance after the INA output is my RC filter and a 22µF capacitor has an equivalent resistance of 100 Ohm at 100Hz.)
But my AC-component with such slow sensors should not be that significant at all right?
Or should I take care here?

Thank you, learned a lot from your answers already :)
 

MrChips

Joined Oct 2, 2009
19,379
You want to take as many samples as time will allow.
The more samples you acquire in your average the better if you want to filter out the noise.
If the noise is Gaussian, you will gain extra bits by taking the average.
 

bogosort

Joined Sep 24, 2011
417
If the noise is Gaussian, you will gain extra bits by taking the average.
I'm sure you know this, but just to be clear, averaging does not change resolution (number of bits) -- the quantization step-size remains the same before and after the average. It can improve total SNR, but this improvement can't be associated with any particular bit(s) in the signal as, by its nature, the effect of a moving average is spread across all bits.
 

Thread Starter

Henry603

Joined Nov 19, 2018
69
You want to take as many samples as time will allow.
The more samples you acquire in your average the better if you want to filter out the noise.
If the noise is Gaussian, you will gain extra bits by taking the average.
Allright, but the approach I described above your post was what you meant by averaging?
 

MrChips

Joined Oct 2, 2009
19,379
I prefer to do a running average because it is easier to do. You do not have to store each sampled point.

sum = sum + (new_data - average)
average = sum / N

where N can be any number of data points (usually a power of 2 for more efficient integer arithmetic).
 

Thread Starter

Henry603

Joined Nov 19, 2018
69
I prefer to do a running average because it is easier to do. You do not have to store each sampled point.

sum = sum + (new_data - average)
average = sum / N

where N can be any number of data points (usually a power of 2 for more efficient integer arithmetic).
by sum you mean the sum of multiple digital values/codes the ADC has output and N the count of digital values/codes im averaging over, right?
 
Top