Electrical Conductivity Circuit - Filtering Out Noise Generated By Oscillator?

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Hey guys,
I am thinking this might be a trivial question, but wanted to double check to make sure I am going about this correctly. I found this schematic online a while back and decided to use it. I'm sure there are probably some improvements that could be made. Here is my version of it in eagle:
ppm_question1.jpg

I took oscilloscope readings right up next to the analog-to-digital converter chip (ADC) and there are very steady/even spikes about 1.55 volts in amplitude, and between 1.6 - 1.7 kHz. Up to this point I have just been taking multiple readings via the ADC chip, then averaging them together to get the average voltage value. This has been working out well, but I would like to filter these spikes out before sending it into the ADC chip - mainly because once the spikes go over 3.3 volts it starts to change the curve since 3.3 volts is the cutoff for the ADC.

What is the best way to turn these spikes into a nice steady voltage reading for the ADC? Would I just do a low pass RC circuit? I used this online filter calculator:
http://www.ekswai.com/en_lowpass.htm
I put in 1uF for capacitor, 120 ohms for resistor, and it gives me 1.33 kHz, so this means anything of higher frequency will not get through correct?

Although... will this just smooth the signal out to the bottom of the oscillation and not give me the average voltage value?
 

#12

Joined Nov 30, 2010
18,224
Conductivity doesn't change in a millisecond, and if it did you couldn't read the meter.:D
Filter that signal noise down to 0.1 Hz.
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Conductivity doesn't change in a millisecond, and if it did you couldn't read the meter.:D
Filter that signal noise down to 0.1 Hz.
Ok so there is no harm in filtering way beyond the 1.6 kHz?

So in that case I would run the signal through a 100K resistor, and then a 10uF capacitor to ground? Would this condition the signal to be in the center of the oscillation (e.g. average), or would it condition the signal to the bottom or top of the oscillation?
 

#12

Joined Nov 30, 2010
18,224
I can't see where you put the 1 uf cap and 120 ohms, so I can't tell where you're filtering.
What I can say is that I used to do QC on commercial conductivity meters and their RC time constant was 0.975 seconds. 39K and 25 uf
 

SLK001

Joined Nov 29, 2011
1,549
Why don't you try triggering your ADC with the spikes, since they are periodic? The spike will occur, triggering an ADC convert while in the "clean" region of the input signal. This way you won't have to worry about time constants over averaging your signal.
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Why don't you try triggering your ADC with the spikes, since they are periodic? The spike will occur, triggering an ADC convert while in the "clean" region of the input signal. This way you won't have to worry about time constants over averaging your signal.
Thanks for the idea. I think it would be better practice to condition the signal. The spikes are going above 3.3v which is not good.

I can't see where you put the 1 uf cap and 120 ohms, so I can't tell where you're filtering.
What I can say is that I used to do QC on commercial conductivity meters and their RC time constant was 0.975 seconds. 39K and 25 uf
I have not put those caps in yet because I am speculating about them currently. The signal going to the ADC is labeled as "Photon_A2", this is where I want to condition the signal. I am suggesting to put in the 120 ohm resistor in series, then the 1uF cap to ground (removing R15, C32, C33, these were here originally to help filter out the signal, but did not seem to do much good).

Change R15 to 39k.
Change C32 to 25 uf.
Remove C33.
I am under the impression that this suggestion would not work... because for a low pass RC filter doesn't the resistor need to be in series, and the capacitor across ground?
 

#12

Joined Nov 30, 2010
18,224
I am under the impression that this suggestion would not work... because for a low pass RC filter doesn't the resistor need to be in series, and the capacitor across ground?
It worked in a $1000 conductivity meter used in thousands of sewage systems in several countries, but you can try it your way.;)
 

SLK001

Joined Nov 29, 2011
1,549
Thanks for the idea. I think it would be better practice to condition the signal. The spikes are going above 3.3v which is not good.
Any "conditioning" of the signal will distort the actual signal that you want to measure by biasing it upward. With your conditioning, the signal will have the 3.3V spikes added to it. Actual best practices would be to mitigate the spikes at the source.
 

#12

Joined Nov 30, 2010
18,224
You can add about 1.5K between D2 and R15 so the spikes won't cause a high peak voltage to integrate on the capacitor during diode conduction, but SLK001 has the right idea. Stop the spikes before they get to the precision rectifier.
 

AnalogKid

Joined Aug 1, 2013
10,987
The circuit in post #1 is a 1.6 kHz sinewave oscillator followed by unknown gain and a half-wave rectifier driven into heavy saturation. This seems perfect for producing 1.6 kHz "spikes", so I guess I don't understand the question.

TS - what is your understanding of what this circuit does, and how?

ak
 

#12

Joined Nov 30, 2010
18,224
Thanks, AK. I was having difficulty figuring out how that circuit works with any predictability, and I still assume that if I can't read a circuit, it must be my own fault.
 

AnalogKid

Joined Aug 1, 2013
10,987
Note that the output of the rectifier opamp is *not* going to be the entire positive half-cycle of the driving sinewave, only the tips. In very round numbers, the R15-C32 time constant is 10 times that of the Wein network, so the capacitor ripple will be approximately 10% (-20 dB) of the sine waveform amplitude.

ak
 

Alec_t

Joined Sep 17, 2013
14,280
Assuming a limit situation, with a 5V amplitude sinewave driving the final opamp, this is the output when the mods suggested by #12 in posts #6 and #10 are incorporated :-
ECsense.JPG
 

Alec_t

Joined Sep 17, 2013
14,280
but is it valid data?
The opamp supplies are +-5V, therefore the absolute maximum generated sinewave amplitude from IC5A is slightly less than 5V. R10/12 reduce this to about 2.5V, then it's amplified by an unknown factor which might well cause clipping of the sine. Thereafter there's a unity gain buffer before the rectification stage. If clipping occurs then that should actually aid the smoothing process, but LTspice says it does raise the smoothed output voltage slightly; so perhaps the added 1k5 resistor should be increased to, say, 2k2?
 

Thread Starter

Mahonroy

Joined Oct 21, 2014
406
Thanks a lot for the replies and sorry for the late response!
Change R15 to 39k.
Change C32 to 25 uf.
Remove C33.
I believe you, the reason why I was confused was because the form of a RC low-pass filter circuit is generally like this:


And I am confused how the RC low pass filter relates to this:


Assuming a limit situation, with a 5V amplitude sinewave driving the final opamp, this is the output when the mods suggested by #12 in posts #6 and #10 are incorporated :-
View attachment 110328
Thanks for the model. Would you mind showing what it looked like before the switch for comparison? That looks like a nice smooth output and would probably work out great.

I have been looking up other "ec meter circuit" in google, and I am seeing a lot of really similar designs, only they are utilizing the remaining 2 op-amps on the chip and incorporated a bridge-rectifier type of filter? Along with an "active low pass RC filter"? So I'm wondering if I only implemented part of the intended design?

Here is an example:


Thanks again for the info!
 

AnalogKid

Joined Aug 1, 2013
10,987
And I am confused how the RC low pass filter relates to this:
Because that is not all of the circuit. It is fed by an opamp/diode "active rectifier" circuit. The circuit's output impedance is in series with the parallel R-C, and combines with the R to form a Thevenin-equivalent impedance, and that affects how fast the capacitor charges up during the positive half-cycle. During the negative half-cycle, the diode disconnects the opamp circuit and the cap discharges through R. So the R affects both the charging and discharging rates, but in different ways, and this equates to changing the filter corner frequency.

ak
 
Top