Post Go back to editing

Ad5933 analog front end - 4 electrode measuring

Hey everyone,

I need to implement a four electrode measuring circuit to interface with the Ad5933.

Ive used the suggested analog front end in the attached link, which is very popular throughout the references:

www.instructables.com/.../

My problem:

Im able to calibrate a 1k resistor but whenever I change the load after calibration it shows very little difference, for instance an avg of 1040 ohm instead of 1000 ohm when I plug a 2k resistor.

Sometimes it shows even a lower avg value.

My setup:

For the opamps I ised TL072 and for the inamp I used INA118P. both are have suitable specs for the job.

I used 1M resistor for R current and R protect and used Rin of 2k and Rfb of 1k.

Ive fed the inamp and opamps with v+ of 10v and v- of negative 10v.

Ive attached all grounds in the system.

I short circuited all the ad5933 vdd pins and have them 5v vdd from an arduino, and did the same for the ground pins and attached to the common ground.

The ad5934 is controlled via the arduino by attaching a4 and a5 pins to scl and sda pins.

Finally ive attached a 1k resistor as the load between the four electrodes. Each pole of the resistor gets two parallel electrodes.

Ive checked my wiring a hundred times and Ive tried to add Rg to the inamp.

Ive tried to play with rfb and r in.

Ive chexked with a scope in every point to see that the signal is what its supposed to be. Im sure its good until the inamps input, where im not quite sure because I get very low voltage different across the input pins (20mv).

I would cery much appreciate guidance

Ben

