Post Go back to editing

How do I calibrate and calculate AD5933 for impedance measurement.

I have been trying to get the impedance values using AD5933 but I keep getting wrong results. I have been comparing the result with my AD5399EBZ evaluation board. My circuit is same as the evaluation board but I am not getting the desired results. I have read the manuals AN-1252 and UG-364 and I think that I did my steps accordingly but my results are different from AD5399EBZ board. For calibration, I selected R_unknown=100k and R_fb=100k values in Evaluation board circuit and my circuit and calculated Gain factor. The results are that Evaluation board GainFactor = 1.029e-9 and my circuit GainFactor = 4.46e-6. When I changed R_unknown  = 90k/300k in evaluaton board results are okay but in my board they show 100k. My circuit  implementation is provided below.

Pin #1 in AD5399 namely EXT_OUT's function is not provided in datasheet. so I have left them out.

Pin #2 and #3 are also left out. What is the function of these 3 pins ?

When calculating impedance for 100k ohm, I compared the real and imaginary values for my board and evaluation board. The result are:

my real = -1, imag = -2/-3

evaluation board real = 3332, imag = -9081

Apart from switching to increment frequency, all other steps are done according to to flowchart in Evaluation board manual but results are wildly different.

My frequency setting are

starting frequency = 30000, delta frequency  = 2, number of increment = 1, Number of settling time cycles = 15. I calculated for only starting frequency.

My pseudo code is as follow:

if (CALIBRATION_SWITCH_PRESS)

{

         set gain = x1 , 2V p-p (address = 0x80, value = 0x01)

         select external frequency (address = 0x81, value = 0x08)

        set to stand by mode (address = 0x80, value = 0xB0 | 0x01)

        init with start frequency (address = 0x80, value = 0x10 | 0x01)

        start frequency sweep (address = 0x80, value = 0x20 | 0x01)

       wait until ( status & 0x02 == 1 )

        repeat frequency  

       wait until ( status & 0x02 == 1 )

       read real and imaginary data

       GainFactor = 1 / ( 100k * sqrt ( real*real + imag*imag ))

}

if (MEASURE_SWITCH_PRESS)

