CN0411 ec: Questions

Hello. I'm interested in incorporating the CN0411 conductivity-measurement design into a circuit. (www.analog.com/.../cn0411.html)
I plan to use the analog components as listed, but with a different MCU and ADC.

1: In the flowchart that describes how to set the gain etc (Figure 12) What is V_DEF? Is it the 2.5V vref? The 0.4V default DAC output?

2: How long should the PWM 1 and 2 pulses be? (the ones that go in the middle of the V_EXC pulses. Is there a guide on configuring their on/off durations? The document provides the 2 standard frequences and a diagram (Figure 9). PWM0 is described as either 94Hz or 2.4kHz. (I assume that means cycle at these intervals), but I'm not clear on PWM 1 and 2.

3: Does this design supersede CN0349 and CN0359? The three documents don't mention each other. They were published in date that goes with their number, and all appear to accomplish the same task.

Thank you very much.

  • +1
    •  Analog Employees 
    on Jul 22, 2020 7:37 PM 4 months ago

    Hi,

    1. The flowchart in Figure 12 shows the auto-ranging of the measurement by setting the appropriate gain for the conductivity range of the solution. V_DEF is the user defined desired applied voltage across the conductivity electrodes. I realize the terms excitation and applied voltage are easily confused. In this board the excitation voltage V_EXC refers to the voltage output of the DAC. V_DEF refers to the desired voltage across f the electrodes of the conductivity probe. If you rearrange the equation , V_EXC cancels off and the ratio of V_DEF and the measured voltage across the electrode is unity which is one of the goals of the pre-measurement routine. The idea of the conductivity measurement is to apply a fixed voltage across the electrodes and measure the current. The voltage and current values are used to calculate conductance. In this case, the routine starts off by applying a very small voltage across the electrodes through a resistive divider and continuously changing the gain resistors until the measured voltage across the electrodes matches the desired range. Then the DAC output voltage V_EXC is adjusted until the measured voltage across the electrode matches the desired value V_DEF. Using the DAC output excitation voltage and the current gain resistance, the current across the electrode can be computed.

    2. PWM1 and PWM2 are the track-and-hold times used to sample the positive and "negative" voltages in the conductivity cell. (The "negative" meaning the part of the cycle where the electrodes connections are inverted). There is no exact guide as to the duration of both but the general rule is for them to be at least 10% of the period of PWM0 or the excitation frequency. These cannot be configured and scale automatically based on the excitation frequency which is either 94Hz and 2.4kHz. 

    3. CN0349 and CN0359 offer a higher degree of accuracy in conductivity readings. The CN0411 was designed for single supply operation with a lower power consumption to measure total dissolved solids in portable/handheld instrument applications. CN0359 and CN0349 support 4-wire conductivity probes while the CN0411 supports only 2-wire probes.

    If you can discuss some details of your intended application, I can direct you to which board is more suited for you to use as reference.

    Regards,

    Nikko

  • Thank you very much for the detailed response! That entirely answers those questions. I'm building a multi-sensor water quality tester that can run on batteries... so your comparison to CN03x9 implies going with 0411 is the right approach!

    For PWM, the 10% pulse width, centered on pulse is enough info to implement. I don't plan to use the included software (Not sure how you'd do that if you're not using the example MCU, and/or are integrating it into another program). It sounds like all the software needs to do is this: Setup up 3 PWM GPIOS, and 3 binary ones (for the multiplexer), Read from the ADC's differential input, and send signals to the DAC to set its voltage.

    Your response to point 1 clarifies things. And brings up another question: Presumably, the resulting value is measured by the differential voltage at the ADC (The outputs of the track-and-hold circuits). Does current play direction into this, or is that interpreted from the voltage the ADC receives? Related: Is a fixed 2.5V Vref at the ADC required for this, given it's a differential input? Thank you.

  • 0
    •  Analog Employees 
    on Jul 23, 2020 3:13 AM 4 months ago in reply to The Alchemist

    The resulting voltage is by idea "differential" since it is V+ - V-. However, V+ and V- are sample at different times in each excitation voltage cycle. Since the 2 electrodes are switched in each cycle, the circuit samples V+ and V- as single ended signals.

    The current through the electrodes is required to compute the conductance and yes, it is interpreted from the voltage the ADC receives alongside the current gain resistance setting and the DAC voltage output.

    The 2.5V reference is not necessarily fixed. It is just that the circuit uses the ADC internal reference of 2.5V and shares it with the DAC eliminating the need for an external reference.

    Regards,

    Nikko

  • Thank you again! I think I'm now ready to build the thing, and work on the software in the meanwhile. It sounds like the 2.5Vref could be substituted for an ADC's internal VREF. Going to ignore it for now and assume the ADC will handle things correctly. Extracting the result would be a matter of running the ADC readings from V+ and V- through the equations at the bottom of CN0411, and/or summing them and mapping to a model based on calibration. (eg see how V+ - V- compares to ec of known solutions).

    I'm used to things that are simpler to model like RTD temp and pH, where ADC voltage (from differential or single-end) maps almost linearly to temp/pH respectively, and you just create a linear or polynomial model from 2 or 3 calibration pts. This seems more complicated, but maybe could be reduced to something similar. (Maybe use a diff model for each gain setting?)

  • Another question about PWM: Are all the PWM pulses between +VCC and 0, or is there -VCC pulses? Ie, where it says "Negative Voltage Hold Time" in Figure 9, does that just mean 0?

    I'm running this procedure in code - is this right? `pwm0` is 50% duty cycle, and `pwm1` and `pwm2` are at 17% duty cycle. All three are selectable to 94Hz, or 2.4kHz:

    ```rust

    pwm0.enable();
    pwm1.enable();

    delay_delay_us(5_319); // 5_319.1489μs is half of 94Hz's period
    pwm2.enable();

    ```