Help with Conductivity Cell Design Using Analog Devices Application Note - Page 1
Forum section: electronics / projects

author: digitalectron
author_rank: Contributor
timestamp: December 30, 2024, 05:08:50 am
content: Hello everyone,I am working on a project to measure the electrical conductivity of water using a 4-pole conductivity cell. I found a helpful application note from Analog Devices that explains the design process, but I am facing some challenges.PWM Activation Timing: The application note mentions using PWM signals, but it doesn't clearly specify when and why these signals should be activated. Could someone clarify how to determine the correct timing and frequency of the PWM signals for driving a 4-pole conductivity cell?Current Measurement: The design involves measuring the current through the cell. Why is current measurement critical for determining conductivity, especially in a 4-pole configuration?Additional Considerations for 4-Pole Cells: Are there specific nuances or best practices for working with 4-pole conductivity cells that differ from 2-pole designs?Any guidance, especially if you’ve worked on similar projects or with Analog Devices' application notes, would be greatly appreciated. I aim to design a reliable circuit based on the principles described in the note but need more clarity on these aspects.Thank you in advance!https://www.analog.com/media/en/reference-design-documentation/reference-designs/cn0359.pdf

author: digitalectron
author_rank: Contributor
timestamp: December 30, 2024, 05:27:25 am
content: I think the main reason for measuring the current of a conductivity cell is that conductance, and consequently conductivity, of a liquid is directly related to the current passing through the cell. Since the microcontroller cannot measure current directly, it must be converted to voltage for the system.

author: sw_guy
author_rank: Regular Contributor
timestamp: December 30, 2024, 04:14:58 pm
content: Typically a 4 electrode sensor is used over 2 electrode sensor due to polarization effect using certain electrode materials. Please note that there are more issues that impact to measurements, but this is often the first one on the white board to be solved.I also used the Analog's circuit note as a starting point when I started a similar project, but in the end, the solution that went to the production unit became very much different.You can calculate conductivity from conductance - and voltage+current measurements are for that purpose. The circuit note in question explains pretty well the functional part of the circuit.For me the Analog's design looks more like a showcase of what kind of components Analog has rather than providing an optimal conductivity measurement solution. And... isn't it kind of the idea of such a circuit notes in the first place.A hint: you have probably specified what is the range of conductivity measurement. There are several different sensor types that have different characteristics. 4 pole sensor is pretty common though.

author: digitalectron
author_rank: Contributor
timestamp: February 05, 2025, 09:02:52 am
content: Quote from: sw_guy on December 30, 2024, 04:14:58 pmThank you for your response!I am working with an STM32F4 to generate a PWM signal for measuring resistance in a test setup. My goal is to measure the resistance of a resistor by applying the PWM signal and analyzing the response.However, I’m facing an issue:When I pass the PWM signal through an LM358 (configured with a gain of 1 for impedance matching), the waveform changes.I suspect this might be due to the frequency selection, but I’m not sure what the correct frequency should be for this application.Given that my target conductivity range is 1 μS to 10 S, what would be an optimal PWM frequency for accurate resistance measurement?Additionally, do you have any suggestions on how to prevent distortion when using the LM358 for impedance matching?I appreciate any insights you can share!

author: Terry Bites
author_rank: Super Contributor
timestamp: February 06, 2025, 02:44:53 pm
content: PWM is not used to measure the conductance.A bipolar squarewave exitation voltage is applied to the cell with a fixed cycle time. In the case of this circuit 100Hz.You dont need to sample conductance at a very high rate. This is chemistry not radar.You'd use a 4 electode cell for higher precision. It provides you with a "Kelvin connection".It keeps source wiring separate from measurment wirirng.https://en.wikipedia.org/wiki/Four-terminal_sensingI don't quite get where you are taking your measuements. You should only see DC with a very low level of ripple at the exitation opamp outputs. The cell voltage should be a 100Hz squarewave, so PWM0=100Hz @50%358s have an offset voltage about 300 times higher and a fith of the bandwidth of the opamps used in this circuit.That will make them woefully inadequate for the exitation and measurement circuits in this CN.Using my reading super powers, it doesn't look like PWM control is actually used anywhere in this circuit!There are 3 PWM signals mentioned but I think that is leading you astray.PWM1 and PWM2 are used as logic outputs to control the synchronous sampling actions. Their timing relationships are fixed. I wouldn't call that PWM control.The relative timing of these control signals is shown in figure 5. Reading on, "For a 100 Hz excitation frequency, the period is 10 ms...." So that tells you what timings they have employed. The total cycle and sample period times do not have to be particularly precise as long as set up and hold times are respected.The synchronous sampling is controlled by PWM1 and PWM2 is used to reduce errors by effectively rectifying and filtering the cell current and voltage. It cancels some system offset errors too. PWM1 and PWM2 provide timing control only. Any GPIOs could perform this task. The excitation voltage comes from a DAC and is firmware set.The precision of the conductance measurement depends on the precision of the excitation waveform voltages, the cell voltage measurement and the current measuring amplifier. They have carefully chosen sophisticated (expensive) components and circuitry to achieve a very high level of precision. You'd need think hard about you error analysis if you use other components.You can download and disect the their code from here:https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0359

author: digitalectron
author_rank: Contributor
timestamp: February 08, 2025, 05:18:57 am
content: Quote from: Terry Bites on February 06, 2025, 02:44:53 pmThank you for your explanation!I understand that the excitation should be a bipolar square wave, not traditional PWM. However, in my setup, I generate a PWM signal with a 50% duty cycle and then pass it through an RC filter to remove the DC component, effectively producing an AC voltage.I want to apply this voltage to atest component (in my case, an ordinary resistor). My concern is that the current draw from the resistor might distort the waveform.Which method would you recommend to prevent current drop and ensure that my waveform remains stable when applied to the resistor?I appreciate your insights!

author: Terry Bites
author_rank: Super Contributor
timestamp: February 08, 2025, 04:53:33 pm
content: So, just using a PWM output as a squarewave source to drive a filter.Something to be wary of is that the peak value of PWM waveform is set by and drifts with temp and supply volts in the PWM source.That will impact the sine amplitude. Consider using the 12bit onboard DAC. I think that platform supports external Vref for the perfect amplitude tweak.You'll know where the sinewave midpoint (or zero crossing) is and that might be handy for simple synchronous demodulation scheme. It rejects all that 50(60)Hz crap from the environment. If you can include that, I would. Impress your mates!I'd also use a precsion fet input opamp for the TIA. You will most likely have to use compensation to neurtalise the input capacitance from the cell and its cable.