{

         set gain = x1 , 2V p-p (address = 0x80, value = 0x01)

         select external frequency (address = 0x81, value = 0x08)

        set to stand by mode (address = 0x80, value = 0xB0 | 0x01)

        init with start frequency (address = 0x80, value = 0x10 | 0x01)

        start frequency sweep (address = 0x80, value = 0x20 | 0x01)

       wait until ( status & 0x02 == 1 )

        repeat frequency  

       wait until ( status & 0x02 == 1 )

       read real and imaginary data

       R_unknown = 1 / ( GainFactor * sqrt ( real*real + imag*imag ) )

}

       

  • Pin #1 in AD5399 namely EXT_OUT's function is not provided in datasheet. so I have left them out.

    Pin #2 and #3 are also left out. What is the function of these 3 pins ?

    The function of these pins are not known to public. Hopefully somebody from ADI could shed some light on this subject, but that did not happen in the many years since this same question was posted in this forum.

    my real = -1, imag = -2/-3

    evaluation board real = 3332, imag = -9081

    Something is quite wrong - the Real and Imag values coming from your circuit this low likely indicate that there is no signal coming to VIN pin: as if there is no connection between it and R25. This lack of signal problem should be traced "upstream" all the way to VOUT pin: is the power coming to U5 (by the way, your circuit indicates that R35 is connected to 3.0V  is this a typo, should it be 3.3V?), does your R_UNKNOWN connects to the rest of the circuit? Does the excitation signal get from VOUT to it through the U5? By the way, there is no need for the 4.7k R26 and R27  to be this low - the divider they form somewhat overloads the VOUT voltage source as it has comparable internal resistance. It would make sense increasing those R26 and R27 to 47k and above, could be the same as R28 and R31 . If you have access to an oscilloscope - it would be worth checking the voltage on VOUT pin, see if the excitation voltage is there as programmed,  make sure that the voltage is about the same on the U5:A output (only at a Vdd/2 DC baseline), connect R_UNCNOWN = RFB and see if the signal is the same at the U5:B output (at the Vdd/2 DC baseline). Under normal circumstances you will not see much of anything at your TP2  except Vdd/2 DC voltage - this point is a virtual ground for the AD5933 internal OPAMP, so it is better test the voltage at the RFB pin - it again should be the same as at all the points mentioned above.

    I will take a look at your pseudo-code as the time permits...

  • I made some changes in my board and Evaluation board. I connected my board SCL and SDA to Evaluation board AD5399 SCL and SDA pins and made the two systems ground common. Upon running calibration code and impedance measurement code with 100k connected at R_fb and R_unknown, I get correct values for some resistors and haphazard values for others. For example , with above pseudo code connected to evaluation board I2C pins, I got for 90k -> 265k, 100k -> 100k, 180k -> 180k, 250k -> 745k, 300k-> 300k.

    The problem definitely seems to be in the code here. I want to ask you do we need to put some time delays or No-operation code in Control registers after some specific operations ?

    Regarding the real and imaginary values, I directly squared the 2's complement of obtained real and imaginary values. Did I do wrong here ? Do I have to convert them to some other formats before squaring and adding them ?

    I have been trying a lot of things for past few days but I can't seem to make it work correctly.

  • The problem definitely seems to be in the code here.

    I do not see any problems with your pseudo-code. Since you have your own board hooked up to the Eval board, you can always use the Demo software that came with the board and see if you get with it the same results as with your code. 

    do we need to put some time delays or No-operation code in Control registers after some specific operations ?

    I have never done that and doubt that there is any need to do so. The only thing is the Number of Settling Cycles should not be 0.

    I directly squared the 2's complement of obtained real and imaginary values.

    Those should be converted into the decimals:

    //For both Re and Im data in 2-comp form
    If Data <= 0x7FFF Then
    //Positive Data - do nothing
    Else
    // Negative Data
    Data = Data  - 65536

    Hope this helps, best of luck!

  • I checked evaluation board I2C communication using logic analyzer. The data in evaluation board were read and written 1 byte at a time. I was trying to do bulk data read and write. I did according to the evaluation board and I am getting the real and imaginary data but there is deviation between the my real, imaginary and evaluation board real, imaginary for same Rcal and Rfb.

    My real and imaginary data differ from evaluation board real and imaginary . So as I measure values farther away from calibration resistor, the error increases more.

    In figures below, the waveform is for 9.1 M ohm resistor for my board and evaluation board. I calibrated both these boards with RFB = 1M, Rcal = 1M. The first picture is from U5-B pin 7 of Impedance board output 

    In my board the output Vp-p = 1.84 V

    The second waveform is U1-B pin 7 of evaluation board. In evaluation board the output Vp-p = 840 mV

    To the best of my knowledge my circuit schematic is the same as evaluation board with 3.3V supply, and op amp is AD8606 . The crystal oscillator part name is different BMS-873R it is 16 MHz. For high pass filter in my board , C33, 47 nF, I used chip capacitor while evaluation board, the high pass filter is C7 ,47 nF is tantal capacitor. Could this be the difference . I wonder why there is deviation and what other factors could be causing this ?

  • values farther away from calibration resistor, the error increases more.

    This is to be expected. Re and Im values are proportional to admittance, the inverse of the impedance. The admittance absolute error is approximately constant for any admittance within the ADC dynamic range. The relative errors is certainly higher as the admittance decreases. All the formulas used for calculation impedance from Re and IM effectively invert the data, so both absolute and relative errors depend on impedance.

    I used chip capacitor while evaluation board, the high pass filter is C7 ,47 nF is tantal capacitor.

    I do not think it is a tantalum capacitor on the evaluation board - it looks like a leaded ceramic one. A a non-polar capacitor would be preferable in the circuit as designed. The type of oscillator should not matter at all.

    In my board the output Vp-p = 1.84 V

    The second waveform is U1-B pin 7 of evaluation board. In evaluation board the output Vp-p = 840 mV

    The signal amplitudes are more than twice different - no wonder Re and Im values differ. Probably it is not your code, except different excitation voltages ended up  programmed into your board and evaluation board. Something in the signal chain is not identical, certainly should not be the capacitors you mentioned, could be just a poor contact when you connect your resistor to the evaluation board? Since you have the scope, why not just poking at every node in the signal chain: AD5933  VOUT pin, pin 3 of the U5-A, pin 1 of  the U5-A, pin 7 of the U5-B, pin RFB? With Rcal=Rfb the DC offset and the amplitude voltage of the sinewave should be the same on all pins, except VOUT, where DC offset should be different.

    What is your excitation frequency? Could not quite make it out from the relatively low-resolution scope screenshots.

  • Hello all,

    I am also facing the same issue of calibrating and measuring the impedance of an unknown element.

    So, I am using AD5933 evaluation board where I got one eval software which after sweep provides the impedance and phase value. One can download .csv file with DFTs real and imaginary values, magnitude, frequency ,phase and impedance. But while calibration of AD5933 i am unable to understand that

    i)the calibration impedance box which is given in the software needs to be the same with the RFB port which is empty in the board or not. 

    ii)If the gain factor is being calculated as (GF=1/impedance/magnitude) then how come it is changing every time when program device registers are clicked, and GF is being calculated.

    iii)If freq sweep is done then the .csv file is generated with DFTs real and imaginary values, magnitude, frequency ,phase and impedance value of the Z.So thsi Z and RFB needs to be same or Z and Rcal from the software needs to be same or three should be same?

  • Can you post your .csv files? In the post menu you can go Insert->Image/video/file and select the .csv to be added to the post.
    If you attach the .csv you get with the calibration resistor and the .csv you get with the "unknown" impedance we could walk you through the calculation required for calibration and measurement. To save time, the .csv for the "unknown" impedance can be just a one more sweep with the same calibration resistor.
    To arrive at the correct results it is necessary for the Rfb to be calculated based on the formula on p.5 in the application note AN 1252. Since you are using the evaluation board, Vdcoffset = Vdd/2 and the denominator turns into just Vpk. Vpk in the formula is a half of the Vp-p in the Table 5 in the datasheet. Zmin should be substituted with the value equal to your Rcalibration and Zunknown in subsequent measurements should always exceed or be equal to the Zmin.
    The raw Re and Im data in the .csv are not affected by any of the Rfb and Rcalibration settings in the software, and working with the raw data would be the most straightforward way to the results. Getting accustomed to the evaluation software functionality will be much easier then, or, perhaps, even unnecessary as you are going to be in full control of all the required calculations.