Parents
  • It is had to suggest much without seeing the exact schematic with all connections and component values. Referring to a general sketch in your link, first suspect to check would be the DC working point for the entire schematic as the AD5933, generally speaking, requires the AC signals to have zero line at Vdd/2 = 2.5V in your case. Can you check if the DC voltage is 2.5V at:
    1. The left pin of Rcurrent resistor
    2. The output of the Vref Generator
    3. The right pin of Rprotect
    4. The left pin of Rin
    5. The RF pin of the AD5933
    ?
    If all is well, can you check that the AC voltage at the RFB pin of the AD5933 is a well-formed sinewave without any distortion or clipping at 0V or Vdd or both?
    Also, what settings are you programming into the AD5933? Excitation voltage, PGA gain, frequency range, number of settling cycles, etc.? 

  • Hi Snorlax and Benomiri.

    Hope it's ok to jump on the thread. I'm also currently building the same circuit. For me everything in the circuit is working as expected. However, it is the circuit design that is not working for me. The overall aim of the circuit is to allow the AD5933 to work with 4-electrodes. 

    My issue is that - as the impedance of the sample increases, the gain of the inverting op-amp increases (in red in the picture) and the signal into in instrumentation amp (INA818) increases, thereby increasing the voltage at Vin. So to summarise - increasing impedance increases Vin.

    This contrasts with the standard operation of the AD5933 whereby increasing the impedance decreases Vin (as shown in green)

    I have verified this behaviour with an oscilloscope. A similar circuit has also been posted here (https://ez.analog.com/dds/f/q-a/28675/ad5933-4-wire-configuration-question) which has a similar issue when I built it.

    Just wondering if it is possible to rearrange the circuit so that Vin is inversely proportional to Z or am I missing something else

     ?

    Thanks

    Barry

  • You are certainly welcome to join!

    The overall aim of the circuit is to allow the AD5933 to work with 4-electrodes

    And the aim of using this 4-electrode arrangement is to separate the impedance of the lead wires from the impedance of the load by measuring the voltage across the load at the current set by the value of Rcurrent using the two sensing wires, which carry negligibly small current. In this arrangement the measured voltage is indeed proportional to the load impedance and the beauty of it is that it is free from the influence of the lead wires.

    If you want to rearrange the circuit so that the signal is inversely proportional to the impedance, it means that you need to apply constant voltage to your load and measure current, but the lead wires are by necessity connected in sequence to your load and therefore add their impedance to your load, so the current also depends on the impedance of those lead wires. This means that you have to somehow make those wires' impedance negligibly small in comparison to load by making them super-short, which suggests bringing the measurement circuit very close to the load, which, in turn, may not be convenient or practical. And that eliminates the need for the 4-wire arrangement altogether, so you can get rid of the INA and a couple of OPAMPs, mostly falling back to the basic circuit you outlined green. To summarize: it is either the 4-wire setup and signal proportional to impedance or signal proportional to inverse impedance and no 4-wire setup.

    As you noted, despite the datasheet calling this chip "Impedance Converter," in the basic schematic the values in its output registers are proportional to the admittance - the inverse of impedance - so it should have been called "Admittance Converter." I think the secondary aim of the 4-wire circuit was to make the AD5933 measuring the impedance. What would be the motivation to get the AD5933 output back to be inversely proportional to impedance? To be able to use formulas in the datasheet or the demo software that comes with the evaluation board or reuse some pre-existing code? All those are only programmatically invert the measured admittance to arrive at the impedance values, so there is absolutely no problem to modify the code or run your own calculations with the AD5933 output proportional to the impedance. Would be more than happy to walk you through calibration, etc. 

    - increasing impedance increases Vin.

    Even the name of the pin "VIN" is misleading, because it is not a voltage input, with the RFB attached it serves rather as a current sink node (the so-called "virtual ground"). In proper operation VIN pin has constant voltage of Vcc / 2 and the AD5933 output is proportional to the AC current flowing across the RFB resistor connected to this pin.

  • That's all very clear and helpful. Thanks

    As you correctly assumed, I'm building the analog front-end onto the evaluation board. I can now see (as highlighted in the screenshot) how the admittance is being measured and the impedance is calculated as its inverse.

    Is there anyway to modify the demo code? I understand it's a VB interface or am I better off to either 

    (a - in the short-term) perform the inverse calculation on the exported data

    (b - in the long-term) connect an independent microcontroller and AD5933 to my AFE?

    Regarding calibration, I see in the evaluation software how calibration is performed at a single impedance and the system works from there. In the 4-electrode circuit, I can imagine calibration needs to be performed like a thermometer (using 2 different impedances at the upper and lower ranges of the intended measurements). Then, a linear graduation can be assumed between those two known values.

    Is this correct or will a single point of calibration suffice? I can imagine this might work if all the other components in the circuit are accounted for in the impedance calculation.

    Thanks again for your insight

  • (a - in the short-term) perform the inverse calculation on the exported data

    The demo software does have a rather helpful "Download Impedance Data" button, pushing it allows saving the sweep data in CSV format. The most useful is the raw data from the Re and Im registers and all necessary calculations with it can be performed in Excel.

    In the intermediate term it should be relatively straightforward pulling this Basic code into a VBA macro, so that you can control the evaluation board and run it directly from Excel. In my experience, most of the data collected with whatever sophisticated controllers and systems tends to end up in Excel, so no point fighting it despite all the Excel shortcomings.

    (b - in the long-term) connect an independent microcontroller and AD5933 to my AFE?

    Depending on the end goal - if you need to eventually build some self-contained device - that is where it tends to go. There are quite a few examples floating on this forum and on the Web of people building AFE + bare AD5933 chip with Arduino-type microcontrollers.

    Regarding calibration

    The ones you mentioned (and what is touted in the datasheet)  works reasonably well only for a very narrow frequency range. In my experience it is much more straightforward and better to calibrate at each frequency point within frequency sweep rather than fiddling with single point or two-point calibration. Microcontroller memory is cheap and readily available these days, so storing and using the entire calibration curve makes more sense than a single calibration number of questionable quality/accuracy.

    If you are comfortable with complex numbers, the notation is very straightforward. With your 4-wire AFE the output of the AD5933 is proportional to the load impedance: ComplexOutput = ComplexImpedance * ComplexGain. Complex gain is what needs to be calibrated. The easiest is to use a known resistor: its complex impedance has only real part and zero imaginary part: Zcal = Rcal + i * 0. Connect the Rcal resistor and read the AD5933 complex output: ComplexOutput = Zcal * ComplexGain, so ComplexGain = ComplexOutput / Zcal. Do that for every frequency point in your sweep and store this complex gain as a function of frequency. Then connect the unknown impedance Zx, read ComplexOutput and calculate the value of Zx as Zx = ComplexOutput /  ComplexGain at every frequency. The result is the unknown complex impedance Zx as a function of frequency. From this basic data the impedance amplitude, phase and whatever else can be easily calculated.

    A potential pitfall: throughout this procedure the AC voltage on the AD5933 RFB pin should be a well-formed sine wave without any distortion or clipping at the power supply rails. This suggests that with the 4-wire AFE the calibration should be performed using the impedance which is the highest value from the expected unknown impedance range and the AC voltage at the RFB pin is preferably close to 2 V p-p to capture most of the available dynamic range of the built-in ADC.

    There are some other undocumented potential issues we can discuss if/as they surface. 

  • Hey Snorlax, Its been a while Slight smile

    ll those are only programmatically invert the measured admittance to arrive at the impedance values, so there is absolutely no problem to modify the code or run your own calculations with the AD5933 output proportional to the impedance. Would be more than happy to walk you through calibration, etc. 

    Ive managed to make my circuit work properly. I', having a bit difficulty with the code.

    As you mentioned, the AD5933 is actually an admittance converter. 

    I'm having trouble finding the right correlation between the AD5933 out (real,imaginary) to the impedance values I should be getting.

    I'm now applying a constant voltage to the load, using the AD5933 Vout output and my circuitry, and then I measure the voltage across the load and route it back through the circuit to Vin and Rfb.

    Could you walk me through the correlation?

    I've tried many variations with no success

  • I'm now applying a constant voltage to the load,

    Did you mean "current?" Do you still work with the circuit you posted on on Mar 11, 2022 with corrected polarity of the OPAMP inputs?
    Assuming that is the case, the AD5933 Re and Im outputs are now proportional to the voltage between E1 and E2, which is, in turn, proportional to the impedance Z connected between these E1 and E2: Re + i * Im = G * Z, where G is the complex system gain. Connect calibration resistor Rcal between E1 and E2 and collect the correspondent values of Recal and Imcal. You can now calculate the complex system gain factor G = (Recal + i * Imcal) / (Rcal + i * 0) - the calibration resistor theoretically is 100% real impedance, has practically no imaginary component. When unknown impedance Z is connected between E1 and E2 and correspondent Re and Im are collected, the value of complex Z is calculated as Z = (Re + i * Im) / G.

  • Did you mean "current?

    Yes, my bad

    So according to what you say, the complex impedance will be Z = (Re+i*Im)/Gain

    hence the magnitude and phase will be accordingly:

    |Z|= (1/Gain) * sqrt(Re^2+Im^2) , Phase= atan2(Im/Re)

    the of the admittance and impedance will be the same? that doesn't seem right

    Also, just to clarify, the values of Re and Im are the values produced by the AD5933 right? no further conversion (over simplifying :the ADC converts the analog signal, which in turn enters the DFT, and the values outputted by the AD5933 are the signal's Real and Imaginary parts)

  • |Z|= (1/Gain) * sqrt(Re^2+Im^2) , Phase= atan2(Im/Re)

    Once you have complex Z = (Re + i * Im) / G, |Z| is simply |Z| = Abs(Z) and Phase = Arg(Z). If you would rather avoid complex-number arithmetic then you need to drag complex gain's G = G' + i * G" real G' and imaginary G' parts into your formulas, so |Z| =  sqrt((Re^2 + Im^2) / (G'^2 + G''^2)).and Phase(Z) = atan2((G' * Im - G" * Re) / (G" * Im + G' * Re)).

    the admittance and impedance will be the same?

    Assuming you have the circuit we discussed  on Mar 11, 2022 this is all about impedance. All that circuit does is making the output of the AD5933 proportional to the impedance between E1 and E2 and that is what the formulas reflect. Without that circuit the output would be proportional to admittance.
    If you mean that the formulas for the admittance "will be the same," yes, except the complex admittance is Y = 1 / Z and then   |Y| = Abs(Y) and Phase(Y) = Arg (Y).

    the values of Re and Im are the values produced by the AD5933 right?

    Yes, the Re and Im values are the ones produced by the AD5933 and assembled by the code into the integers. 

Reply
  • |Z|= (1/Gain) * sqrt(Re^2+Im^2) , Phase= atan2(Im/Re)

    Once you have complex Z = (Re + i * Im) / G, |Z| is simply |Z| = Abs(Z) and Phase = Arg(Z). If you would rather avoid complex-number arithmetic then you need to drag complex gain's G = G' + i * G" real G' and imaginary G' parts into your formulas, so |Z| =  sqrt((Re^2 + Im^2) / (G'^2 + G''^2)).and Phase(Z) = atan2((G' * Im - G" * Re) / (G" * Im + G' * Re)).

    the admittance and impedance will be the same?

    Assuming you have the circuit we discussed  on Mar 11, 2022 this is all about impedance. All that circuit does is making the output of the AD5933 proportional to the impedance between E1 and E2 and that is what the formulas reflect. Without that circuit the output would be proportional to admittance.
    If you mean that the formulas for the admittance "will be the same," yes, except the complex admittance is Y = 1 / Z and then   |Y| = Abs(Y) and Phase(Y) = Arg (Y).

    the values of Re and Im are the values produced by the AD5933 right?

    Yes, the Re and Im values are the ones produced by the AD5933 and assembled by the code into the integers. 

Children
No Data