Input Protection and Filtering for Long Sensor Cables (ADC Interface)

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
Hi All,

I have a small question regarding signal filtering.

I am using a long cable that produces a resistance (for leak detection), which is ultimately connected to my ADC. In addition, there are other wires in the same cable providing power to the sensor. All wires are connected to a terminal block on my PCB, resulting in a total of four wires connected to the terminal block. These form two voltage divider circuits for my application. The cable length can be up to approximately 50 metres.

I would like some advice on additional filtering as the signals enter the PCB. As I understand it, long cables can behave like antennas, so some form of filtering is required. I have already included TVS diodes on all the pins and RC filtering on the ADC inputs. However, would it be beneficial to also add common-mode chokes or ferrite beads on these lines?

Any guidance or best-practice recommendations would be appreciated.


1766232911347.png
 

MrChips

Joined Oct 2, 2009
34,626
If you already have power along the cable, I have two suggestions (which boils down to the same idea).

1) Add a circuit at the sensor to convert the sensor signal to 4-20mA current loop.

2) Add a circuit at the sensor to make the desired measurement (e.g. on board op amp and/or ADC) and transmit the information (digitally or analog voltage/current) with a low impedance driver.

The objective is the lower the output impedance of the driver. This reduces the effect of antenna pickup.
 

MisterBill2

Joined Jan 23, 2018
27,159
As it is shown, the sensor will be rather insensitive to conduction between the two sides. The same voltage is applied to both sides, so how can a signal voltage be developed??? Please explain if there is any thought that I am incorrect. No value of resistance at the line identified as "leak" will result in a voltage difference between the two analog input points. Trace the current paths an see that I am right. OR explain how any voltage will be developed.
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
If you already have power along the cable, I have two suggestions (which boils down to the same idea).

1) Add a circuit at the sensor to convert the sensor signal to 4-20mA current loop.

2) Add a circuit at the sensor to make the desired measurement (e.g. on board op amp and/or ADC) and transmit the information (digitally or analog voltage/current) with a low impedance driver.

The objective is the lower the output impedance of the driver. This reduces the effect of antenna pickup.
There is no power as such; the moisture sensor is simply behaving like a resistor, with a small current flowing through it. I am measuring the resistance at the point where a leak would occur
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
As it is shown, the sensor will be rather insensitive to conduction between the two sides. The same voltage is applied to both sides, so how can a signal voltage be developed??? Please explain if there is any thought that I am incorrect. No value of resistance at the line identified as "leak" will result in a voltage difference between the two analog input points. Trace the current paths an see that I am right. OR explain how any voltage will be developed.
It is an AC-type circuit where we control the polarity by applying a voltage to H-Port 1 and 2, but ideally we take ADC readings only on one polarity. When a leak occurs, it completes another circuit between two exposed conductive wires, and depending on where it happens, it presents a certain resistance. Using a voltage-divider circuit on both legs of the Wheatstone bridge, we are then able to determine the distance from the output voltage.
 

MisterBill2

Joined Jan 23, 2018
27,159
OK, I guess. But without the rest of the circuit it is not obvious to me.
If induced or picked up noise is an issue, one idea would be to use a higher frequency AC voltage to drive the system and then tuned filters to reject all other frequencies. My guess is that presently the AC voltage is the local mains frequency, and so is most of the AC noise voltage. Surplus 400Hz transformers used to be readily available, and cheap. So 400 or close might be an easy option.
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
@MisterBill2

I did not want to overwhelm the post with all the additional information, as I want to focus on noise reduction and filtering. The aim of the AC signal is to avoid galvanic corrosion. We will be producing a signal at 200 Hz, as we do not want to conflict with other AC signals such as 50/60 Hz, and the sensor does not need to be very fast. So, would the existing filtering be sufficient, or do I need to add more?


I will still be taking ADC samples and applying firmware filtering, so my focus is on hardware filtering first, followed by firmware filtering to produce stable results.
 

MrChips

Joined Oct 2, 2009
34,626
There is no power as such; the moisture sensor is simply behaving like a resistor, with a small current flowing through it. I am measuring the resistance at the point where a leak would occur
I am using a long cable that produces a resistance (for leak detection), which is ultimately connected to my ADC. In addition, there are other wires in the same cable providing power to the sensor. All wires are connected to a terminal block on my PCB, resulting in a total of four wires connected to the terminal block. These form two voltage divider circuits for my application. The cable length can be up to approximately 50 metres.
Is there power or not?
 

MrChips

Joined Oct 2, 2009
34,626
I did not want to overwhelm the post with all the additional information, as I want to focus on noise reduction and filtering. The aim of the AC signal is to avoid galvanic corrosion. We will be producing a signal at 200 Hz, as we do not want to conflict with other AC signals such as 50/60 Hz, and the sensor does not need to be very fast. So, would the existing filtering be sufficient, or do I need to add more?

I will still be taking ADC samples and applying firmware filtering, so my focus is on hardware filtering first, followed by firmware filtering to produce stable results.
This is an occurrence of the X-Y problem. You are seeking a solution to problem-X while the real problem is problem-Y.

In the long run, it is better to give the big picture first. Perhaps you are approaching the problem with an improper solution.
 

Ian0

Joined Aug 7, 2020
13,097
@MisterBill2

I did not want to overwhelm the post with all the additional information, as I want to focus on noise reduction and filtering. The aim of the AC signal is to avoid galvanic corrosion. We will be producing a signal at 200 Hz, as we do not want to conflict with other AC signals such as 50/60 Hz, and the sensor does not need to be very fast. So, would the existing filtering be sufficient, or do I need to add more?


I will still be taking ADC samples and applying firmware filtering, so my focus is on hardware filtering first, followed by firmware filtering to produce stable results.
Correlate with the 200Hz drive signal, that should remove any interfering signals.
 

Ian0

Joined Aug 7, 2020
13,097
@Ian0
OK, once I have set my polarity, maybe wait a short period and take a sample. I guess i can do a rolling average.
Are you familiar with the correlation function in DSP?
Drive with a sinewave, preferably not harmonically related to the local main supply frequency. Multiply the sinewave drive voltage with the sampled input then IIR filter. Anything picked up by the A/D that is not related to the drive signal will be eliminated.
 

Ian0

Joined Aug 7, 2020
13,097
Not aware of correlation function in DSP, is there any examples I can follow?
On second thoughts, if there's no significant delay in the signal, then you don't actually need correlation, you just need a single point discrete Fourier transform ∫f(t).g(t)dt.
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
Well my AC signal is still square wave but polarity will be just at swapping. Can we do Fourier transformel on Xmega microcontroller?
 

Ian0

Joined Aug 7, 2020
13,097
Yes, just negate the value you read when the output is low (equivalent to multiplying by -1) Instead of the integral you can do an IIR filter, which is probably not that great on an 8-bit micro, (depends on how many 16-bit instructions you have) but can be done in three instructions on an ARM.
 

MisterBill2

Joined Jan 23, 2018
27,159
OK, 200 Hz should work as well as 400Hz. As for noise, the 10K resistor and one MFD capacitor should reduce much pf it, unless the environment is really noisy. Are your "H" ports affected by noise voltages??
I do see that all of your circuit is referenced to "gnd" which can certainly introduce a whole lot of noise. I suggest, instead, referencing it to the system common. That would be the return point for all of those circuits. You might then tie that to "gnd" and see what, if anything, changes. It may, or maybe not.
 

Thread Starter

DJ_AA

Joined Aug 6, 2021
490
OK, 200 Hz should work as well as 400Hz. As for noise, the 10K resistor and one MFD capacitor should reduce much pf it, unless the environment is really noisy. Are your "H" ports affected by noise voltages??
I do see that all of your circuit is referenced to "gnd" which can certainly introduce a whole lot of noise. I suggest, instead, referencing it to the system common. That would be the return point for all of those circuits. You might then tie that to "gnd" and see what, if anything, changes. It may, or maybe not.

This is a new design, and the aim is to keep all possible options on the PCB to minimise noise. I can therefore add a 10 kΩ resistor and a 1 µF capacitor.
At this stage, the H port is simply outputting 3.3 V and GND, and the polarity would then be reversed to produce GND and 3.3 V.
Please could you explain your suggestion regarding GND, as I am not fully understanding what you mean.
 
Top